]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
selftests/net: packetdrill: pass send_omit_free to MSG_ZEROCOPY tests
authorWillem de Bruijn <willemb@google.com>
Tue, 25 Nov 2025 23:35:05 +0000 (18:35 -0500)
committerJakub Kicinski <kuba@kernel.org>
Wed, 26 Nov 2025 23:57:55 +0000 (15:57 -0800)
The --send_omit_free flag is needed for TCP zero copy tests, to ensure
that packetdrill doesn't free the send() buffer after the send() call.

Fixes: 1e42f73fd3c2 ("selftests/net: packetdrill: import tcp/zerocopy")
Closes: https://lore.kernel.org/netdev/20251124071831.4cbbf412@kernel.org/
Suggested-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: Willem de Bruijn <willemb@google.com>
Link: https://patch.msgid.link/20251125234029.1320984-1-willemdebruijn.kernel@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
12 files changed:
tools/testing/selftests/net/packetdrill/tcp_syscall_bad_arg_sendmsg-empty-iov.pkt
tools/testing/selftests/net/packetdrill/tcp_zerocopy_basic.pkt
tools/testing/selftests/net/packetdrill/tcp_zerocopy_batch.pkt
tools/testing/selftests/net/packetdrill/tcp_zerocopy_client.pkt
tools/testing/selftests/net/packetdrill/tcp_zerocopy_closed.pkt
tools/testing/selftests/net/packetdrill/tcp_zerocopy_epoll_edge.pkt
tools/testing/selftests/net/packetdrill/tcp_zerocopy_epoll_exclusive.pkt
tools/testing/selftests/net/packetdrill/tcp_zerocopy_epoll_oneshot.pkt
tools/testing/selftests/net/packetdrill/tcp_zerocopy_fastopen-client.pkt
tools/testing/selftests/net/packetdrill/tcp_zerocopy_fastopen-server.pkt
tools/testing/selftests/net/packetdrill/tcp_zerocopy_maxfrags.pkt
tools/testing/selftests/net/packetdrill/tcp_zerocopy_small.pkt

index b2b2cdf27e20f67e89d7e1fab96a8d4a50bd3e8c..454441e7ecff6bc0754d88ce17f550a0a6594f34 100644 (file)
@@ -1,6 +1,10 @@
 // SPDX-License-Identifier: GPL-2.0
 // Test that we correctly skip zero-length IOVs.
+
+--send_omit_free       // do not reuse send buffers with zerocopy
+
 `./defaults.sh`
+
     0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3
    +0 setsockopt(3, SOL_SOCKET, SO_ZEROCOPY, [1], 4) = 0
    +0 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
index a82c8899d36bf4b71ad6a6cfc938c520811b2e75..0a0700afdaa38d3cb313b7a07bd1a2a7b6cd8a22 100644 (file)
@@ -4,6 +4,8 @@
 // send a packet with MSG_ZEROCOPY and receive the notification ID
 // repeat and verify IDs are consecutive
 
+--send_omit_free       // do not reuse send buffers with zerocopy
+
 `./defaults.sh`
 
     0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3
index c01915e7f4a15a1ea673ec6f0155c0967313b9f6..df91675d2991c3bb576444ad023ff0e2fb57e308 100644 (file)
@@ -3,6 +3,8 @@
 //
 // send multiple packets, then read one range of all notifications.
 
+--send_omit_free       // do not reuse send buffers with zerocopy
+
 `./defaults.sh`
 
     0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3
index 6509882932e9162d8d0d558193c399da5129f91e..2963cfcb14dfd791a23639f51849f51e9e4a5173 100644 (file)
@@ -1,6 +1,8 @@
 // SPDX-License-Identifier: GPL-2.0
 // Minimal client-side zerocopy test
 
+--send_omit_free       // do not reuse send buffers with zerocopy
+
 `./defaults.sh`
 
     0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 4
