aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/drivers/net/mlxsw
diff options
context:
space:
mode:
authorPetr Machata <petrm@nvidia.com>2022-03-14 15:01:17 +0100
committerPaolo Abeni <pabeni@redhat.com>2022-03-15 14:00:51 +0100
commited2ae69c40537ac3250a318f344722fef0c4f67c (patch)
treec6ee543419c3d25c0c107c32c6d2c59b96c3cc88 /tools/testing/selftests/drivers/net/mlxsw
parentselftests: netdevsim: hw_stats_l3: Add a new test (diff)
downloadlinux-dev-ed2ae69c40537ac3250a318f344722fef0c4f67c.tar.xz
linux-dev-ed2ae69c40537ac3250a318f344722fef0c4f67c.zip
selftests: mlxsw: hw_stats_l3: Add a new test
Add a test that verifies that UAPI notifications are emitted, as mlxsw installs and deinstalls HW counters for the L3 offload xstats. Signed-off-by: Petr Machata <petrm@nvidia.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'tools/testing/selftests/drivers/net/mlxsw')
-rwxr-xr-xtools/testing/selftests/drivers/net/mlxsw/hw_stats_l3.sh31
1 files changed, 31 insertions, 0 deletions
diff --git a/tools/testing/selftests/drivers/net/mlxsw/hw_stats_l3.sh b/tools/testing/selftests/drivers/net/mlxsw/hw_stats_l3.sh
new file mode 100755
index 000000000000..941ba4c485c9
--- /dev/null
+++ b/tools/testing/selftests/drivers/net/mlxsw/hw_stats_l3.sh
@@ -0,0 +1,31 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0
+
+lib_dir=$(dirname $0)/../../../net/forwarding
+
+ALL_TESTS="
+ l3_monitor_test
+"
+NUM_NETIFS=0
+source $lib_dir/lib.sh
+
+swp=$NETIF_NO_CABLE
+
+cleanup()
+{
+ pre_cleanup
+}
+
+l3_monitor_test()
+{
+ hw_stats_monitor_test $swp l3 \
+ "ip addr add dev $swp 192.0.2.1/28" \
+ "ip addr del dev $swp 192.0.2.1/28"
+}
+
+trap cleanup EXIT
+
+setup_wait
+tests_run
+
+exit $EXIT_STATUS