]> git.ipfire.org Git - people/ms/linux.git/commitdiff
bnxt_en: fix LRO/GRO_HW features in ndo_fix_features callback
authorVikas Gupta <vikas.gupta@broadcom.com>
Mon, 22 Aug 2022 15:06:54 +0000 (11:06 -0400)
committerJakub Kicinski <kuba@kernel.org>
Tue, 23 Aug 2022 22:32:20 +0000 (15:32 -0700)
LRO/GRO_HW should be disabled if there is an attached XDP program.
BNXT_FLAG_TPA is the current setting of the LRO/GRO_HW.  Using
BNXT_FLAG_TPA to disable LRO/GRO_HW will cause these features to be
permanently disabled once they are disabled.

Fixes: 1dc4c557bfed ("bnxt: adding bnxt_xdp_build_skb to build skb from multibuffer xdp_buff")
Signed-off-by: Vikas Gupta <vikas.gupta@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/broadcom/bnxt/bnxt.c

index ba0f1ffac507126179af73feeb42ba581569bd40..f46eefb5a029252e87c156f8f2f4b77ceae0003e 100644 (file)
@@ -11178,10 +11178,7 @@ static netdev_features_t bnxt_fix_features(struct net_device *dev,
        if ((features & NETIF_F_NTUPLE) && !bnxt_rfs_capable(bp))
                features &= ~NETIF_F_NTUPLE;
 
-       if (bp->flags & BNXT_FLAG_NO_AGG_RINGS)
-               features &= ~(NETIF_F_LRO | NETIF_F_GRO_HW);
-
-       if (!(bp->flags & BNXT_FLAG_TPA))
+       if ((bp->flags & BNXT_FLAG_NO_AGG_RINGS) || bp->xdp_prog)
                features &= ~(NETIF_F_LRO | NETIF_F_GRO_HW);
 
        if (!(features & NETIF_F_GRO))