mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-24 03:24:55 +08:00
ea6a547669
The SO_TXTIME test depends on accurate timers. In some virtualized environments the test has been reported to be flaky. This is easily reproduced by disabling kvm acceleration in Qemu. Allow greater variance in a run and retry to further reduce flakiness. Observed errors are one of two kinds: either the packet arrives too early or late at recv(), or it was dropped in the qdisc itself and the recv() call times out. In the latter case, the qdisc queues a notification to the error queue of the send socket. Also explicitly report this cause. Link: https://lore.kernel.org/netdev/CA+FuTSdYOnJCsGuj43xwV1jxvYsaoa_LzHQF9qMyhrkLrivxKw@mail.gmail.com Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org> Signed-off-by: Willem de Bruijn <willemb@google.com> Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
37 lines
918 B
Bash
Executable File
37 lines
918 B
Bash
Executable File
#!/bin/bash
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
#
|
|
# Regression tests for the SO_TXTIME interface
|
|
|
|
# Run in network namespace
|
|
if [[ $# -eq 0 ]]; then
|
|
if ! ./in_netns.sh $0 __subprocess; then
|
|
# test is time sensitive, can be flaky
|
|
echo "test failed: retry once"
|
|
./in_netns.sh $0 __subprocess
|
|
fi
|
|
|
|
exit $?
|
|
fi
|
|
|
|
set -e
|
|
|
|
tc qdisc add dev lo root fq
|
|
./so_txtime -4 -6 -c mono a,-1 a,-1
|
|
./so_txtime -4 -6 -c mono a,0 a,0
|
|
./so_txtime -4 -6 -c mono a,10 a,10
|
|
./so_txtime -4 -6 -c mono a,10,b,20 a,10,b,20
|
|
./so_txtime -4 -6 -c mono a,20,b,10 b,20,a,20
|
|
|
|
if tc qdisc replace dev lo root etf clockid CLOCK_TAI delta 400000; then
|
|
! ./so_txtime -4 -6 -c tai a,-1 a,-1
|
|
! ./so_txtime -4 -6 -c tai a,0 a,0
|
|
./so_txtime -4 -6 -c tai a,10 a,10
|
|
./so_txtime -4 -6 -c tai a,10,b,20 a,10,b,20
|
|
./so_txtime -4 -6 -c tai a,20,b,10 b,10,a,20
|
|
else
|
|
echo "tc ($(tc -V)) does not support qdisc etf. skipping"
|
|
fi
|
|
|
|
echo OK. All tests passed
|