]> git.baikalelectronics.ru Git - kernel.git/commitdiff
selftests: mlxsw: Add Spectrum-2 mirror-to-gretap target scale test
authorDanielle Ratson <danieller@mellanox.com>
Thu, 17 Oct 2019 06:55:16 +0000 (09:55 +0300)
committerDavid S. Miller <davem@davemloft.net>
Fri, 18 Oct 2019 17:05:37 +0000 (10:05 -0700)
Like in Spectrum, use the number of analyzers taken from the devlink
command.

Signed-off-by: Danielle Ratson <danieller@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
tools/testing/selftests/drivers/net/mlxsw/spectrum-2/mirror_gre_scale.sh [new file with mode: 0644]

diff --git a/tools/testing/selftests/drivers/net/mlxsw/spectrum-2/mirror_gre_scale.sh b/tools/testing/selftests/drivers/net/mlxsw/spectrum-2/mirror_gre_scale.sh
new file mode 100644 (file)
index 0000000..f7c168d
--- /dev/null
@@ -0,0 +1,16 @@
+# SPDX-License-Identifier: GPL-2.0
+source ../mirror_gre_scale.sh
+
+mirror_gre_get_target()
+{
+       local should_fail=$1; shift
+       local target
+
+       target=$(devlink_resource_size_get span_agents)
+
+       if ((! should_fail)); then
+               echo $target
+       else
+               echo $((target + 1))
+       fi
+}