Commit d11786bb authored by Petr Machata's avatar Petr Machata Committed by David S. Miller

selftests: mlxsw: Add a test for leftover DSCP rule

Commit dedfde2f ("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: default avatarPetr Machata <petrm@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7700476f
...@@ -31,6 +31,7 @@ ALL_TESTS=" ...@@ -31,6 +31,7 @@ ALL_TESTS="
ping_ipv4 ping_ipv4
test_update test_update
test_no_update test_no_update
test_dscp_leftover
" "
lib_dir=$(dirname $0)/../../../net/forwarding lib_dir=$(dirname $0)/../../../net/forwarding
...@@ -50,6 +51,11 @@ reprioritize() ...@@ -50,6 +51,11 @@ reprioritize()
echo ${reprio[$in]} echo ${reprio[$in]}
} }
zero()
{
echo 0
}
h1_create() h1_create()
{ {
simple_if_init $h1 192.0.2.1/28 simple_if_init $h1 192.0.2.1/28
...@@ -225,6 +231,19 @@ test_no_update() ...@@ -225,6 +231,19 @@ test_no_update()
__test_update 0 echo __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 trap cleanup EXIT
setup_prepare setup_prepare
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment