All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 0/2] mlxsw: Test coverage for DSCP leftover fix
@ 2019-07-31 10:30 Petr Machata
  2019-07-31 10:30 ` [PATCH net-next 1/2] selftests: mlxsw: Fix local variable declarations in DSCP tests Petr Machata
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Petr Machata @ 2019-07-31 10:30 UTC (permalink / raw)
  To: netdev; +Cc: Petr Machata, Ido Schimmel

This patch set fixes some global scope pollution issues in the DSCP tests
(in patch #1), and then proceeds (in patch #2) to add a new test for
checking whether, after DSCP prioritization rules are removed from a port,
DSCP rewrites consistently to zero, instead of the last removed rule still
staying in effect.

Petr Machata (2):
  selftests: mlxsw: Fix local variable declarations in DSCP tests
  selftests: mlxsw: Add a test for leftover DSCP rule

 .../drivers/net/mlxsw/qos_dscp_bridge.sh      |  6 +++--
 .../drivers/net/mlxsw/qos_dscp_router.sh      | 24 +++++++++++++++++--
 2 files changed, 26 insertions(+), 4 deletions(-)

-- 
2.20.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH net-next 1/2] selftests: mlxsw: Fix local variable declarations in DSCP tests
  2019-07-31 10:30 [PATCH net-next 0/2] mlxsw: Test coverage for DSCP leftover fix Petr Machata
@ 2019-07-31 10:30 ` Petr Machata
  2019-07-31 10:30 ` [PATCH net-next 2/2] selftests: mlxsw: Add a test for leftover DSCP rule Petr Machata
  2019-07-31 15:47 ` [PATCH net-next 0/2] mlxsw: Test coverage for DSCP leftover fix David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Petr Machata @ 2019-07-31 10:30 UTC (permalink / raw)
  To: netdev; +Cc: Petr Machata, Ido Schimmel

These two tests have some problems in the global scope pollution and on
contrary, contain unnecessary local declarations. Fix them.

Signed-off-by: Petr Machata <petrm@mellanox.com>
---
 .../testing/selftests/drivers/net/mlxsw/qos_dscp_bridge.sh  | 6 ++++--
 .../testing/selftests/drivers/net/mlxsw/qos_dscp_router.sh  | 5 +++--
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/tools/testing/selftests/drivers/net/mlxsw/qos_dscp_bridge.sh b/tools/testing/selftests/drivers/net/mlxsw/qos_dscp_bridge.sh
index 40f16f2a3afd..5cbff8038f84 100755
--- a/tools/testing/selftests/drivers/net/mlxsw/qos_dscp_bridge.sh
+++ b/tools/testing/selftests/drivers/net/mlxsw/qos_dscp_bridge.sh
@@ -36,8 +36,6 @@ source $lib_dir/lib.sh
 
 h1_create()
 {
-	local dscp;
-
 	simple_if_init $h1 192.0.2.1/28
 	tc qdisc add dev $h1 clsact
 	dscp_capture_install $h1 10
@@ -67,6 +65,7 @@ h2_destroy()
 dscp_map()
 {
 	local base=$1; shift
+	local prio
 
 	for prio in {0..7}; do
 		echo app=$prio,5,$((base + prio))
@@ -138,6 +137,7 @@ dscp_ping_test()
 	local prio=$1; shift
 	local dev_10=$1; shift
 	local dev_20=$1; shift
+	local key
 
 	local dscp_10=$(((prio + 10) << 2))
 	local dscp_20=$(((prio + 20) << 2))
@@ -175,6 +175,8 @@ dscp_ping_test()
 
 test_dscp()
 {
+	local prio
+
 	for prio in {0..7}; do
 		dscp_ping_test v$h1 192.0.2.1 192.0.2.2 $prio $h1 $h2
 	done
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 9faf02e32627..f25e3229e1cc 100755
--- a/tools/testing/selftests/drivers/net/mlxsw/qos_dscp_router.sh
+++ b/tools/testing/selftests/drivers/net/mlxsw/qos_dscp_router.sh
@@ -52,8 +52,6 @@ reprioritize()
 
 h1_create()
 {
-	local dscp;
-
 	simple_if_init $h1 192.0.2.1/28
 	tc qdisc add dev $h1 clsact
 	dscp_capture_install $h1 0
@@ -87,6 +85,7 @@ h2_destroy()
 dscp_map()
 {
 	local base=$1; shift
+	local prio
 
 	for prio in {0..7}; do
 		echo app=$prio,5,$((base + prio))
@@ -156,6 +155,7 @@ dscp_ping_test()
 	local reprio=$1; shift
 	local dev1=$1; shift
 	local dev2=$1; shift
+	local i
 
 	local prio2=$($reprio $prio)   # ICMP Request egress prio
 	local prio3=$($reprio $prio2)  # ICMP Response egress prio
@@ -205,6 +205,7 @@ __test_update()
 {
 	local update=$1; shift
 	local reprio=$1; shift
+	local prio
 
 	sysctl_restore net.ipv4.ip_forward_update_priority
 	sysctl_set net.ipv4.ip_forward_update_priority $update
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH net-next 2/2] selftests: mlxsw: Add a test for leftover DSCP rule
  2019-07-31 10:30 [PATCH net-next 0/2] mlxsw: Test coverage for DSCP leftover fix Petr Machata
  2019-07-31 10:30 ` [PATCH net-next 1/2] selftests: mlxsw: Fix local variable declarations in DSCP tests Petr Machata
@ 2019-07-31 10:30 ` Petr Machata
  2019-07-31 15:47 ` [PATCH net-next 0/2] mlxsw: Test coverage for DSCP leftover fix David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Petr Machata @ 2019-07-31 10:30 UTC (permalink / raw)
  To: netdev; +Cc: Petr Machata, Ido Schimmel

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>
---
 .../drivers/net/mlxsw/qos_dscp_router.sh      | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

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
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next 0/2] mlxsw: Test coverage for DSCP leftover fix
  2019-07-31 10:30 [PATCH net-next 0/2] mlxsw: Test coverage for DSCP leftover fix Petr Machata
  2019-07-31 10:30 ` [PATCH net-next 1/2] selftests: mlxsw: Fix local variable declarations in DSCP tests Petr Machata
  2019-07-31 10:30 ` [PATCH net-next 2/2] selftests: mlxsw: Add a test for leftover DSCP rule Petr Machata
@ 2019-07-31 15:47 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2019-07-31 15:47 UTC (permalink / raw)
  To: petrm; +Cc: netdev, idosch

From: Petr Machata <petrm@mellanox.com>
Date: Wed, 31 Jul 2019 10:30:25 +0000

> This patch set fixes some global scope pollution issues in the DSCP tests
> (in patch #1), and then proceeds (in patch #2) to add a new test for
> checking whether, after DSCP prioritization rules are removed from a port,
> DSCP rewrites consistently to zero, instead of the last removed rule still
> staying in effect.

Series applied.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-07-31 15:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-31 10:30 [PATCH net-next 0/2] mlxsw: Test coverage for DSCP leftover fix Petr Machata
2019-07-31 10:30 ` [PATCH net-next 1/2] selftests: mlxsw: Fix local variable declarations in DSCP tests Petr Machata
2019-07-31 10:30 ` [PATCH net-next 2/2] selftests: mlxsw: Add a test for leftover DSCP rule Petr Machata
2019-07-31 15:47 ` [PATCH net-next 0/2] mlxsw: Test coverage for DSCP leftover fix David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.