All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nfp: add basic multicast filtering
@ 2018-01-04 15:10 Simon Horman
  2018-01-04 19:52 ` Simon Horman
  2018-01-05 18:47 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Simon Horman @ 2018-01-04 15:10 UTC (permalink / raw)
  To: David Miller, Jakub Kicinski; +Cc: netdev, oss-drivers, Simon Horman

From: Jakub Kicinski <jakub.kicinski@netronome.com>

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 <jakub.kicinski@netronome.com>
Signed-off-by: Simon Horman <simon.horman@netronome.com>
---
 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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] nfp: add basic multicast filtering
  2018-01-04 15:10 [PATCH] nfp: add basic multicast filtering Simon Horman
@ 2018-01-04 19:52 ` Simon Horman
  2018-01-05 18:47 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2018-01-04 19:52 UTC (permalink / raw)
  To: David Miller, Jakub Kicinski; +Cc: netdev, oss-drivers

On Thu, Jan 04, 2018 at 04:10:19PM +0100, Simon Horman wrote:
> From: Jakub Kicinski <jakub.kicinski@netronome.com>
> 
> 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 <jakub.kicinski@netronome.com>
> Signed-off-by: Simon Horman <simon.horman@netronome.com>

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
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] nfp: add basic multicast filtering
  2018-01-04 15:10 [PATCH] nfp: add basic multicast filtering Simon Horman
  2018-01-04 19:52 ` Simon Horman
@ 2018-01-05 18:47 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2018-01-05 18:47 UTC (permalink / raw)
  To: simon.horman; +Cc: jakub.kicinski, netdev, oss-drivers

From: Simon Horman <simon.horman@netronome.com>
Date: Thu,  4 Jan 2018 16:10:19 +0100

> From: Jakub Kicinski <jakub.kicinski@netronome.com>
> 
> 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 <jakub.kicinski@netronome.com>
> Signed-off-by: Simon Horman <simon.horman@netronome.com>

Applied, thanks Simon.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-01-05 18:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-04 15:10 [PATCH] nfp: add basic multicast filtering Simon Horman
2018-01-04 19:52 ` Simon Horman
2018-01-05 18:47 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.