All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ido Schimmel <idosch@mellanox.com>
To: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kselftest@vger.kernel.org"
	<linux-kselftest@vger.kernel.org>
Cc: "davem@davemloft.net" <davem@davemloft.net>,
	"shuah@kernel.org" <shuah@kernel.org>,
	Jiri Pirko <jiri@mellanox.com>, Petr Machata <petrm@mellanox.com>,
	"roopa@cumulusnetworks.com" <roopa@cumulusnetworks.com>,
	mlxsw <mlxsw@mellanox.com>, Ido Schimmel <idosch@mellanox.com>
Subject: [PATCH net-next 06/18] selftests: forwarding: lib: Add link_stats_rx_errors_get()
Date: Mon, 19 Nov 2018 16:11:13 +0000	[thread overview]
Message-ID: <20181119161006.5405-7-idosch@mellanox.com> (raw)
In-Reply-To: <20181119161006.5405-1-idosch@mellanox.com>

From: Petr Machata <petrm@mellanox.com>

Such a function will be useful for counting malformed packets in the ECN
decap test.

To that end, introduce a common handler for handling stat-fetching, and
reuse it in link_stats_tx_packets_get() and link_stats_rx_errors_get().

Signed-off-by: Petr Machata <petrm@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
---
 tools/testing/selftests/net/forwarding/lib.sh | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/net/forwarding/lib.sh b/tools/testing/selftests/net/forwarding/lib.sh
index e916663a1019..7af5a03bcb32 100644
--- a/tools/testing/selftests/net/forwarding/lib.sh
+++ b/tools/testing/selftests/net/forwarding/lib.sh
@@ -477,11 +477,24 @@ master_name_get()
 	ip -j link show dev $if_name | jq -r '.[]["master"]'
 }
 
+link_stats_get()
+{
+	local if_name=$1; shift
+	local dir=$1; shift
+	local stat=$1; shift
+
+	ip -j -s link show dev $if_name \
+		| jq '.[]["stats64"]["'$dir'"]["'$stat'"]'
+}
+
 link_stats_tx_packets_get()
 {
-       local if_name=$1
+	link_stats_get $1 tx packets
+}
 
-       ip -j -s link show dev $if_name | jq '.[]["stats64"]["tx"]["packets"]'
+link_stats_rx_errors_get()
+{
+	link_stats_get $1 rx errors
 }
 
 tc_rule_stats_get()
-- 
2.19.1

WARNING: multiple messages have this Message-ID (diff)
From: idosch at mellanox.com (Ido Schimmel)
Subject: [PATCH net-next 06/18] selftests: forwarding: lib: Add link_stats_rx_errors_get()
Date: Mon, 19 Nov 2018 16:11:13 +0000	[thread overview]
Message-ID: <20181119161006.5405-7-idosch@mellanox.com> (raw)
In-Reply-To: <20181119161006.5405-1-idosch@mellanox.com>

From: Petr Machata <petrm at mellanox.com>

Such a function will be useful for counting malformed packets in the ECN
decap test.

To that end, introduce a common handler for handling stat-fetching, and
reuse it in link_stats_tx_packets_get() and link_stats_rx_errors_get().

Signed-off-by: Petr Machata <petrm at mellanox.com>
Signed-off-by: Ido Schimmel <idosch at mellanox.com>
---
 tools/testing/selftests/net/forwarding/lib.sh | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/net/forwarding/lib.sh b/tools/testing/selftests/net/forwarding/lib.sh
index e916663a1019..7af5a03bcb32 100644
--- a/tools/testing/selftests/net/forwarding/lib.sh
+++ b/tools/testing/selftests/net/forwarding/lib.sh
@@ -477,11 +477,24 @@ master_name_get()
 	ip -j link show dev $if_name | jq -r '.[]["master"]'
 }
 
+link_stats_get()
+{
+	local if_name=$1; shift
+	local dir=$1; shift
+	local stat=$1; shift
+
+	ip -j -s link show dev $if_name \
+		| jq '.[]["stats64"]["'$dir'"]["'$stat'"]'
+}
+
 link_stats_tx_packets_get()
 {
-       local if_name=$1
+	link_stats_get $1 tx packets
+}
 
