summaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/drivers/net
diff options
context:
space:
mode:
authorPetr Machata <petrm@nvidia.com>2024-10-07 18:26:07 +0200
committerJakub Kicinski <kuba@kernel.org>2024-10-09 00:37:24 +0200
commit787f148cec340114dc22c49d8b045ff3ff0adad6 (patch)
tree76b19e292e0713b91c89cd1b975a6306ef2e3491 /tools/testing/selftests/drivers/net
parentselftests: mlxsw: sch_red_core: Increase backlog size tolerance (diff)
downloadlinux-787f148cec340114dc22c49d8b045ff3ff0adad6.tar.xz
linux-787f148cec340114dc22c49d8b045ff3ff0adad6.zip
selftests: mlxsw: sch_red_core: Sleep before querying queue depth
The qdisc stats are taken from the port's periodic HW stats, which are updated once a second. We try to accommodate the latency by using busywait in build_backlog(). The issue in that seems to be that when do_mark_test() builds the backlog, it makes the decision whether to send more packets based on the first instance of the queue depth stat exceeding the current value, when in fact more traffic is on the way and the queue depth would increase further. This leads to failures in TC 1 of mark-mirror test, where we see the following failure: TEST: TC 0: marked packets mirror'd [ OK ] TEST: TC 1: marked packets mirror'd [FAIL] Spurious packets (1680 -> 2290) observed without buffer pressure Fix by waiting for the full second before reading the queue depth for the first time, to make sure it reflects all in-flight traffic. Signed-off-by: Petr Machata <petrm@nvidia.com> Reviewed-by: Amit Cohen <amcohen@nvidia.com> Link: https://patch.msgid.link/321dcf8b3e9a1f0766429c8cf3e3f1746f1bc375.1728316370.git.petrm@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/testing/selftests/drivers/net')
-rw-r--r--tools/testing/selftests/drivers/net/mlxsw/sch_red_core.sh1
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/testing/selftests/drivers/net/mlxsw/sch_red_core.sh b/tools/testing/selftests/drivers/net/mlxsw/sch_red_core.sh
index a25a15eb6d31..b1ff395b3880 100644
--- a/tools/testing/selftests/drivers/net/mlxsw/sch_red_core.sh
+++ b/tools/testing/selftests/drivers/net/mlxsw/sch_red_core.sh
@@ -372,6 +372,7 @@ build_backlog()
local i=0
while :; do
+ sleep 1
local cur=$(busywait 1100 until_counter_is "> $cur" \
get_qdisc_backlog $vlan)
local diff=$((size - cur))