From 54b2b3eccab63e0c359aad562498cd9f49a1547d Mon Sep 17 00:00:00 2001 From: Ben Ben-ishay Date: Wed, 16 Dec 2020 12:32:24 +0200 Subject: [PATCH] net: Prevent HW-GRO and LRO features operate together LRO and HW-GRO are mutually exclusive, this commit adds this restriction in netdev_fix_feature. HW-GRO is preferred, that means in case both HW-GRO and LRO features are requested, LRO is cleared. Signed-off-by: Ben Ben-ishay Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed --- net/core/dev.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/net/core/dev.c b/net/core/dev.c index 4e3d19a06de4..e8754560e641 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -9922,6 +9922,11 @@ static netdev_features_t netdev_fix_features(struct net_device *dev, } } + if ((features & NETIF_F_GRO_HW) && (features & NETIF_F_LRO)) { + netdev_dbg(dev, "Dropping LRO feature since HW-GRO is requested.\n"); + features &= ~NETIF_F_LRO; + } + if (features & NETIF_F_HW_TLS_TX) { bool ip_csum = (features & (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM)) == (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM);