aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/udp_offload.c
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2024-06-28 18:13:07 -0700
committerJakub Kicinski <kuba@kernel.org>2024-06-28 18:13:08 -0700
commitdb2dede28d824261cd79db98f37c4437371d11b8 (patch)
tree4df48d26c457837969e3d3d377f5d7b37339c39c /net/ipv4/udp_offload.c
parentMerge branch 'net-selftests-mirroring-cleanup' into main (diff)
parentselftests/net: Add test coverage for UDP GSO software fallback (diff)
downloadlinux-db2dede28d824261cd79db98f37c4437371d11b8.tar.gz
linux-db2dede28d824261cd79db98f37c4437371d11b8.zip
Merge branch 'lift-udp_segment-restriction-for-egress-via-device-w-o-csum-offload'
Jakub Sitnicki says: ==================== Lift UDP_SEGMENT restriction for egress via device w/o csum offload This is a follow-up to an earlier question [1] if we can make UDP GSO work with any egress device, even those with no checksum offload capability. That's the default setup for TUN/TAP. Because there is a change in behavior - sendmsg() does no longer return EIO error - I'm submitting through net-next tree, rather than net, as per Willem's advice. [1] https://lore.kernel.org/netdev/87jzqsld6q.fsf@cloudflare.com/ v1: https://lore.kernel.org/r/20240622-linux-udpgso-v1-0-d2344157ab2a@cloudflare.com ==================== Link: https://patch.msgid.link/20240626-linux-udpgso-v2-0-422dfcbd6b48@cloudflare.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/ipv4/udp_offload.c')
-rw-r--r--net/ipv4/udp_offload.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/net/ipv4/udp_offload.c b/net/ipv4/udp_offload.c
index 59448a2dbf2c..aa2e0a28ca61 100644
--- a/net/ipv4/udp_offload.c
+++ b/net/ipv4/udp_offload.c
@@ -357,6 +357,14 @@ struct sk_buff *__udp_gso_segment(struct sk_buff *gso_skb,
else
uh->check = gso_make_checksum(seg, ~check) ? : CSUM_MANGLED_0;
+ /* On the TX path, CHECKSUM_NONE and CHECKSUM_UNNECESSARY have the same
+ * meaning. However, check for bad offloads in the GSO stack expects the
+ * latter, if the checksum was calculated in software. To vouch for the
+ * segment skbs we actually need to set it on the gso_skb.
+ */
+ if (gso_skb->ip_summed == CHECKSUM_NONE)
+ gso_skb->ip_summed = CHECKSUM_UNNECESSARY;
+
/* update refcount for the packet */
if (copy_dtor) {
int delta = sum_truesize - gso_skb->truesize;