index 2cd78755cb2ac330b435993d0c3c5591e6aeed7c..ea0c2fa73c2d666cfb0254063afc2add5b8ebd4e 100644 (file)
@@ -7,6 +7,8 @@
 // First send on a closed socket and wait for (absent) notification.
 // Then connect and send and verify that notification nr. is zero.
 
+--send_omit_free       // do not reuse send buffers with zerocopy
+
 `./defaults.sh`
 
     0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 4
index 7671c20e01cf642d30ba998ea7790eb3a7cf266b..4df978a9b82e70452b6664ed199ae9c42fc371de 100644 (file)
@@ -7,6 +7,9 @@
 // fire two sends with MSG_ZEROCOPY and receive the acks. confirm that EPOLLERR
 // is correctly fired only once, when EPOLLET is set. send another packet with
 // MSG_ZEROCOPY. confirm that EPOLLERR is correctly fired again only once.
+
+--send_omit_free       // do not reuse send buffers with zerocopy
+
 `./defaults.sh`
 
     0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3
index fadc480fdb7fe05dd3b67eb08ca3b6564375dfe7..36b6edc4858c4d9ff6de16184d7f76a770139a72 100644 (file)
@@ -8,6 +8,9 @@
 // fire two sends with MSG_ZEROCOPY and receive the acks. confirm that EPOLLERR
 // is correctly fired only once, when EPOLLET is set. send another packet with
 // MSG_ZEROCOPY. confirm that EPOLLERR is correctly fired again only once.
+
+--send_omit_free       // do not reuse send buffers with zerocopy
+
 `./defaults.sh`
 
     0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3
index 5bfa0d1d2f4a3187c2a3864981cc26be84784f24..1bea6f3b4558dfe9f737c14180936f42df5e4584 100644 (file)
@@ -8,6 +8,9 @@
 // is correctly fired only once, when EPOLLONESHOT is set. send another packet
 // with MSG_ZEROCOPY. confirm that EPOLLERR is not fired. Rearm the FD and
 // confirm that EPOLLERR is correctly set.
+
+--send_omit_free       // do not reuse send buffers with zerocopy
+
 `./defaults.sh`
 
     0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3
index 4a73bbf469610881b490e77069d11b192aebab70..e27c21ff5d18d9d9bea3289528893262a196d122 100644 (file)
@@ -8,6 +8,8 @@
 // one will have no data in the initial send. On return 0 the
 // zerocopy notification counter is not incremented. Verify this too.
 
+--send_omit_free       // do not reuse send buffers with zerocopy
+
 `./defaults.sh`
 
 // Send a FastOpen request, no cookie yet so no data in SYN
index 36086c5877ce7d5e90679b2bcf80ce59a8bf3ed6..b1fa77c77dfa770656bae998c04cefddb3af03c4 100644 (file)
@@ -4,6 +4,8 @@
 // send data with MSG_FASTOPEN | MSG_ZEROCOPY and verify that the
 // kernel returns the notification ID.
 
+--send_omit_free       // do not reuse send buffers with zerocopy
+
 `./defaults.sh
  ./set_sysctls.py /proc/sys/net/ipv4/tcp_fastopen=0x207`
 
index 672f817faca0d16b773af431f48134e05bbf39a2..2f5317d0a9fab560aae86f94963099d54c13a7a2 100644 (file)
@@ -7,6 +7,8 @@
 //    because each iovec element becomes a frag
 // 3) the PSH bit is set on an skb when it runs out of fragments
 
+--send_omit_free       // do not reuse send buffers with zerocopy
+
 `./defaults.sh`
 
     0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3
index a9a1ac0aea4f4ec2f73aeff02efe7cd27cc58d05..9d5272c6b207908e8aa010da1c70324398e86ebb 100644 (file)
@@ -4,6 +4,8 @@
 // verify that SO_EE_CODE_ZEROCOPY_COPIED is set on zerocopy
 // packets of all sizes, including the smallest payload, 1B.
 
+--send_omit_free       // do not reuse send buffers with zerocopy
+
 `./defaults.sh`
 
     0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3