Skip to content

Commit

Permalink
net-bnx2x: dont reload on GRO change
Browse files Browse the repository at this point in the history
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@google.com>
Cc: Dmitry Kravkov <dmitry@broadcom.com>
Acked-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed May 20, 2013
1 parent f6abf2b commit 8802f57
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 8802f57

Please sign in to comment.