There was a bug introduced during the rework which cause non-zero backlog
being stuck at ETS. Introduce a selftest that would have caught the issue
earlier.

Signed-off-by: Petr Machata <pe...@nvidia.com>
Reviewed-by: Ido Schimmel <ido...@nvidia.com>
---
 tools/testing/selftests/drivers/net/mlxsw/sch_red_ets.sh | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/tools/testing/selftests/drivers/net/mlxsw/sch_red_ets.sh 
b/tools/testing/selftests/drivers/net/mlxsw/sch_red_ets.sh
index 3f007c5f8361..f3ef3274f9b3 100755
--- a/tools/testing/selftests/drivers/net/mlxsw/sch_red_ets.sh
+++ b/tools/testing/selftests/drivers/net/mlxsw/sch_red_ets.sh
@@ -67,6 +67,13 @@ red_test()
 {
        install_qdisc
 
+       # Make sure that we get the non-zero value if there is any.
+       local cur=$(busywait 1100 until_counter_is "> 0" \
+                           qdisc_stats_get $swp3 10: .backlog)
+       (( cur == 0 ))
+       check_err $? "backlog of $cur observed on non-busy qdisc"
+       log_test "$QDISC backlog properly cleaned"
+
        do_red_test 10 $BACKLOG1
        do_red_test 11 $BACKLOG2
 
-- 
2.26.2

Reply via email to