netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/4] selftests: mlxsw: Convert to iproute2 dcb
@ 2023-01-30 16:40 Petr Machata
  2023-01-30 16:40 ` [PATCH net-next 1/4] selftests: mlxsw: qos_dscp_bridge: Convert from lldptool to dcb Petr Machata
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Petr Machata @ 2023-01-30 16:40 UTC (permalink / raw)
  To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	netdev
  Cc: Petr Machata, Danielle Ratson, mlxsw

There is a dedicated tool for configuration of DCB in iproute2. Use it
in the selftests instead of lldpad.

Patches #1-#3 convert three tests. Patch #4 drops the now-unnecessary
lldpad helpers.

Petr Machata (4):
  selftests: mlxsw: qos_dscp_bridge: Convert from lldptool to dcb
  selftests: mlxsw: qos_dscp_router: Convert from lldptool to dcb
  selftests: mlxsw: qos_defprio: Convert from lldptool to dcb
  selftests: net: forwarding: lib: Drop lldpad_app_wait_set(), _del()

 .../drivers/net/mlxsw/qos_defprio.sh          | 68 +++++--------------
 .../drivers/net/mlxsw/qos_dscp_bridge.sh      | 23 ++-----
 .../drivers/net/mlxsw/qos_dscp_router.sh      | 27 ++------
 tools/testing/selftests/net/forwarding/lib.sh | 21 ------
 4 files changed, 27 insertions(+), 112 deletions(-)

-- 
2.39.0


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

* [PATCH net-next 1/4] selftests: mlxsw: qos_dscp_bridge: Convert from lldptool to dcb
  2023-01-30 16:40 [PATCH net-next 0/4] selftests: mlxsw: Convert to iproute2 dcb Petr Machata
@ 2023-01-30 16:40 ` Petr Machata
  2023-01-30 16:40 ` [PATCH net-next 2/4] selftests: mlxsw: qos_dscp_router: " Petr Machata
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Petr Machata @ 2023-01-30 16:40 UTC (permalink / raw)
  To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	netdev
  Cc: Petr Machata, Danielle Ratson, mlxsw

Set up DSCP prioritization through the iproute2 dcb tool, which is easier
to understand and manage.

Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Danielle Ratson <danieller@nvidia.com>
---
 .../drivers/net/mlxsw/qos_dscp_bridge.sh      | 23 ++++---------------
 1 file changed, 5 insertions(+), 18 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 28a570006d4d..87c41f5727c9 100755
--- a/tools/testing/selftests/drivers/net/mlxsw/qos_dscp_bridge.sh
+++ b/tools/testing/selftests/drivers/net/mlxsw/qos_dscp_bridge.sh
@@ -20,7 +20,7 @@
 # | SW |                                                                |     |
 # |  +-|----------------------------------------------------------------|-+   |
 # |  | + $swp1                       BR                           $swp2 + |   |
-# |  |   APP=0,5,10 .. 7,5,17                      APP=0,5,20 .. 7,5,27   |   |
+# |  |   dcb dscp-prio 10:0...17:7            dcb dscp-prio 20:0...27:7   |   |
 # |  +--------------------------------------------------------------------+   |
 # +---------------------------------------------------------------------------+
 
@@ -62,16 +62,6 @@ h2_destroy()
 	simple_if_fini $h2 192.0.2.2/28
 }
 
-dscp_map()
-{
-	local base=$1; shift
-	local prio
-
-	for prio in {0..7}; do
-		echo app=$prio,5,$((base + prio))
-	done
-}
-
 switch_create()
 {
 	ip link add name br1 type bridge vlan_filtering 1
@@ -81,17 +71,14 @@ switch_create()
 	ip link set dev $swp2 master br1
 	ip link set dev $swp2 up
 
-	lldptool -T -i $swp1 -V APP $(dscp_map 10) >/dev/null
-	lldptool -T -i $swp2 -V APP $(dscp_map 20) >/dev/null
-	lldpad_app_wait_set $swp1
-	lldpad_app_wait_set $swp2
+	dcb app add dev $swp1 dscp-prio 10:0 11:1 12:2 13:3 14:4 15:5 16:6 17:7
+	dcb app add dev $swp2 dscp-prio 20:0 21:1 22:2 23:3 24:4 25:5 26:6 27:7
 }
 
 switch_destroy()
 {
-	lldptool -T -i $swp2 -V APP -d $(dscp_map 20) >/dev/null
-	lldptool -T -i $swp1 -V APP -d $(dscp_map 10) >/dev/null
-	lldpad_app_wait_del
+	dcb app del dev $swp2 dscp-prio 20:0 21:1 22:2 23:3 24:4 25:5 26:6 27:7
+	dcb app del dev $swp1 dscp-prio 10:0 11:1 12:2 13:3 14:4 15:5 16:6 17:7
 
 	ip link set dev $swp2 down
 	ip link set dev $swp2 nomaster
-- 
2.39.0


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

* [PATCH net-next 2/4] selftests: mlxsw: qos_dscp_router: Convert from lldptool to dcb
  2023-01-30 16:40 [PATCH net-next 0/4] selftests: mlxsw: Convert to iproute2 dcb Petr Machata
  2023-01-30 16:40 ` [PATCH net-next 1/4] selftests: mlxsw: qos_dscp_bridge: Convert from lldptool to dcb Petr Machata
