bnx2x: mark LRO as a fixed disabled feature if disable_tpa is set
authorMichal Schmidt <mschmidt@redhat.com>
Tue, 28 Apr 2015 09:34:21 +0000 (11:34 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 29 Apr 2015 18:48:35 +0000 (14:48 -0400)
If disable_tpa is set, remove NETIF_F_LRO from hw_features, so ethtool sees
it as "off [fixed]".

Note that setting the NETIF_F_LRO bit in dev->features in the 'else'
branch is not needed, because the bit was already set by
bnx2x_init_dev().

Then the check for disable_tpa in in bnx2x_fix_features() becomes unnecessary.

Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c

index 3558a36..dcdbd00 100644 (file)
@@ -4834,10 +4834,6 @@ netdev_features_t bnx2x_fix_features(struct net_device *dev,
                features &= ~NETIF_F_GRO;
        }
 
-       /* Note: do not disable SW GRO in kernel when HW GRO is off */
-       if (bp->disable_tpa)
-               features &= ~NETIF_F_LRO;
-
        return features;
 }
 
index b9f85fc..2d067c9 100644 (file)
@@ -12108,10 +12108,10 @@ static int bnx2x_init_bp(struct bnx2x *bp)
        /* Set TPA flags */
        if (bp->disable_tpa) {
                bp->flags &= ~(TPA_ENABLE_FLAG | GRO_ENABLE_FLAG);
+               bp->dev->hw_features &= ~NETIF_F_LRO;
                bp->dev->features &= ~NETIF_F_LRO;
        } else {
                bp->flags |= (TPA_ENABLE_FLAG | GRO_ENABLE_FLAG);
-               bp->dev->features |= NETIF_F_LRO;
        }
 
        if (CHIP_IS_E1(bp))