net: thunderx: add MAC address filter tracking for LMAC
authorVadim Lomovtsev <Vadim.Lomovtsev@cavium.com>
Fri, 30 Mar 2018 11:59:48 +0000 (04:59 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sun, 1 Apr 2018 02:18:16 +0000 (22:18 -0400)
commit3a34ecfd9d3f3e0c1584a80349cc7c4312ff5e91
tree0ba4793be62cb0d488ef6d7625d741efcc19141d
parentf8ad1f3f07e06895fe3fc18b5efd2d4b4f22b9d7
net: thunderx: add MAC address filter tracking for LMAC

The ThunderX NIC has two Ethernet Interfaces (BGX) each of them could has
up to four Logical MACs configured. Each of BGX has 32 filters to be
configured for filtering ingress packets. The number of filters available
to particular LMAC is from 8 (if we have four LMACs configured per BGX)
up to 32 (in case of only one LMAC is configured per BGX).

At the same time the NIC could present up to 128 VFs to OS as network
interfaces, each of them kernel will configure with set of MAC addresses
for filtering. So to prevent dupes in BGX filter registers from different
network interfaces it is required to cache and track all filter
configuration requests prior to applying them onto BGX filter registers.

This commit is to update LMAC structures with control fields to
allocate/releasing filters tracking list along with implementing
dmac array allocate/release per LMAC.

Signed-off-by: Vadim Lomovtsev <Vadim.Lomovtsev@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/cavium/thunder/thunder_bgx.c