lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 18 May 2013 21:36:07 +0000
From:	"Dmitry Kravkov" <dmitry@...adcom.com>
To:	"Eric Dumazet" <eric.dumazet@...il.com>,
	"David Miller" <davem@...emloft.net>
cc:	netdev <netdev@...r.kernel.org>,
	"Eilon Greenstein" <eilong@...adcom.com>
Subject: RE: [PATCH net-next] net-bnx2x: dont reload on GRO change

> -----Original Message-----
> From: Eric Dumazet [mailto:eric.dumazet@...il.com]
> Sent: Saturday, May 18, 2013 8:15 PM
> To: David Miller
> Cc: netdev; Dmitry Kravkov; Eilon Greenstein
> Subject: [PATCH net-next] net-bnx2x: dont reload on GRO change
> 
> From: Eric Dumazet <edumazet@...gle.com>
> 
> bnx2x_set_features() forces a driver reload if GRO setting is changed.
> 
> A reload makes the ethernet port unresponsive for about 5 seconds.
> 
> This is not needed in the common case LRO is enabled, as LRO
> (TPA_ENABLE_FLAG) has precedence over GRO (GRO_ENABLE_FLAG)
> 
> Tested:
>  Verified that "ethtool -K eth0 gro {on|off}" doesn't blackout
>  the NIC anymore
> 
> Google-Bug-Id: 8440442
> Signed-off-by: Eric Dumazet <edumazet@...gle.com>
> Cc: Dmitry Kravkov <dmitry@...adcom.com>
> ---
>  drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c |   13 ++++++++++---
>  1 file changed, 10 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
> index b8fbe26..6cc5101 100644
> --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
> +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
> @@ -4599,6 +4599,7 @@ int bnx2x_set_features(struct net_device *dev, netdev_features_t features)
>  {
>  	struct bnx2x *bp = netdev_priv(dev);
>  	u32 flags = bp->flags;
> +	u32 changes;
>  	bool bnx2x_reload = false;
> 
>  	if (features & NETIF_F_LRO)
> @@ -4623,10 +4624,16 @@ int bnx2x_set_features(struct net_device *dev, netdev_features_t features)
>  		}
>  	}
> 
> -	if (flags ^ bp->flags) {
> -		bp->flags = flags;
> +	changes = flags ^ bp->flags;
> +
> +	/* if GRO is changed while LRO is enabled, dont force a reload */
> +	if ((changes & GRO_ENABLE_FLAG) && (flags & TPA_ENABLE_FLAG))
> +		changes &= ~GRO_ENABLE_FLAG;
> +
> +	if (changes)
>  		bnx2x_reload = true;
> -	}
> +
> +	bp->flags = flags;
> 
>  	if (bnx2x_reload) {
>  		if (bp->recovery_state == BNX2X_RECOVERY_DONE)
> 
>
Looks good! Thanks, Eric

Acked-by: Dmitry Kravkov <dmitry@...adcom.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