]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
selftest: net: extend msg_zerocopy test with forwarding
authorWillem de Bruijn <willemb@google.com>
Mon, 30 Jun 2025 19:42:12 +0000 (15:42 -0400)
committerJakub Kicinski <kuba@kernel.org>
Wed, 2 Jul 2025 22:07:16 +0000 (15:07 -0700)
commit81d572a551f43c01380e4aa39a6b9f331c931fbc
tree5170087b9fb795ee9716a70f5f93543f03ad7894
parentd2527ad3a9e1f3031095d65376a94a8e640b2b74
selftest: net: extend msg_zerocopy test with forwarding

Zerocopy skbs are converted to regular copy skbs when data is queued
to a local socket. This happens in the existing test with a sender and
receiver communicating over a veth device.

Zerocopy skbs are sent without copying if egressing a device. Verify
that this behavior is maintained even in the common container setup
where data is forwarded over a veth to the physical device.

Update msg_zerocopy.sh to

1. Have a dummy network device to simulate a physical device.
2. Have forwarding enabled between veth and dummy.
3. Add a tx-only test that sends out dummy via the forwarding path.
4. Verify the exitcode of the sender, which signals zerocopy success.

As dummy drops all packets, this cannot be a TCP connection. Test
the new case with unconnected UDP only.

Update msg_zerocopy.c to
- Accept an argument whether send with zerocopy is expected.
- Return an exitcode whether behavior matched that expectation.

Signed-off-by: Willem de Bruijn <willemb@google.com>
Link: https://patch.msgid.link/20250630194312.1571410-3-willemdebruijn.kernel@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/net/msg_zerocopy.c
tools/testing/selftests/net/msg_zerocopy.sh