* [PATCH] selftests: netdevsim: skip the rate tc-bw check without tool support
@ 2026-09-25 13:55 Eva Kurchatova
2026-09-26 0:11 ` Jakub Kicinski
0 siblings, 1 reply; 2+ messages in thread
From: Eva Kurchatova @ 2026-09-25 13:55 UTC (permalink / raw)
To: Jakub Kicinski, Andrew Lunn, David S. Miller, Eric Dumazet,
Paolo Abeni, Shuah Khan
Cc: linux-kernel, Eva Kurchatova, netdev, linux-kselftest
The tc-bw attribute was added to devlink in iproute2 6.17, together
with the kernel side in v6.17. An older devlink has no such option and
the rate test fails on "Unknown option" instead of skipping.
Probe once in rate_test() and skip the tc-bw checks as a whole, so that
a missing option costs a single skip line rather than one per rate
object.
Signed-off-by: Eva Kurchatova <eva.kurchatova@virtuozzo.com>
---
.../drivers/net/netdevsim/devlink.sh | 29 +++++++++++++------
1 file changed, 20 insertions(+), 9 deletions(-)
diff --git a/tools/testing/selftests/drivers/net/netdevsim/devlink.sh b/tools/testing/selftests/drivers/net/netdevsim/devlink.sh
index 22a626c6cde3..1ba925459aff 100755
--- a/tools/testing/selftests/drivers/net/netdevsim/devlink.sh
+++ b/tools/testing/selftests/drivers/net/netdevsim/devlink.sh
@@ -849,6 +849,13 @@ rate_test()
{
RET=0
+ local tc_bw_supported=false
+ if devlink port function rate help 2>&1 | grep -q tc-bw; then
+ tc_bw_supported=true
+ else
+ log_test_skip "rate tc-bw" "Current iproute doesn't support rate option 'tc-bw'."
+ fi
+
echo $VF_COUNT > /sys/bus/netdevsim/devices/$DEV_NAME/sriov_numvfs
devlink dev eswitch set $DL_HANDLE mode switchdev
local leafs=`rate_leafs_get $DL_HANDLE`
@@ -872,12 +879,14 @@ rate_test()
rate=$(($rate+100))
done
- local tc_bw="0:0 1:40 2:0 3:0 4:0 5:0 6:60 7:0"
- for r_obj in $leafs
- do
- rate_attr_tc_bw_check "$r_obj" "$tc_bw" \
- "$DEBUGFS_DIR"/ports/"${r_obj##*/}"
- done
+ if $tc_bw_supported; then
+ local tc_bw="0:0 1:40 2:0 3:0 4:0 5:0 6:60 7:0"
+ for r_obj in $leafs
+ do
+ rate_attr_tc_bw_check "$r_obj" "$tc_bw" \
+ "$DEBUGFS_DIR"/ports/"${r_obj##*/}"
+ done
+ fi
local node1_name='group1'
local node1="$DL_HANDLE/$node1_name"
@@ -897,9 +906,11 @@ rate_test()
$DEBUGFS_DIR/rate_nodes/${node1##*/}/tx_max
- local tc_bw="0:20 1:0 2:0 3:0 4:0 5:20 6:60 7:0"
- rate_attr_tc_bw_check $node1 "$tc_bw" \
- "$DEBUGFS_DIR"/rate_nodes/"${node1##*/}"
+ if $tc_bw_supported; then
+ local tc_bw="0:20 1:0 2:0 3:0 4:0 5:20 6:60 7:0"
+ rate_attr_tc_bw_check $node1 "$tc_bw" \
+ "$DEBUGFS_DIR"/rate_nodes/"${node1##*/}"
+ fi
rate_node_del "$node1"
--
2.55.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] selftests: netdevsim: skip the rate tc-bw check without tool support
2026-09-25 13:55 [PATCH] selftests: netdevsim: skip the rate tc-bw check without tool support Eva Kurchatova
@ 2026-09-26 0:11 ` Jakub Kicinski
0 siblings, 0 replies; 2+ messages in thread
From: Jakub Kicinski @ 2026-09-26 0:11 UTC (permalink / raw)
To: Eva Kurchatova
Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Paolo Abeni,
Shuah Khan, linux-kernel, netdev, linux-kselftest
On Fri, 25 Sep 2026 16:55:01 +0300 Eva Kurchatova wrote:
> The tc-bw attribute was added to devlink in iproute2 6.17, together
> with the kernel side in v6.17. An older devlink has no such option and
> the rate test fails on "Unknown option" instead of skipping.
>
> Probe once in rate_test() and skip the tc-bw checks as a whole, so that
> a missing option costs a single skip line rather than one per rate
> object.
Maintaining backward compat for tests is not a goal for us.
Teach your testing hardness to do this automatically, or carry your own
fixes.
--
pw-bot: reject
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-09-26 0:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-25 13:55 [PATCH] selftests: netdevsim: skip the rate tc-bw check without tool support Eva Kurchatova
2026-09-26 0:11 ` Jakub Kicinski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®