netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 0/2] selftests: forwarding: GRE multipath fixes
@ 2019-07-23  8:19 Ido Schimmel
  2019-07-23  8:19 ` [PATCH net 1/2] selftests: forwarding: gre_multipath: Enable IPv4 forwarding Ido Schimmel
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Ido Schimmel @ 2019-07-23  8:19 UTC (permalink / raw)
  To: netdev; +Cc: davem, ssuryaextr, mlxsw, Ido Schimmel

From: Ido Schimmel <idosch@mellanox.com>

Patch #1 ensures IPv4 forwarding is enabled during the test.

Patch #2 fixes the flower filters used to measure the distribution of
the traffic between the two nexthops, so that the test will pass
regardless if traffic is offloaded or not.

Ido Schimmel (2):
  selftests: forwarding: gre_multipath: Enable IPv4 forwarding
  selftests: forwarding: gre_multipath: Fix flower filters

 .../selftests/net/forwarding/gre_multipath.sh | 28 +++++++++++--------
 1 file changed, 16 insertions(+), 12 deletions(-)

-- 
2.21.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH net 1/2] selftests: forwarding: gre_multipath: Enable IPv4 forwarding
  2019-07-23  8:19 [PATCH net 0/2] selftests: forwarding: GRE multipath fixes Ido Schimmel
@ 2019-07-23  8:19 ` Ido Schimmel
  2019-07-23  8:19 ` [PATCH net 2/2] selftests: forwarding: gre_multipath: Fix flower filters Ido Schimmel
  2019-07-23 20:07 ` [PATCH net 0/2] selftests: forwarding: GRE multipath fixes David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Ido Schimmel @ 2019-07-23  8:19 UTC (permalink / raw)
  To: netdev; +Cc: davem, ssuryaextr, mlxsw, Ido Schimmel

From: Ido Schimmel <idosch@mellanox.com>

The test did not enable IPv4 forwarding during its setup phase, which
causes the test to fail on machines where IPv4 forwarding is disabled.

Fixes: 54818c4c4b93 ("selftests: forwarding: Test multipath tunneling")
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Reported-by: Stephen Suryaputra <ssuryaextr@gmail.com>
Tested-by: Stephen Suryaputra <ssuryaextr@gmail.com>
---
 tools/testing/selftests/net/forwarding/gre_multipath.sh | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/testing/selftests/net/forwarding/gre_multipath.sh b/tools/testing/selftests/net/forwarding/gre_multipath.sh
index cca2baa03fb8..37d7297e1cf8 100755
--- a/tools/testing/selftests/net/forwarding/gre_multipath.sh
+++ b/tools/testing/selftests/net/forwarding/gre_multipath.sh
@@ -187,12 +187,16 @@ setup_prepare()
 	sw1_create
 	sw2_create
 	h2_create
