aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorPetr Machata <petrm@mellanox.com>2019-07-31 10:30:27 +0000
committerDavid S. Miller <davem@davemloft.net>2019-07-31 08:47:13 -0700
commitd11786bb9664a5bed47e7839265f49bb26d54a1b (patch)
tree7949eb273d61cdea803f5524b9e6f7b41c4c66b7 /tools
parentselftests: mlxsw: Fix local variable declarations in DSCP tests (diff)
downloadlinux-dev-d11786bb9664a5bed47e7839265f49bb26d54a1b.tar.xz
linux-dev-d11786bb9664a5bed47e7839265f49bb26d54a1b.zip
selftests: mlxsw: Add a test for leftover DSCP rule
Commit dedfde2fe1c4 ("mlxsw: spectrum_dcb: Configure DSCP map as the last rule is removed") fixed a problem in mlxsw where last DSCP rule to be removed remained in effect when DSCP rewrite was applied. Add a selftest that covers this problem. Signed-off-by: Petr Machata <petrm@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/testing/selftests/drivers/net/mlxsw/qos_dscp_router.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/tools/testing/selftests/drivers/net/mlxsw/qos_dscp_router.sh b/tools/testing/selftests/drivers/net/mlxsw/qos_dscp_router.sh
index f25e3229e1cc..c745ce3befee 100755
--- a/tools/testing/selftests/drivers/net/mlxsw/qos_dscp_router.sh
+++ b/tools/testing/selftests/drivers/net/mlxsw/qos_dscp_router.sh
@@ -31,6 +31,7 @@ ALL_TESTS="
ping_ipv4
test_update
test_no_update
+ test_dscp_leftover
"
lib_dir=$(dirname $0)/../../../net/forwarding
@@ -50,6 +51,11 @@ reprioritize()
echo ${reprio[$in]}
}
+zero()
+{
+ echo 0
+}
+
h1_create()
{
simple_if_init $h1 192.0.2.1/28
@@ -225,6 +231,19 @@ test_no_update()
__test_update 0 echo
}
+# Test that when the last APP rule is removed, the prio->DSCP map is properly
+# set to zeroes, and that the last APP rule does not stay active in the ASIC.
+test_dscp_leftover()
+{
+ lldptool -T -i $swp2 -V APP -d $(dscp_map 0) >/dev/null
+ lldpad_app_wait_del
+
+ __test_update 0 zero
+
+ lldptool -T -i $swp2 -V APP $(dscp_map 0) >/dev/null
+ lldpad_app_wait_set $swp2
+}
+
trap cleanup EXIT
setup_prepare