From: Vladislav Zolotarov Date: Wed, 17 Feb 2010 02:03:40 +0000 (+0000) Subject: bnx2x: Do not allow enabling LRO if disable_tpa=1 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d43a7e67ae2f911765b3d5b6cbb85221a9ffd0a4;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Eilon Greenstein Signed-off-by: David S. Miller --- diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c index 16685a153c10..ccdc3fe13414 100644 --- a/drivers/net/bnx2x_main.c +++ b/drivers/net/bnx2x_main.c @@ -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 (!(dev->features & NETIF_F_LRO)) { - dev->features |= NETIF_F_LRO; - bp->flags |= TPA_ENABLE_FLAG; - changed = 1; - } - + 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;