Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests: extend zerocopy tests to udp

Both msg_zerocopy and udpgso_bench have udp zerocopy variants.
Exercise these as part of the standard kselftest run.

With udp, msg_zerocopy has no control channel. Ensure that the
receiver exits after the sender by accounting for the initial
delay in starting them (in msg_zerocopy.sh).

Signed-off-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Willem de Bruijn and committed by
David S. Miller
db63e489 52900d22

+7 -1
+2 -1
tools/testing/selftests/net/msg_zerocopy.c
··· 651 651 652 652 static void do_rx(int domain, int type, int protocol) 653 653 { 654 + const int cfg_receiver_wait_ms = 400; 654 655 uint64_t tstop; 655 656 int fd; 656 657 657 658 fd = do_setup_rx(domain, type, protocol); 658 659 659 - tstop = gettimeofday_ms() + cfg_runtime_ms; 660 + tstop = gettimeofday_ms() + cfg_runtime_ms + cfg_receiver_wait_ms; 660 661 do { 661 662 if (type == SOCK_STREAM) 662 663 do_flush_tcp(fd);
+2
tools/testing/selftests/net/msg_zerocopy.sh
··· 25 25 if [[ "$#" -eq "0" ]]; then 26 26 $0 4 tcp -t 1 27 27 $0 6 tcp -t 1 28 + $0 4 udp -t 1 29 + $0 6 udp -t 1 28 30 echo "OK. All tests passed" 29 31 exit 0 30 32 fi
+3
tools/testing/selftests/net/udpgso_bench.sh
··· 35 35 36 36 echo "udp gso" 37 37 run_in_netns ${args} -S 0 38 + 39 + echo "udp gso zerocopy" 40 + run_in_netns ${args} -S 0 -z 38 41 } 39 42 40 43 run_tcp() {