Skip to content

Commit 5264ab6

Browse files
wdebruijkuba-moo
authored andcommitted
selftests/net: calibrate txtimestamp
The test sends packets and compares enqueue, transmit and Ack timestamps with expected values. It installs netem delays to increase latency between these points. The test proves flaky in virtual environment (vng). Increase the delays to reduce variance. Scale measurement tolerance accordingly. Time sensitive tests are difficult to calibrate. Increasing delays 10x also increases runtime 10x, for one. And it may still prove flaky at some rate. Signed-off-by: Willem de Bruijn <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 84fc240 commit 5264ab6

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

tools/testing/selftests/net/txtimestamp.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ set -e
88

99
setup() {
1010
# set 1ms delay on lo egress
11-
tc qdisc add dev lo root netem delay 1ms
11+
tc qdisc add dev lo root netem delay 10ms
1212

1313
# set 2ms delay on ifb0 egress
1414
modprobe ifb
1515
ip link add ifb_netem0 type ifb
1616
ip link set dev ifb_netem0 up
17-
tc qdisc add dev ifb_netem0 root netem delay 2ms
17+
tc qdisc add dev ifb_netem0 root netem delay 20ms
1818

1919
# redirect lo ingress through ifb0 egress
2020
tc qdisc add dev lo handle ffff: ingress
@@ -24,9 +24,11 @@ setup() {
2424
}
2525

2626
run_test_v4v6() {
27-
# SND will be delayed 1000us
28-
# ACK will be delayed 6000us: 1 + 2 ms round-trip
29-
local -r args="$@ -v 1000 -V 6000"
27+
# SND will be delayed 10ms
28+
# ACK will be delayed 60ms: 10 + 20 ms round-trip
29+
# allow +/- tolerance of 8ms
30+
# wait for ACK to be queued
31+
local -r args="$@ -v 10000 -V 60000 -t 8000 -S 80000"
3032

3133
./txtimestamp ${args} -4 -L 127.0.0.1
3234
./txtimestamp ${args} -6 -L ::1

0 commit comments

Comments
 (0)