All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Machata <petrm@mellanox.com>
To: netdev@vger.kernel.org, linux-kselftest@vger.kernel.org
Cc: davem@davemloft.net, shuah@kernel.org, idosch@mellanox.com
Subject: [PATCH net-next 3/9] selftests: forwarding: mirror_lib: skip_hw the VLAN capture
Date: Thu, 31 May 2018 19:52:15 +0200	[thread overview]
Message-ID: <50138197e2d52547bb214ba4a21ef2397a0edf30.1527788672.git.petrm@mellanox.com> (raw)
In-Reply-To: <cover.1527788672.git.petrm@mellanox.com>

When the VLAN capture is installed on a front panel device and not a
soft device, the packets are counted twice: once in fast path, and once
after they are trapped to the kernel. Resolve the problem by passing
skip_hw flag to vlan_capture_install().

Signed-off-by: Petr Machata <petrm@mellanox.com>
---
 tools/testing/selftests/net/forwarding/mirror_lib.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/net/forwarding/mirror_lib.sh b/tools/testing/selftests/net/forwarding/mirror_lib.sh
index 67efe25..d36dc26 100644
--- a/tools/testing/selftests/net/forwarding/mirror_lib.sh
+++ b/tools/testing/selftests/net/forwarding/mirror_lib.sh
@@ -102,7 +102,10 @@ do_test_span_vlan_dir_ips()
 	local ip1=$1; shift
 	local ip2=$1; shift
 
-	vlan_capture_install $dev "vlan_id $vid"
+	# Install the capture as skip_hw to avoid double-counting of packets.
+	# The traffic is meant for local box anyway, so will be trapped to
+	# kernel.
+	vlan_capture_install $dev "skip_hw vlan_id $vid"
 	mirror_test v$h1 $ip1 $ip2 $dev 100 $expect
 	mirror_test v$h2 $ip2 $ip1 $dev 100 $expect
 	vlan_capture_uninstall $dev
-- 
2.4.11

WARNING: multiple messages have this Message-ID (diff)
From: petrm at mellanox.com (Petr Machata)
Subject: [PATCH net-next 3/9] selftests: forwarding: mirror_lib: skip_hw the VLAN capture
Date: Thu, 31 May 2018 19:52:15 +0200	[thread overview]
Message-ID: <50138197e2d52547bb214ba4a21ef2397a0edf30.1527788672.git.petrm@mellanox.com> (raw)
In-Reply-To: <cover.1527788672.git.petrm@mellanox.com>

When the VLAN capture is installed on a front panel device and not a
soft device, the packets are counted twice: once in fast path, and once
after they are trapped to the kernel. Resolve the problem by passing
skip_hw flag to vlan_capture_install().

Signed-off-by: Petr Machata <petrm at mellanox.com>
---
 tools/testing/selftests/net/forwarding/mirror_lib.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/net/forwarding/mirror_lib.sh b/tools/testing/selftests/net/forwarding/mirror_lib.sh
index 67efe25..d36dc26 100644
--- a/tools/testing/selftests/net/forwarding/mirror_lib.sh
+++ b/tools/testing/selftests/net/forwarding/mirror_lib.sh
@@ -102,7 +102,10 @@ do_test_span_vlan_dir_ips()
 	local ip1=$1; shift
 	local ip2=$1; shift
 
-	vlan_capture_install $dev "vlan_id $vid"
+	# Install the capture as skip_hw to avoid double-counting of packets.
+	# The traffic is meant for local box anyway, so will be trapped to
+	# kernel.
+	vlan_capture_install $dev "skip_hw vlan_id $vid"
 	mirror_test v$h1 $ip1 $ip2 $dev 100 $expect
 	mirror_test v$h2 $ip2 $ip1 $dev 100 $expect
 	vlan_capture_uninstall $dev
-- 
2.4.11

--
To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: petrm@mellanox.com (Petr Machata)
Subject: [PATCH net-next 3/9] selftests: forwarding: mirror_lib: skip_hw the VLAN capture
Date: Thu, 31 May 2018 19:52:15 +0200	[thread overview]
Message-ID: <50138197e2d52547bb214ba4a21ef2397a0edf30.1527788672.git.petrm@mellanox.com> (raw)
Message-ID: <20180531175215.Zt4orofQTx-l1SBE7rODXVef71qxjUU7NxXRI4humVM@z> (raw)
In-Reply-To: <cover.1527788672.git.petrm@mellanox.com>