-       ip -j -s link show dev $if_name | jq '.[]["stats64"]["tx"]["packets"]'
+link_stats_rx_errors_get()
+{
+	link_stats_get $1 rx errors
 }
 
 tc_rule_stats_get()
-- 
2.19.1

WARNING: multiple messages have this Message-ID (diff)
From: idosch@mellanox.com (Ido Schimmel)
Subject: [PATCH net-next 06/18] selftests: forwarding: lib: Add link_stats_rx_errors_get()
Date: Mon, 19 Nov 2018 16:11:13 +0000	[thread overview]
Message-ID: <20181119161006.5405-7-idosch@mellanox.com> (raw)
Message-ID: <20181119161113.2cwUi1ErrDvGqb-WuOgA9699xZWeESYoZ9x3xmwfBhY@z> (raw)
In-Reply-To: <20181119161006.5405-1-idosch@mellanox.com>

From: Petr Machata <petrm@mellanox.com>

Such a function will be useful for counting malformed packets in the ECN
decap test.

To that end, introduce a common handler for handling stat-fetching, and
reuse it in link_stats_tx_packets_get() and link_stats_rx_errors_get().

Signed-off-by: Petr Machata <petrm at mellanox.com>
Signed-off-by: Ido Schimmel <idosch at mellanox.com>
---
 tools/testing/selftests/net/forwarding/lib.sh | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/net/forwarding/lib.sh b/tools/testing/selftests/net/forwarding/lib.sh
index e916663a1019..7af5a03bcb32 100644
--- a/tools/testing/selftests/net/forwarding/lib.sh
+++ b/tools/testing/selftests/net/forwarding/lib.sh
@@ -477,11 +477,24 @@ master_name_get()
 	ip -j link show dev $if_name | jq -r '.[]["master"]'
 }
 
+link_stats_get()
+{
+	local if_name=$1; shift
+	local dir=$1; shift
+	local stat=$1; shift
+
+	ip -j -s link show dev $if_name \
+		| jq '.[]["stats64"]["'$dir'"]["'$stat'"]'
+}
+
 link_stats_tx_packets_get()
 {
-       local if_name=$1
+	link_stats_get $1 tx packets
+}
 
-       ip -j -s link show dev $if_name | jq '.[]["stats64"]["tx"]["packets"]'
+link_stats_rx_errors_get()
+{
+	link_stats_get $1 rx errors
 }
 
 tc_rule_stats_get()
-- 
2.19.1

  parent reply	other threads:[~2018-11-20  2:35 UTC|newest]