+
+	forwarding_enable
 }
 
 cleanup()
 {
 	pre_cleanup
 
+	forwarding_restore
+
 	h2_destroy
 	sw2_destroy
 	sw1_destroy
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH net 2/2] selftests: forwarding: gre_multipath: Fix flower filters
  2019-07-23  8:19 [PATCH net 0/2] selftests: forwarding: GRE multipath fixes Ido Schimmel
  2019-07-23  8:19 ` [PATCH net 1/2] selftests: forwarding: gre_multipath: Enable IPv4 forwarding Ido Schimmel
@ 2019-07-23  8:19 ` Ido Schimmel
  2019-07-23 20:07 ` [PATCH net 0/2] selftests: forwarding: GRE multipath fixes David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Ido Schimmel @ 2019-07-23  8:19 UTC (permalink / raw)
  To: netdev; +Cc: davem, ssuryaextr, mlxsw, Ido Schimmel

From: Ido Schimmel <idosch@mellanox.com>

The TC filters used in the test do not work with veth devices because the
outer Ethertype is 802.1Q and not IPv4. The test passes with mlxsw
netdevs since the hardware always looks at "The first Ethertype that
does not point to either: VLAN, CNTAG or configurable Ethertype".

Fix this by matching on the VLAN ID instead, but on the ingress side.
The reason why this is not performed at egress is explained in the
commit cited below.

Fixes: 541ad323db3a ("selftests: forwarding: gre_multipath: Update next-hop statistics match criteria")
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Reported-by: Stephen Suryaputra <ssuryaextr@gmail.com>
Tested-by: Stephen Suryaputra <ssuryaextr@gmail.com>
---
 .../selftests/net/forwarding/gre_multipath.sh | 24 +++++++++----------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/tools/testing/selftests/net/forwarding/gre_multipath.sh b/tools/testing/selftests/net/forwarding/gre_multipath.sh
index 37d7297e1cf8..a8d8e8b3dc81 100755
--- a/tools/testing/selftests/net/forwarding/gre_multipath.sh
+++ b/tools/testing/selftests/net/forwarding/gre_multipath.sh
@@ -93,18 +93,10 @@ sw1_create()
 	ip route add vrf v$ol1 192.0.2.16/28 \
 	   nexthop dev g1a \
 	   nexthop dev g1b
-
-	tc qdisc add dev $ul1 clsact
-	tc filter add dev $ul1 egress pref 111 prot ipv4 \
-	   flower dst_ip 192.0.2.66 action pass
-	tc filter add dev $ul1 egress pref 222 prot ipv4 \
-	   flower dst_ip 192.0.2.82 action pass
 }
 
 sw1_destroy()
 {
-	tc qdisc del dev $ul1 clsact
-
 	ip route del vrf v$ol1 192.0.2.16/28
 
 	ip route del vrf v$ol1 192.0.2.82/32 via 192.0.2.146
@@ -139,10 +131,18 @@ sw2_create()
 	ip route add vrf v$ol2 192.0.2.0/28 \
 	   nexthop dev g2a \
 	   nexthop dev g2b
+
+	tc qdisc add dev $ul2 clsact
+	tc filter add dev $ul2 ingress pref 111 prot 802.1Q \
+	   flower vlan_id 111 action pass
+	tc filter add dev $ul2 ingress pref 222 prot 802.1Q \
+	   flower vlan_id 222 action pass
 }
 
 sw2_destroy()
 {
+	tc qdisc del dev $ul2 clsact
+
 	ip route del vrf v$ol2 192.0.2.0/28
 
 	ip route del vrf v$ol2 192.0.2.81/32 via 192.0.2.145
@@ -215,15 +215,15 @@ multipath4_test()
 	   nexthop dev g1a weight $weight1 \
 	   nexthop dev g1b weight $weight2
 
-	local t0_111=$(tc_rule_stats_get $ul1 111 egress)
-	local t0_222=$(tc_rule_stats_get $ul1 222 egress)
+	local t0_111=$(tc_rule_stats_get $ul2 111 ingress)
+	local t0_222=$(tc_rule_stats_get $ul2 222 ingress)
 
 	ip vrf exec v$h1 \
 	   $MZ $h1 -q -p 64 -A 192.0.2.1 -B 192.0.2.18 \
 	       -d 1msec -t udp "sp=1024,dp=0-32768"
 
-	local t1_111=$(tc_rule_stats_get $ul1 111 egress)
-	local t1_222=$(tc_rule_stats_get $ul1 222 egress)
+	local t1_111=$(tc_rule_stats_get $ul2 111 ingress)
+	local t1_222=$(tc_rule_stats_get $ul2 222 ingress)
 
 	local d111=$((t1_111 - t0_111))
 	local d222=$((t1_222 - t0_222))
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net 0/2] selftests: forwarding: GRE multipath fixes
  2019-07-23  8:19 [PATCH net 0/2] selftests: forwarding: GRE multipath fixes Ido Schimmel
  2019-07-23  8:19 ` [PATCH net 1/2] selftests: forwarding: gre_multipath: Enable IPv4 forwarding Ido Schimmel
  2019-07-23  8:19 ` [PATCH net 2/2] selftests: forwarding: gre_multipath: Fix flower filters Ido Schimmel
@ 2019-07-23 20:07 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2019-07-23 20:07 UTC (permalink / raw)
  To: idosch; +Cc: netdev, ssuryaextr, mlxsw, idosch

From: Ido Schimmel <idosch@idosch.org>
Date: Tue, 23 Jul 2019 11:19:24 +0300

> From: Ido Schimmel <idosch@mellanox.com>
> 
> Patch #1 ensures IPv4 forwarding is enabled during the test.
> 
> Patch #2 fixes the flower filters used to measure the distribution of
> the traffic between the two nexthops, so that the test will pass
> regardless if traffic is offloaded or not.

Series applied.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-07-23 20:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-23  8:19 [PATCH net 0/2] selftests: forwarding: GRE multipath fixes Ido Schimmel
2019-07-23  8:19 ` [PATCH net 1/2] selftests: forwarding: gre_multipath: Enable IPv4 forwarding Ido Schimmel
2019-07-23  8:19 ` [PATCH net 2/2] selftests: forwarding: gre_multipath: Fix flower filters Ido Schimmel
2019-07-23 20:07 ` [PATCH net 0/2] selftests: forwarding: GRE multipath fixes David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).