@ 2023-01-30 16:40 ` Petr Machata
  2023-01-30 16:40 ` [PATCH net-next 3/4] selftests: mlxsw: qos_defprio: " Petr Machata
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Petr Machata @ 2023-01-30 16:40 UTC (permalink / raw)
  To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	netdev
  Cc: Petr Machata, Danielle Ratson, mlxsw

Set up DSCP prioritization through the iproute2 dcb tool, which is easier
to understand and manage.

Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Danielle Ratson <danieller@nvidia.com>
---
 .../drivers/net/mlxsw/qos_dscp_router.sh      | 27 +++++--------------
 1 file changed, 6 insertions(+), 21 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 4cb2aa65278a..f6c23f84423e 100755
--- a/tools/testing/selftests/drivers/net/mlxsw/qos_dscp_router.sh
+++ b/tools/testing/selftests/drivers/net/mlxsw/qos_dscp_router.sh
@@ -94,16 +94,6 @@ h2_destroy()
 	simple_if_fini $h2 192.0.2.18/28
 }
 
-dscp_map()
-{
-	local base=$1; shift
-	local prio
-
-	for prio in {0..7}; do
-		echo app=$prio,5,$((base + prio))
-	done
-}
-
 switch_create()
 {
 	simple_if_init $swp1 192.0.2.2/28
@@ -112,17 +102,14 @@ switch_create()
 	tc qdisc add dev $swp1 clsact
 	tc qdisc add dev $swp2 clsact
 
-	lldptool -T -i $swp1 -V APP $(dscp_map 0) >/dev/null
-	lldptool -T -i $swp2 -V APP $(dscp_map 0) >/dev/null
-	lldpad_app_wait_set $swp1
-	lldpad_app_wait_set $swp2
+	dcb app add dev $swp1 dscp-prio 0:0 1:1 2:2 3:3 4:4 5:5 6:6 7:7
+	dcb app add dev $swp2 dscp-prio 0:0 1:1 2:2 3:3 4:4 5:5 6:6 7:7
 }
 
 switch_destroy()
 {
-	lldptool -T -i $swp2 -V APP -d $(dscp_map 0) >/dev/null
-	lldptool -T -i $swp1 -V APP -d $(dscp_map 0) >/dev/null
-	lldpad_app_wait_del
+	dcb app del dev $swp2 dscp-prio 0:0 1:1 2:2 3:3 4:4 5:5 6:6 7:7
+	dcb app del dev $swp1 dscp-prio 0:0 1:1 2:2 3:3 4:4 5:5 6:6 7:7
 
 	tc qdisc del dev $swp2 clsact
 	tc qdisc del dev $swp1 clsact
@@ -265,13 +252,11 @@ test_dscp_leftover()
 {
 	echo "Test that last removed DSCP rule is deconfigured correctly"
 
-	lldptool -T -i $swp2 -V APP -d $(dscp_map 0) >/dev/null
-	lldpad_app_wait_del
+	dcb app del dev $swp2 dscp-prio 0:0 1:1 2:2 3:3 4:4 5:5 6:6 7:7
 
 	__test_update 0 zero
 
-	lldptool -T -i $swp2 -V APP $(dscp_map 0) >/dev/null
-	lldpad_app_wait_set $swp2
+	dcb app add dev $swp2 dscp-prio 0:0 1:1 2:2 3:3 4:4 5:5 6:6 7:7
 }
 
 trap cleanup EXIT
-- 
2.39.0


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

* [PATCH net-next 3/4] selftests: mlxsw: qos_defprio: Convert from lldptool to dcb
  2023-01-30 16:40 [PATCH net-next 0/4] selftests: mlxsw: Convert to iproute2 dcb Petr Machata
  2023-01-30 16:40 ` [PATCH net-next 1/4] selftests: mlxsw: qos_dscp_bridge: Convert from lldptool to dcb Petr Machata
  2023-01-30 16:40 ` [PATCH net-next 2/4] selftests: mlxsw: qos_dscp_router: " Petr Machata
@ 2023-01-30 16:40 ` Petr Machata
  2023-01-30 16:40 ` [PATCH net-next 4/4] selftests: net: forwarding: lib: Drop lldpad_app_wait_set(), _del() Petr Machata
  2023-02-01  5:10 ` [PATCH net-next 0/4] selftests: mlxsw: Convert to iproute2 dcb patchwork-bot+netdevbpf
  4 siblings, 0 replies; 6+ messages in thread
From: Petr Machata @ 2023-01-30 16:40 UTC (permalink / raw)
  To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	netdev
  Cc: Petr Machata, Danielle Ratson, mlxsw

Set up default port priority through the iproute2 dcb tool, which is easier
to understand and manage.

Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Danielle Ratson <danieller@nvidia.com>
---
 .../drivers/net/mlxsw/qos_defprio.sh          | 68 +++++--------------
 1 file changed, 16 insertions(+), 52 deletions(-)

diff --git a/tools/testing/selftests/drivers/net/mlxsw/qos_defprio.sh b/tools/testing/selftests/drivers/net/mlxsw/qos_defprio.sh
index 71066bc4b886..5492fa5550d7 100755
--- a/tools/testing/selftests/drivers/net/mlxsw/qos_defprio.sh
+++ b/tools/testing/selftests/drivers/net/mlxsw/qos_defprio.sh
@@ -5,18 +5,18 @@
 # prioritized according to the default priority specified at the port.
 # rx_octets_prio_* counters are used to verify the prioritization.
 #
-# +-----------------------+
-# | H1                    |
-# |    + $h1              |
-# |    | 192.0.2.1/28     |
-# +----|------------------+
+# +----------------------------------+
+# | H1                               |
+# |    + $h1                         |
+# |    | 192.0.2.1/28                |
+# +----|-----------------------------+
 #      |
-# +----|------------------+
-# | SW |                  |
-# |    + $swp1            |
-# |      192.0.2.2/28     |
-# |      APP=<prio>,1,0   |
-# +-----------------------+
+# +----|-----------------------------+
+# | SW |                             |
+# |    + $swp1                       |
+# |      192.0.2.2/28                |
+# |      dcb app default-prio <prio> |
+# +----------------------------------+
 
 ALL_TESTS="
 	ping_ipv4
@@ -29,42 +29,6 @@ NUM_NETIFS=2
 : ${HIT_TIMEOUT:=1000} # ms
 source $lib_dir/lib.sh
 
-declare -a APP
-
-defprio_install()
-{
-	local dev=$1; shift
-	local prio=$1; shift
-	local app="app=$prio,1,0"
-
-	lldptool -T -i $dev -V APP $app >/dev/null
-	lldpad_app_wait_set $dev
-	APP[$prio]=$app
-}
-
-defprio_uninstall()
-{
-	local dev=$1; shift
-	local prio=$1; shift
-	local app=${APP[$prio]}
-
-	lldptool -T -i $dev -V APP -d $app >/dev/null
-	lldpad_app_wait_del
-	unset APP[$prio]
-}
-
-defprio_flush()
-{
-	local dev=$1; shift
-	local prio
-
-	if ((${#APP[@]})); then
-		lldptool -T -i $dev -V APP -d ${APP[@]} >/dev/null
-	fi
-	lldpad_app_wait_del
-	APP=()
-}
-
 h1_create()
 {
 	simple_if_init $h1 192.0.2.1/28
@@ -83,7 +47,7 @@ switch_create()
 
 switch_destroy()
 {
-	defprio_flush $swp1
+	dcb app flush dev $swp1 default-prio
 	ip addr del dev $swp1 192.0.2.2/28
 	ip link set dev $swp1 down
 }
@@ -124,7 +88,7 @@ __test_defprio()
 
 	RET=0
 
-	defprio_install $swp1 $prio_install
+	dcb app add dev $swp1 default-prio $prio_install
 
 	local t0=$(ethtool_stats_get $swp1 rx_frames_prio_$prio_observe)
 	mausezahn -q $h1 -d 100m -c 10 -t arp reply
@@ -134,7 +98,7 @@ __test_defprio()
 	check_err $? "Default priority $prio_install/$prio_observe: Expected to capture 10 packets, got $((t1 - t0))."
 	log_test "Default priority $prio_install/$prio_observe"
 
-	defprio_uninstall $swp1 $prio_install
+	dcb app del dev $swp1 default-prio $prio_install
 }
 
 test_defprio()
@@ -145,7 +109,7 @@ test_defprio()
 		__test_defprio $prio $prio
 	done
 
-	defprio_install $swp1 3
+	dcb app add dev $swp1 default-prio 3
 	__test_defprio 0 3
 	__test_defprio 1 3
 	__test_defprio 2 3
@@ -153,7 +117,7 @@ test_defprio()
 	__test_defprio 5 5
 	__test_defprio 6 6
 	__test_defprio 7 7
-	defprio_uninstall $swp1 3
+	dcb app del dev $swp1 default-prio 3
 }
 
 trap cleanup EXIT
-- 
2.39.0


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

* [PATCH net-next 4/4] selftests: net: forwarding: lib: Drop lldpad_app_wait_set(), _del()
  2023-01-30 16:40 [PATCH net-next 0/4] selftests: mlxsw: Convert to iproute2 dcb Petr Machata
                   ` (2 preceding siblings ...)
  2023-01-30 16:40 ` [PATCH net-next 3/4] selftests: mlxsw: qos_defprio: " Petr Machata
@ 2023-01-30 16:40 ` Petr Machata
  2023-02-01  5:10 ` [PATCH net-next 0/4] selftests: mlxsw: Convert to iproute2 dcb patchwork-bot+netdevbpf
  4 siblings, 0 replies; 6+ messages in thread
From: Petr Machata @ 2023-01-30 16:40 UTC (permalink / raw)
  To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	netdev
  Cc: Petr Machata, Danielle Ratson, mlxsw

The existing users of these helpers have been converted to iproute2 dcb.
Drop the helpers.

Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Danielle Ratson <danieller@nvidia.com>
---
 tools/testing/selftests/net/forwarding/lib.sh | 21 -------------------
 1 file changed, 21 deletions(-)

diff --git a/tools/testing/selftests/net/forwarding/lib.sh b/tools/testing/selftests/net/forwarding/lib.sh
index 7b3e89a15ccb..3693fd90c23c 100755
--- a/tools/testing/selftests/net/forwarding/lib.sh
+++ b/tools/testing/selftests/net/forwarding/lib.sh
@@ -524,27 +524,6 @@ cmd_jq()
 	[ ! -z "$output" ]
 }
 
-lldpad_app_wait_set()
-{
-	local dev=$1; shift
-
-	while lldptool -t -i $dev -V APP -c app | grep -Eq "pending|unknown"; do
-		echo "$dev: waiting for lldpad to push pending APP updates"
-		sleep 5
-	done
-}
-
-lldpad_app_wait_del()
-{
-	# Give lldpad a chance to push down the changes. If the device is downed
-	# too soon, the updates will be left pending. However, they will have
-	# been struck off the lldpad's DB already, so we won't be able to tell
-	# they are pending. Then on next test iteration this would cause
-	# weirdness as newly-added APP rules conflict with the old ones,
-	# sometimes getting stuck in an "unknown" state.
-	sleep 5
-}
-
 pre_cleanup()
 {
 	if [ "${PAUSE_ON_CLEANUP}" = "yes" ]; then
-- 
2.39.0


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

* Re: [PATCH net-next 0/4] selftests: mlxsw: Convert to iproute2 dcb
  2023-01-30 16:40 [PATCH net-next 0/4] selftests: mlxsw: Convert to iproute2 dcb Petr Machata
                   ` (3 preceding siblings ...)
  2023-01-30 16:40 ` [PATCH net-next 4/4] selftests: net: forwarding: lib: Drop lldpad_app_wait_set(), _del() Petr Machata
@ 2023-02-01  5:10 ` patchwork-bot+netdevbpf
  4 siblings, 0 replies; 6+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-02-01  5:10 UTC (permalink / raw)
  To: Petr Machata; +Cc: davem, edumazet, kuba, pabeni, netdev, danieller, mlxsw

Hello:

This series was applied to netdev/net-next.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Mon, 30 Jan 2023 17:40:00 +0100 you wrote:
> There is a dedicated tool for configuration of DCB in iproute2. Use it
> in the selftests instead of lldpad.
> 
> Patches #1-#3 convert three tests. Patch #4 drops the now-unnecessary
> lldpad helpers.
> 
> Petr Machata (4):
>   selftests: mlxsw: qos_dscp_bridge: Convert from lldptool to dcb
>   selftests: mlxsw: qos_dscp_router: Convert from lldptool to dcb
>   selftests: mlxsw: qos_defprio: Convert from lldptool to dcb
>   selftests: net: forwarding: lib: Drop lldpad_app_wait_set(), _del()
> 
> [...]

Here is the summary with links:
  - [net-next,1/4] selftests: mlxsw: qos_dscp_bridge: Convert from lldptool to dcb
    https://git.kernel.org/netdev/net-next/c/1680801ef64d
  - [net-next,2/4] selftests: mlxsw: qos_dscp_router: Convert from lldptool to dcb
    https://git.kernel.org/netdev/net-next/c/10d5bd0b69ed
  - [net-next,3/4] selftests: mlxsw: qos_defprio: Convert from lldptool to dcb
    https://git.kernel.org/netdev/net-next/c/5b3ef0452c59
  - [net-next,4/4] selftests: net: forwarding: lib: Drop lldpad_app_wait_set(), _del()
    https://git.kernel.org/netdev/net-next/c/bd32ff68721c

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2023-02-01  5:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-30 16:40 [PATCH net-next 0/4] selftests: mlxsw: Convert to iproute2 dcb Petr Machata
2023-01-30 16:40 ` [PATCH net-next 1/4] selftests: mlxsw: qos_dscp_bridge: Convert from lldptool to dcb Petr Machata
2023-01-30 16:40 ` [PATCH net-next 2/4] selftests: mlxsw: qos_dscp_router: " Petr Machata
2023-01-30 16:40 ` [PATCH net-next 3/4] selftests: mlxsw: qos_defprio: " Petr Machata
2023-01-30 16:40 ` [PATCH net-next 4/4] selftests: net: forwarding: lib: Drop lldpad_app_wait_set(), _del() Petr Machata
2023-02-01  5:10 ` [PATCH net-next 0/4] selftests: mlxsw: Convert to iproute2 dcb patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).