]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
selftests/net: make so_txtime more robust to timer variance
authorWillem de Bruijn <willemb@google.com>
Thu, 12 Dec 2019 16:36:46 +0000 (11:36 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 24 Feb 2020 07:38:15 +0000 (08:38 +0100)
commit45657fe7e50196f673507c4d22fe2365d3fd73bf
tree63aecac3701e4d35098f8391e72b081c793e39f9
parent14382d1f5b43809c6ad32e9710a1f38bd708a0ac
selftests/net: make so_txtime more robust to timer variance

[ Upstream commit ea6a547669b37453f2b1a5d85188d75b3613dfaa ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/testing/selftests/net/so_txtime.c
tools/testing/selftests/net/so_txtime.sh