]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Mar 2025 11:50:22 +0000 (12:50 +0100)
commit61e7e18fa64c8e3959e013671fab6708f6b2c7b3
tree3aa2a99867f52968a514b242bc649fc3c7973ac9
parent540ffff7925bc89fa43e025949dd0f10d6c1ad30
udp: gso: do not drop small packets when PMTU reduces

[ Upstream commit 235174b2bed88501fda689c113c55737f99332d8 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/ipv4/udp.c
net/ipv6/udp.c
tools/testing/selftests/net/udpgso.c