When the VLAN capture is installed on a front panel device and not a
soft device, the packets are counted twice: once in fast path, and once
after they are trapped to the kernel. Resolve the problem by passing
skip_hw flag to vlan_capture_install().

Signed-off-by: Petr Machata <petrm at mellanox.com>
---
 tools/testing/selftests/net/forwarding/mirror_lib.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/net/forwarding/mirror_lib.sh b/tools/testing/selftests/net/forwarding/mirror_lib.sh
index 67efe25..d36dc26 100644
--- a/tools/testing/selftests/net/forwarding/mirror_lib.sh
+++ b/tools/testing/selftests/net/forwarding/mirror_lib.sh
@@ -102,7 +102,10 @@ do_test_span_vlan_dir_ips()
 	local ip1=$1; shift
 	local ip2=$1; shift
 
-	vlan_capture_install $dev "vlan_id $vid"
+	# Install the capture as skip_hw to avoid double-counting of packets.
+	# The traffic is meant for local box anyway, so will be trapped to
+	# kernel.
+	vlan_capture_install $dev "skip_hw vlan_id $vid"
 	mirror_test v$h1 $ip1 $ip2 $dev 100 $expect
 	mirror_test v$h2 $ip2 $ip1 $dev 100 $expect
 	vlan_capture_uninstall $dev
-- 
2.4.11

--
To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2018-05-31 17:52 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-31 17:51 [PATCH net-next 0/9] Test mirror-to-gretap with bridge in UL Petr Machata
2018-05-31 17:51 ` Petr Machata
2018-05-31 17:51 ` petrm
2018-05-31 17:52 ` [PATCH net-next 1/9] selftests: forwarding: lib: Move here vlan_capture_{,un}install() Petr Machata
2018-05-31 17:52   ` Petr Machata
2018-05-31 17:52   ` petrm
2018-05-31 17:52 ` [PATCH net-next 2/9] selftests: forwarding: mirror_lib: Move here do_test_span_vlan_dir_ips() Petr Machata
2018-05-31 17:52   ` Petr Machata
2018-05-31 17:52   ` petrm
2018-05-31 17:52 ` Petr Machata [this message]
2018-05-31 17:52   ` [PATCH net-next 3/9] selftests: forwarding: mirror_lib: skip_hw the VLAN capture Petr Machata
2018-05-31 17:52   ` petrm
2018-05-31 17:52 ` [PATCH net-next 4/9] selftests: forwarding: mirror_gre_lib: Add STP test Petr Machata
2018-05-31 17:52   ` Petr Machata
2018-05-31 17:52   ` petrm
2018-05-31 17:52 ` [PATCH net-next 5/9] selftests: forwarding: mirror_gre_vlan_bridge_1q: Fix tunnel name Petr Machata
2018-05-31 17:52   ` Petr Machata
2018-05-31 17:52   ` petrm
2018-05-31 17:52 ` [PATCH net-next 6/9] selftests: forwarding: mirror_gre_vlan_bridge_1q: Test final config Petr Machata
2018-05-31 17:52   ` Petr Machata
2018-05-31 17:52   ` petrm
2018-05-31 17:52 ` [PATCH net-next 7/9] selftests: forwarding: mirror_gre_vlan_bridge_1q: Rename two tests Petr Machata
2018-05-31 17:52   ` Petr Machata
2018-05-31 17:52   ` petrm
2018-05-31 17:52 ` [PATCH net-next 8/9] selftests: forwarding: mirror_gre_vlan_bridge_1q: Add more tests Petr Machata
2018-05-31 17:52   ` Petr Machata
2018-05-31 17:52   ` petrm
2018-05-31 17:52 ` [PATCH net-next 9/9] selftests: forwarding: mirror_gre_bridge_1d_vlan: Add STP test Petr Machata
2018-05-31 17:52   ` Petr Machata
2018-05-31 17:52   ` petrm
2018-06-01 18:11 ` [PATCH net-next 0/9] Test mirror-to-gretap with bridge in UL David Miller
2018-06-01 18:11   ` David Miller
2018-06-01 18:11   ` 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=50138197e2d52547bb214ba4a21ef2397a0edf30.1527788672.git.petrm@mellanox.com \
    --to=petrm@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=idosch@mellanox.com \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --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.