[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1594180136-15912-3-git-send-email-tanhuazhong@huawei.com>
Date: Wed, 8 Jul 2020 11:48:56 +0800
From: Huazhong Tan <tanhuazhong@...wei.com>
To: <davem@...emloft.net>, <willemb@...gle.com>
CC: <netdev@...r.kernel.org>, <linuxarm@...wei.com>, <kuba@...nel.org>,
Huazhong Tan <tanhuazhong@...wei.com>
Subject: [RFC net-next 2/2] net: disable UDP GSO feature when CSUM is disabled
Since UDP GSO feature is depended on checksum offload, so disable
UDP GSO feature when CSUM is disabled, then from user-space also
can see UDP GSO feature is disabled.
Signed-off-by: Huazhong Tan <tanhuazhong@...wei.com>
---
net/core/dev.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/net/core/dev.c b/net/core/dev.c
index c02bae9..dcb6b35 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -9095,6 +9095,12 @@ static netdev_features_t netdev_fix_features(struct net_device *dev,
features &= ~NETIF_F_TSO6;
}
+ if ((features & NETIF_F_GSO_UDP_L4) && !(features & NETIF_F_HW_CSUM) &&
+ (!(features & NETIF_F_IP_CSUM) || !(features & NETIF_F_IPV6_CSUM))) {
+ netdev_dbg(dev, "Dropping UDP GSO features since no CSUM feature.\n");
+ features &= ~NETIF_F_GSO_UDP_L4;
+ }
+
/* TSO with IPv4 ID mangling requires IPv4 TSO be enabled */
if ((features & NETIF_F_TSO_MANGLEID) && !(features & NETIF_F_TSO))
features &= ~NETIF_F_TSO_MANGLEID;
--
2.7.4
Powered by blists - more mailing lists