From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simon Horman Subject: Re: [PATCH] nfp: add basic multicast filtering Date: Thu, 4 Jan 2018 20:52:08 +0100 Message-ID: <20180104195207.phxy3ktkptjb3b3o@netronome.com> References: <20180104151019.18398-1-simon.horman@netronome.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: netdev@vger.kernel.org, oss-drivers@netronome.com To: David Miller , Jakub Kicinski Return-path: Received: from mail-wm0-f67.google.com ([74.125.82.67]:41683 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752617AbeADTwM (ORCPT ); Thu, 4 Jan 2018 14:52:12 -0500 Received: by mail-wm0-f67.google.com with SMTP id g75so5540446wme.0 for ; Thu, 04 Jan 2018 11:52:11 -0800 (PST) Content-Disposition: inline In-Reply-To: <20180104151019.18398-1-simon.horman@netronome.com> Sender: netdev-owner@vger.kernel.org List-ID: On Thu, Jan 04, 2018 at 04:10:19PM +0100, Simon Horman wrote: > From: Jakub Kicinski > > 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 > Signed-off-by: Simon Horman Apologies, I somehow forgot to mark this as being for net-next. > --- > drivers/net/ethernet/netronome/nfp/nfp_net_common.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c > index 0add4870ce2e..29c0947f6d70 100644 > --- a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c > +++ b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c > @@ -2850,6 +2850,11 @@ static void nfp_net_set_rx_mode(struct net_device *netdev) > > new_ctrl = nn->dp.ctrl; > > + if (!netdev_mc_empty(netdev) || netdev->flags & IFF_ALLMULTI) > + new_ctrl |= nn->cap & NFP_NET_CFG_CTRL_L2MC; > + else > + new_ctrl &= ~NFP_NET_CFG_CTRL_L2MC; > + > if (netdev->flags & IFF_PROMISC) { > if (nn->cap & NFP_NET_CFG_CTRL_PROMISC) > new_ctrl |= NFP_NET_CFG_CTRL_PROMISC; > @@ -3787,8 +3792,6 @@ int nfp_net_init(struct nfp_net *nn) > /* Allow L2 Broadcast and Multicast through by default, if supported */ > if (nn->cap & NFP_NET_CFG_CTRL_L2BC) > nn->dp.ctrl |= NFP_NET_CFG_CTRL_L2BC; > - if (nn->cap & NFP_NET_CFG_CTRL_L2MC) > - nn->dp.ctrl |= NFP_NET_CFG_CTRL_L2MC; > > /* Allow IRQ moderation, if supported */ > if (nn->cap & NFP_NET_CFG_CTRL_IRQMOD) { > -- > 2.11.0 >