Commit db63e489 authored by Willem de Bruijn's avatar Willem de Bruijn Committed by David S. Miller

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: default avatarWillem de Bruijn <willemb@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 52900d22
...@@ -651,12 +651,13 @@ static void do_flush_datagram(int fd, int type) ...@@ -651,12 +651,13 @@ static void do_flush_datagram(int fd, int type)
static void do_rx(int domain, int type, int protocol) static void do_rx(int domain, int type, int protocol)
{ {
const int cfg_receiver_wait_ms = 400;
uint64_t tstop; uint64_t tstop;
int fd; int fd;
fd = do_setup_rx(domain, type, protocol); fd = do_setup_rx(domain, type, protocol);
tstop = gettimeofday_ms() + cfg_runtime_ms; tstop = gettimeofday_ms() + cfg_runtime_ms + cfg_receiver_wait_ms;
do { do {
if (type == SOCK_STREAM) if (type == SOCK_STREAM)
do_flush_tcp(fd); do_flush_tcp(fd);
......
...@@ -25,6 +25,8 @@ readonly path_sysctl_mem="net.core.optmem_max" ...@@ -25,6 +25,8 @@ readonly path_sysctl_mem="net.core.optmem_max"
if [[ "$#" -eq "0" ]]; then if [[ "$#" -eq "0" ]]; then
$0 4 tcp -t 1 $0 4 tcp -t 1
$0 6 tcp -t 1 $0 6 tcp -t 1
$0 4 udp -t 1
$0 6 udp -t 1
echo "OK. All tests passed" echo "OK. All tests passed"
exit 0 exit 0
fi fi
......
...@@ -35,6 +35,9 @@ run_udp() { ...@@ -35,6 +35,9 @@ run_udp() {
echo "udp gso" echo "udp gso"
run_in_netns ${args} -S 0 run_in_netns ${args} -S 0
echo "udp gso zerocopy"
run_in_netns ${args} -S 0 -z
} }
run_tcp() { run_tcp() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment