Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

bnx2x: Do not allow enabling LRO if disable_tpa=1

Bug fix: Do not allow enabling LRO if disable_tpa=1.

Signed-off-by: Vladislav Zolotarov <vladz@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Vladislav Zolotarov and committed by
David S. Miller
d43a7e67 f1e1a199

+8 -6
+8 -6
drivers/net/bnx2x_main.c
··· 9968 9968 9969 9969 /* TPA requires Rx CSUM offloading */ 9970 9970 if ((data & ETH_FLAG_LRO) && bp->rx_csum) { 9971 - if (!(dev->features & NETIF_F_LRO)) { 9972 - dev->features |= NETIF_F_LRO; 9973 - bp->flags |= TPA_ENABLE_FLAG; 9974 - changed = 1; 9975 - } 9976 - 9971 + if (!disable_tpa) { 9972 + if (!(dev->features & NETIF_F_LRO)) { 9973 + dev->features |= NETIF_F_LRO; 9974 + bp->flags |= TPA_ENABLE_FLAG; 9975 + changed = 1; 9976 + } 9977 + } else 9978 + rc = -EINVAL; 9977 9979 } else if (dev->features & NETIF_F_LRO) { 9978 9980 dev->features &= ~NETIF_F_LRO; 9979 9981 bp->flags &= ~TPA_ENABLE_FLAG;