Skip to content

Commit d0adb51

Browse files
Jakub Kicinskidavem330
authored andcommitted
nfp: add basic multicast filtering
We currently always pass all multicast traffic through. Only set L2MC when actually needed. Since the driver was not making use of the capability to filter out mcast frames, some FW projects don't implement it any more. Don't warn users if capability is not present (like we do for promisc flag). The lack of L2MC capability is assumed to mean all multicast traffic goes through. Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Simon Horman <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent ad52176 commit d0adb51

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

drivers/net/ethernet/netronome/nfp/nfp_net_common.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2850,6 +2850,11 @@ static void nfp_net_set_rx_mode(struct net_device *netdev)
28502850

28512851
new_ctrl = nn->dp.ctrl;
28522852

2853+
if (!netdev_mc_empty(netdev) || netdev->flags & IFF_ALLMULTI)
2854+
new_ctrl |= nn->cap & NFP_NET_CFG_CTRL_L2MC;
2855+
else
2856+
new_ctrl &= ~NFP_NET_CFG_CTRL_L2MC;
2857+
28532858
if (netdev->flags & IFF_PROMISC) {
28542859
if (nn->cap & NFP_NET_CFG_CTRL_PROMISC)
28552860
new_ctrl |= NFP_NET_CFG_CTRL_PROMISC;
@@ -3787,8 +3792,6 @@ int nfp_net_init(struct nfp_net *nn)
37873792
/* Allow L2 Broadcast and Multicast through by default, if supported */
37883793
if (nn->cap & NFP_NET_CFG_CTRL_L2BC)
37893794
nn->dp.ctrl |= NFP_NET_CFG_CTRL_L2BC;
3790-
if (nn->cap & NFP_NET_CFG_CTRL_L2MC)
3791-
nn->dp.ctrl |= NFP_NET_CFG_CTRL_L2MC;
37923795

37933796
/* Allow IRQ moderation, if supported */
37943797
if (nn->cap & NFP_NET_CFG_CTRL_IRQMOD) {

0 commit comments

Comments
 (0)