Skip to content

Commit 51bef03

Browse files
kevinGCkuba-moo
authored andcommitted
selftests/net: deflake GRO tests
GRO tests are timing dependent and can easily flake. This is partially mitigated in gro.sh by giving each subtest 3 chances to pass. However, this still flakes on some machines. Reduce the flakiness by: - Bumping retries to 6. - Setting napi_defer_hard_irqs to 1 to reduce the chance that GRO is flushed prematurely. This also lets us reduce the gro_flush_timeout from 1ms to 100us. Tested: Ran `gro.sh -t large` 1000 times. There were no failures with this change. Ran inside strace to increase flakiness. Signed-off-by: Kevin Krakauer <[email protected]> Reviewed-by: Willem de Bruijn <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 41cda57 commit 51bef03

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

tools/testing/selftests/net/gro.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ run_test() {
1818
"--smac" "${CLIENT_MAC}" "--test" "${test}" "--verbose" )
1919

2020
setup_ns
21-
# Each test is run 3 times to deflake, because given the receive timing,
21+
# Each test is run 6 times to deflake, because given the receive timing,
2222
# not all packets that should coalesce will be considered in the same flow
2323
# on every try.
24-
for tries in {1..3}; do
24+
for tries in {1..6}; do
2525
# Actual test starts here
2626
ip netns exec $server_ns ./gro "${ARGS[@]}" "--rx" "--iface" "server" \
2727
1>>log.txt &

tools/testing/selftests/net/setup_veth.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ setup_veth_ns() {
1111
local -r ns_mac="$4"
1212

1313
[[ -e /var/run/netns/"${ns_name}" ]] || ip netns add "${ns_name}"
14-
echo 1000000 > "/sys/class/net/${ns_dev}/gro_flush_timeout"
14+
echo 100000 > "/sys/class/net/${ns_dev}/gro_flush_timeout"
15+
echo 1 > "/sys/class/net/${ns_dev}/napi_defer_hard_irqs"
1516
ip link set dev "${ns_dev}" netns "${ns_name}" mtu 65535
1617
ip -netns "${ns_name}" link set dev "${ns_dev}" up
1718

0 commit comments

Comments
 (0)