All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ido Schimmel <idosch@idosch.org>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, jiri@mellanox.com, danieller@mellanox.com,
	mlxsw@mellanox.com, Ido Schimmel <idosch@mellanox.com>
Subject: [PATCH net-next 5/5] selftests: mlxsw: Add Spectrum-2 target scale for tc flower scale test
Date: Thu, 17 Oct 2019 09:55:18 +0300	[thread overview]
Message-ID: <20191017065518.27008-6-idosch@idosch.org> (raw)
In-Reply-To: <20191017065518.27008-1-idosch@idosch.org>

From: Danielle Ratson <danieller@mellanox.com>

Return the maximum number of tc flower filters that can be offloaded.
Currently, this value corresponds to the number of counters supported by
the driver.

Signed-off-by: Danielle Ratson <danieller@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
---
 .../net/mlxsw/spectrum-2/resource_scale.sh    |  2 +-
 .../net/mlxsw/spectrum-2/tc_flower_scale.sh   | 20 +++++++++++++++++++
 2 files changed, 21 insertions(+), 1 deletion(-)
 create mode 100644 tools/testing/selftests/drivers/net/mlxsw/spectrum-2/tc_flower_scale.sh

diff --git a/tools/testing/selftests/drivers/net/mlxsw/spectrum-2/resource_scale.sh b/tools/testing/selftests/drivers/net/mlxsw/spectrum-2/resource_scale.sh
index 3bb9147890fa..2b5f4f7cc905 100755
--- a/tools/testing/selftests/drivers/net/mlxsw/spectrum-2/resource_scale.sh
+++ b/tools/testing/selftests/drivers/net/mlxsw/spectrum-2/resource_scale.sh
@@ -20,7 +20,7 @@ cleanup()
 
 trap cleanup EXIT
 
-ALL_TESTS="mirror_gre"
+ALL_TESTS="tc_flower mirror_gre"
 for current_test in ${TESTS:-$ALL_TESTS}; do
 	source ${current_test}_scale.sh
 
diff --git a/tools/testing/selftests/drivers/net/mlxsw/spectrum-2/tc_flower_scale.sh b/tools/testing/selftests/drivers/net/mlxsw/spectrum-2/tc_flower_scale.sh
new file mode 100644
index 000000000000..a0795227216e
--- /dev/null
+++ b/tools/testing/selftests/drivers/net/mlxsw/spectrum-2/tc_flower_scale.sh
@@ -0,0 +1,20 @@
+# SPDX-License-Identifier: GPL-2.0
+source ../tc_flower_scale.sh
+
+tc_flower_get_target()
+{
+	local should_fail=$1; shift
+
+	# The driver associates a counter with each tc filter, which means the
+	# number of supported filters is bounded by the number of available
+	# counters.
+	# Currently, the driver supports 12K (12,288) flow counters and six of
+	# these are used for multicast routing.
+	local target=12282
+
+	if ((! should_fail)); then
+		echo $target
+	else
+		echo $((target + 1))
+	fi
+}
-- 
2.21.0


  parent reply	other threads:[~2019-10-17  6:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-17  6:55 [PATCH net-next 0/5] selftests: mlxsw: Add scale tests for Spectrum-2 Ido Schimmel
2019-10-17  6:55 ` [PATCH net-next 1/5] mlxsw: spectrum: Register switched port analyzers (SPAN) as resource Ido Schimmel
2019-10-17  6:55 ` [PATCH net-next 2/5] selftests: mlxsw: Generalize the parameters of mirror_gre test Ido Schimmel
2019-10-17  6:55 ` [PATCH net-next 3/5] selftests: mlxsw: Add Spectrum-2 mirror-to-gretap target scale test Ido Schimmel
2019-10-17  6:55 ` [PATCH net-next 4/5] selftests: mlxsw: Add a resource scale test for Spectrum-2 Ido Schimmel
2019-10-17  6:55 ` Ido Schimmel [this message]
2019-10-18 17:13 ` [PATCH net-next 0/5] selftests: mlxsw: Add scale tests " David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191017065518.27008-6-idosch@idosch.org \
    --to=idosch@idosch.org \
    --cc=danieller@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=idosch@mellanox.com \
    --cc=jiri@mellanox.com \
    --cc=mlxsw@mellanox.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.