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

selftests: net: cut more slack for gro fwd tests.

The udpgro_fwd.sh self-tests are somewhat unstable. There are
a few timing constraints the we struggle to meet on very slow
environments.

Instead of skipping the whole tests in such envs, increase the
test resilience WRT very slow hosts: increase the inter-packets
timeouts, avoid resetting the counters every second and finally
disable reduce the background traffic noise.

Tested with:

for I in $(seq 1 100); do
./tools/testing/selftests/kselftest_install/run_kselftest.sh \
-t net:udpgro_fwd.sh || exit -1
done

in a slow environment.

Fixes: a062260a9d5f ("selftests: net: add UDP GRO forwarding self-tests")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Link: https://lore.kernel.org/r/f4b6b11064a0d39182a9ae6a853abae3e9b4426a.1706812005.git.pabeni@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Paolo Abeni and committed by
Jakub Kicinski
cb9f4a30 2e7d3b67

+13 -3
+12 -2
tools/testing/selftests/net/udpgro_fwd.sh
··· 39 39 for ns in $NS_SRC $NS_DST; do 40 40 ip netns add $ns 41 41 ip -n $ns link set dev lo up 42 + 43 + # disable route solicitations to decrease 'noise' traffic 44 + ip netns exec $ns sysctl -qw net.ipv6.conf.default.router_solicitations=0 45 + ip netns exec $ns sysctl -qw net.ipv6.conf.all.router_solicitations=0 42 46 done 43 47 44 48 ip link add name veth$SRC type veth peer name veth$DST ··· 84 80 create_vxlan_endpoint $BASE$ns veth$ns $BM_NET_V6$((3 - $ns)) vxlan6$ns 6 85 81 ip -n $BASE$ns addr add dev vxlan6$ns $OL_NET_V6$ns/24 nodad 86 82 done 83 + 84 + # preload neighbur cache, do avoid some noisy traffic 85 + local addr_dst=$(ip -j -n $BASE$DST link show dev vxlan6$DST |jq -r '.[]["address"]') 86 + local addr_src=$(ip -j -n $BASE$SRC link show dev vxlan6$SRC |jq -r '.[]["address"]') 87 + ip -n $BASE$DST neigh add dev vxlan6$DST lladdr $addr_src $OL_NET_V6$SRC 88 + ip -n $BASE$SRC neigh add dev vxlan6$SRC lladdr $addr_dst $OL_NET_V6$DST 87 89 } 88 90 89 91 is_ipv6() { ··· 129 119 # not enable GRO 130 120 ip netns exec $NS_DST $ipt -A INPUT -p udp --dport 4789 131 121 ip netns exec $NS_DST $ipt -A INPUT -p udp --dport 8000 132 - ip netns exec $NS_DST ./udpgso_bench_rx -C 1000 -R 10 -n 10 -l 1300 $rx_args & 122 + ip netns exec $NS_DST ./udpgso_bench_rx -C 2000 -R 100 -n 10 -l 1300 $rx_args & 133 123 local spid=$! 134 124 wait_local_port_listen "$NS_DST" 8000 udp 135 125 ip netns exec $NS_SRC ./udpgso_bench_tx $family -M 1 -s 13000 -S 1300 -D $dst ··· 178 168 # bind the sender and the receiver to different CPUs to try 179 169 # get reproducible results 180 170 ip netns exec $NS_DST bash -c "echo 2 > /sys/class/net/veth$DST/queues/rx-0/rps_cpus" 181 - ip netns exec $NS_DST taskset 0x2 ./udpgso_bench_rx -C 1000 -R 10 & 171 + ip netns exec $NS_DST taskset 0x2 ./udpgso_bench_rx -C 2000 -R 100 & 182 172 local spid=$! 183 173 wait_local_port_listen "$NS_DST" 8000 udp 184 174 ip netns exec $NS_SRC taskset 0x1 ./udpgso_bench_tx $family -l 3 -S 1300 -D $dst
+1 -1
tools/testing/selftests/net/udpgso_bench_rx.c
··· 375 375 do_flush_udp(fd); 376 376 377 377 tnow = gettimeofday_ms(); 378 - if (tnow > treport) { 378 + if (!cfg_expected_pkt_nr && tnow > treport) { 379 379 if (packets) 380 380 fprintf(stderr, 381 381 "%s rx: %6lu MB/s %8lu calls/s\n",