Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.76 Manually rebased: bcm27xx/patches-6.6/950-0519-usb-dwc3-Set-DMA-and-coherent-masks-early.patch imx/patches-6.6/600-PCI-imx6-Start-link-at-max-gen-first-for-IMX8MM-and-IMX8MP.patch Removed upstreamed: bcm27xx/patches-6.6/950-1446-media-i2c-ov9282-Correct-the-exposure-offset.patch[1] bcm47xx/patches-6.6/701-bgmac-reduce-max-frame-size-to-support-just-MTU-1500.patch[2] bcm53xx/patches-6.6/700-bgmac-reduce-max-frame-size-to-support-just-MTU-1500.patch[3] ramips/patches-6.6/003-v6.14-clk-ralink-mtmips-remove-duplicated-xtal-clock-for-Ralink.patch[4] All other patches automatically rebased. 1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.76&id=11c7649c9ec3dcaf0a7760551ad30747d9e02d81 2, 3. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.76&id=5e6e723675e54ced5200bcc367e2526badc4070c 4. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.76&id=d0edcd0d18d700d76c61c091a24568b8b8c3b387 Build system: x86/64 Build-tested: bcm27xx/bcm2712, flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3 Run-tested: bcm27xx/bcm2712, flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3 Signed-off-by: John Audia <therealgraysky@proton.me> Link: https://github.com/openwrt/openwrt/pull/17822 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
70 lines
2.4 KiB
Diff
70 lines
2.4 KiB
Diff
From: Jakub Sitnicki <jakub@cloudflare.com>
|
|
Date: Thu, 8 Aug 2024 11:56:21 +0200
|
|
Subject: [PATCH] net: Make USO depend on CSUM offload
|
|
|
|
UDP segmentation offload inherently depends on checksum offload. It should
|
|
not be possible to disable checksum offload while leaving USO enabled.
|
|
Enforce this dependency in code.
|
|
|
|
There is a single tx-udp-segmentation feature flag to indicate support for
|
|
both IPv4/6, hence the devices wishing to support USO must offer checksum
|
|
offload for both IP versions.
|
|
|
|
Fixes: 10154dbded6d ("udp: Allow GSO transmit from devices with no checksum offload")
|
|
Suggested-by: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
|
|
Signed-off-by: Jakub Sitnicki <jakub@cloudflare.com>
|
|
Reviewed-by: Willem de Bruijn <willemb@google.com>
|
|
Link: https://patch.msgid.link/20240808-udp-gso-egress-from-tunnel-v4-1-f5c5b4149ab9@cloudflare.com
|
|
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|
---
|
|
|
|
--- a/net/core/dev.c
|
|
+++ b/net/core/dev.c
|
|
@@ -9765,6 +9765,15 @@ static void netdev_sync_lower_features(s
|
|
}
|
|
}
|
|
|
|
+static bool netdev_has_ip_or_hw_csum(netdev_features_t features)
|
|
+{
|
|
+ netdev_features_t ip_csum_mask = NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM;
|
|
+ bool ip_csum = (features & ip_csum_mask) == ip_csum_mask;
|
|
+ bool hw_csum = features & NETIF_F_HW_CSUM;
|
|
+
|
|
+ return ip_csum || hw_csum;
|
|
+}
|
|
+
|
|
static netdev_features_t netdev_fix_features(struct net_device *dev,
|
|
netdev_features_t features)
|
|
{
|
|
@@ -9846,15 +9855,9 @@ static netdev_features_t netdev_fix_feat
|
|
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);
|
|
- bool hw_csum = features & NETIF_F_HW_CSUM;
|
|
-
|
|
- if (!ip_csum && !hw_csum) {
|
|
- netdev_dbg(dev, "Dropping TLS TX HW offload feature since no CSUM feature.\n");
|
|
- features &= ~NETIF_F_HW_TLS_TX;
|
|
- }
|
|
+ if ((features & NETIF_F_HW_TLS_TX) && !netdev_has_ip_or_hw_csum(features)) {
|
|
+ netdev_dbg(dev, "Dropping TLS TX HW offload feature since no CSUM feature.\n");
|
|
+ features &= ~NETIF_F_HW_TLS_TX;
|
|
}
|
|
|
|
if ((features & NETIF_F_HW_TLS_RX) && !(features & NETIF_F_RXCSUM)) {
|
|
@@ -9862,6 +9865,11 @@ static netdev_features_t netdev_fix_feat
|
|
features &= ~NETIF_F_HW_TLS_RX;
|
|
}
|
|
|
|
+ if ((features & NETIF_F_GSO_UDP_L4) && !netdev_has_ip_or_hw_csum(features)) {
|
|
+ netdev_dbg(dev, "Dropping USO feature since no CSUM feature.\n");
|
|
+ features &= ~NETIF_F_GSO_UDP_L4;
|
|
+ }
|
|
+
|
|
return features;
|
|
}
|
|
|