Thread overview: 75+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-19 16:11 [PATCH net-next 00/18] selftests: Add tests for VXLAN at an 802.1d bridge Ido Schimmel
2018-11-19 16:11 ` Ido Schimmel
2018-11-19 16:11 ` idosch
2018-11-19 16:11 ` [PATCH net-next 01/18] net: skb_scrub_packet(): Scrub offload_fwd_mark Ido Schimmel
2018-11-19 16:11   ` Ido Schimmel
2018-11-19 16:11   ` idosch
2018-11-19 19:07   ` David Miller
2018-11-19 19:07     ` David Miller
2018-11-19 19:07     ` davem
2018-11-19 20:06     ` Ido Schimmel
2018-11-19 20:06       ` Ido Schimmel
2018-11-19 20:06       ` idosch
2018-11-19 22:41     ` Petr Machata
2018-11-19 22:41       ` Petr Machata
2018-11-19 22:41       ` petrm
2018-11-19 16:11 ` [PATCH net-next 02/18] selftests: forwarding: lib: Support NUM_NETIFS of 0 Ido Schimmel
2018-11-19 16:11   ` Ido Schimmel
2018-11-19 16:11   ` idosch
2018-11-19 16:11 ` [PATCH net-next 03/18] selftests: forwarding: lib: Add in_ns() Ido Schimmel
2018-11-19 16:11   ` Ido Schimmel
2018-11-19 16:11   ` idosch
2018-11-19 16:11 ` [PATCH net-next 04/18] selftests: forwarding: ping{6,}_test(): Add description argument Ido Schimmel
2018-11-19 16:11   ` Ido Schimmel
2018-11-19 16:11   ` idosch
2018-11-19 16:11 ` [PATCH net-next 05/18] selftests: forwarding: ping{6,}_do(): Allow passing ping arguments Ido Schimmel
2018-11-19 16:11   ` Ido Schimmel
2018-11-19 16:11   ` idosch
2018-11-19 16:11 ` Ido Schimmel [this message]
2018-11-19 16:11   ` [PATCH net-next 06/18] selftests: forwarding: lib: Add link_stats_rx_errors_get() Ido Schimmel
2018-11-19 16:11   ` idosch
2018-11-19 16:11 ` [PATCH net-next 07/18] selftests: forwarding: Add a skeleton of vxlan_bridge_1d Ido Schimmel
2018-11-19 16:11   ` Ido Schimmel
2018-11-19 16:11   ` idosch
2018-11-19 16:11 ` [PATCH net-next 08/18] selftests: forwarding: vxlan_bridge_1d: Add ping test Ido Schimmel
2018-11-19 16:11   ` Ido Schimmel
2018-11-19 16:11   ` idosch
2018-11-19 16:11 ` [PATCH net-next 09/18] selftests: forwarding: vxlan_bridge_1d: Add flood test Ido Schimmel
2018-11-19 16:11   ` Ido Schimmel
2018-11-19 16:11   ` idosch
2018-11-19 16:11 ` [PATCH net-next 10/18] selftests: forwarding: vxlan_bridge_1d: Add unicast test Ido Schimmel
2018-11-19 16:11   ` Ido Schimmel
2018-11-19 16:11   ` idosch
2018-11-19 16:11 ` [PATCH net-next 11/18] selftests: forwarding: vxlan_bridge_1d: Reconfigure & rerun tests Ido Schimmel
2018-11-19 16:11   ` Ido Schimmel
2018-11-19 16:11   ` idosch
2018-11-19 16:11 ` [PATCH net-next 12/18] selftests: forwarding: vxlan_bridge_1d: Add a TTL test Ido Schimmel
2018-11-19 16:11   ` Ido Schimmel
2018-11-19 16:11   ` idosch
2018-11-19 16:11 ` [PATCH net-next 13/18] selftests: forwarding: vxlan_bridge_1d: Add a TOS test Ido Schimmel
2018-11-19 16:11   ` Ido Schimmel
2018-11-19 16:11   ` idosch
2018-11-19 16:11 ` [PATCH net-next 14/18] selftests: forwarding: vxlan_bridge_1d: Add an ECN encap test Ido Schimmel
2018-11-19 16:11   ` Ido Schimmel
2018-11-19 16:11   ` idosch
2018-11-19 16:11 ` [PATCH net-next 15/18] selftests: forwarding: vxlan_bridge_1d: Add an ECN decap test Ido Schimmel
2018-11-19 16:11   ` Ido Schimmel
2018-11-19 16:11   ` idosch
2018-11-19 16:11 ` [PATCH net-next 16/18] selftests: forwarding: vxlan_bridge_1d_port_8472: New test Ido Schimmel
2018-11-19 16:11   ` Ido Schimmel
2018-11-19 16:11   ` idosch
2018-11-19 16:11 ` [PATCH net-next 17/18] selftests: mlxsw: Add a test for VxLAN configuration Ido Schimmel
2018-11-19 16:11   ` Ido Schimmel
2018-11-19 16:11   ` idosch
2018-11-19 16:21   ` Petr Machata
2018-11-19 16:21     ` Petr Machata
2018-11-19 16:21     ` petrm
2018-11-19 16:11 ` [PATCH net-next 18/18] selftests: mlxsw: Add a test for VxLAN flooding Ido Schimmel
2018-11-19 16:11   ` Ido Schimmel
2018-11-19 16:11   ` idosch
2018-11-19 16:25   ` Petr Machata
2018-11-19 16:25     ` Petr Machata
2018-11-19 16:25     ` petrm
2018-11-20  2:00 ` [PATCH net-next 00/18] selftests: Add tests for VXLAN at an 802.1d bridge David Miller
2018-11-20  2:00   ` David Miller
2018-11-20  2:00   ` davem

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=20181119161006.5405-7-idosch@mellanox.com \
    --to=idosch@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=jiri@mellanox.com \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=mlxsw@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=petrm@mellanox.com \
    --cc=roopa@cumulusnetworks.com \
    --cc=shuah@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.