]> www.infradead.org Git - users/dwmw2/linux.git/commit
udp: gso: do not drop small packets when PMTU reduces
authorYan Zhai <yan@cloudflare.com>
Fri, 31 Jan 2025 08:31:39 +0000 (00:31 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 3 Feb 2025 10:13:27 +0000 (10:13 +0000)
commit235174b2bed88501fda689c113c55737f99332d8
treecc1e7c385a6442d930ad53cc0129cff72ddbd978
parente0efe83ed325277bb70f9435d4d9fc70bebdcca8
udp: gso: do not drop small packets when PMTU reduces

Commit 4094871db1d6 ("udp: only do GSO if # of segs > 1") avoided GSO
for small packets. But the kernel currently dismisses GSO requests only
after checking MTU/PMTU on gso_size. This means any packets, regardless
of their payload sizes, could be dropped when PMTU becomes smaller than
requested gso_size. We encountered this issue in production and it
caused a reliability problem that new QUIC connection cannot be
established before PMTU cache expired, while non GSO sockets still
worked fine at the same time.

Ideally, do not check any GSO related constraints when payload size is
smaller than requested gso_size, and return EMSGSIZE instead of EINVAL
on MTU/PMTU check failure to be more specific on the error cause.

Fixes: 4094871db1d6 ("udp: only do GSO if # of segs > 1")
Signed-off-by: Yan Zhai <yan@cloudflare.com>
Suggested-by: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/udp.c
net/ipv6/udp.c
tools/testing/selftests/net/udpgso.c