]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
vsock/test: Add test for a linear and non-linear skb getting coalesced
authorMichal Luczaj <mhal@rbox.co>
Tue, 13 Jan 2026 15:08:19 +0000 (16:08 +0100)
committerJakub Kicinski <kuba@kernel.org>
Fri, 16 Jan 2026 03:44:44 +0000 (19:44 -0800)
commita63e5fe0959200afcfefa7640db44c491f102c4c
treeebde86cbf17431ad1fec44fe6db2199d2de378ff
parent0386bd321d0f95d041a7b3d7b07643411b044a96
vsock/test: Add test for a linear and non-linear skb getting coalesced

Loopback transport can mangle data in rx queue when a linear skb is
followed by a small MSG_ZEROCOPY packet.

To exercise the logic, send out two packets: a weirdly sized one (to ensure
some spare tail room in the skb) and a zerocopy one that's small enough to
fit in the spare room of its predecessor. Then, wait for both to land in
the rx queue, and check the data received. Faulty packets merger manifests
itself by corrupting payload of the later packet.

Signed-off-by: Michal Luczaj <mhal@rbox.co>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Link: https://patch.msgid.link/20260113-vsock-recv-coalescence-v2-2-552b17837cf4@rbox.co
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/vsock/vsock_test.c
tools/testing/vsock/vsock_test_zerocopy.c
tools/testing/vsock/vsock_test_zerocopy.h