Commit d43a7e67 authored by Vladislav Zolotarov's avatar Vladislav Zolotarov Committed by David S. Miller
Browse files

bnx2x: Do not allow enabling LRO if disable_tpa=1



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

Signed-off-by: default avatarVladislav Zolotarov <vladz@broadcom.com>
Signed-off-by: default avatarEilon Greenstein <eilong@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f1e1a199
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -9968,12 +9968,14 @@ static int bnx2x_set_flags(struct net_device *dev, u32 data)

	/* TPA requires Rx CSUM offloading */
	if ((data & ETH_FLAG_LRO) && bp->rx_csum) {
		if (!disable_tpa) {
			if (!(dev->features & NETIF_F_LRO)) {
				dev->features |= NETIF_F_LRO;
				bp->flags |= TPA_ENABLE_FLAG;
				changed = 1;
			}

		} else
			rc = -EINVAL;
	} else if (dev->features & NETIF_F_LRO) {
		dev->features &= ~NETIF_F_LRO;
		bp->flags &= ~TPA_ENABLE_FLAG;