summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorIdo Schimmel <idosch@mellanox.com>2019-07-23 04:19:26 -0400
committerDavid S. Miller <davem@davemloft.net>2019-07-23 16:06:48 -0400
commit1be79d89b7ae96e004911bd228ce8c2b5cc6415f (patch)
tree5c810be77f49d0a8fef71699a366103978aa22c9 /tools
parentefa7b79f675da0efafe3f32ba0d6efe916cf4867 (diff)
selftests: forwarding: gre_multipath: Fix flower filters
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> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/testing/selftests/net/forwarding/gre_multipath.sh24
1 files 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()
93 ip route add vrf v$ol1 192.0.2.16/28 \ 93 ip route add vrf v$ol1 192.0.2.16/28 \
94 nexthop dev g1a \ 94 nexthop dev g1a \
95 nexthop dev g1b 95 nexthop dev g1b
96
97 tc qdisc add dev $ul1 clsact
98 tc filter add dev $ul1 egress pref 111 prot ipv4 \
99 flower dst_ip 192.0.2.66 action pass
100 tc filter add dev $ul1 egress pref 222 prot ipv4 \
101 flower dst_ip 192.0.2.82 action pass
102} 96}
103 97
104sw1_destroy() 98sw1_destroy()
105{ 99{
106 tc qdisc del dev $ul1 clsact
107
108 ip route del vrf v$ol1 192.0.2.16/28 100 ip route del vrf v$ol1 192.0.2.16/28
109 101
110 ip route del vrf v$ol1 192.0.2.82/32 via 192.0.2.146 102 ip route del vrf v$ol1 192.0.2.82/32 via 192.0.2.146
@@ -139,10 +131,18 @@ sw2_create()
139 ip route add vrf v$ol2 192.0.2.0/28 \ 131 ip route add vrf v$ol2 192.0.2.0/28 \
140 nexthop dev g2a \ 132 nexthop dev g2a \
141 nexthop dev g2b 133 nexthop dev g2b
134
135 tc qdisc add dev $ul2 clsact
136 tc filter add dev $ul2 ingress pref 111 prot 802.1Q \
137 flower vlan_id 111 action pass
138 tc filter add dev $ul2 ingress pref 222 prot 802.1Q \
139 flower vlan_id 222 action pass
142} 140}
143 141
144sw2_destroy() 142sw2_destroy()
145{ 143{
144 tc qdisc del dev $ul2 clsact
145
146 ip route del vrf v$ol2 192.0.2.0/28 146 ip route del vrf v$ol2 192.0.2.0/28
147 147
148 ip route del vrf v$ol2 192.0.2.81/32 via 192.0.2.145 148 ip route del vrf v$ol2 192.0.2.81/32 via 192.0.2.145
@@ -215,15 +215,15 @@ multipath4_test()
215 nexthop dev g1a weight $weight1 \ 215 nexthop dev g1a weight $weight1 \
216 nexthop dev g1b weight $weight2 216 nexthop dev g1b weight $weight2
217 217
218 local t0_111=$(tc_rule_stats_get $ul1 111 egress) 218 local t0_111=$(tc_rule_stats_get $ul2 111 ingress)
219 local t0_222=$(tc_rule_stats_get $ul1 222 egress) 219 local t0_222=$(tc_rule_stats_get $ul2 222 ingress)
220 220
221 ip vrf exec v$h1 \ 221 ip vrf exec v$h1 \
222 $MZ $h1 -q -p 64 -A 192.0.2.1 -B 192.0.2.18 \ 222 $MZ $h1 -q -p 64 -A 192.0.2.1 -B 192.0.2.18 \
223 -d 1msec -t udp "sp=1024,dp=0-32768" 223 -d 1msec -t udp "sp=1024,dp=0-32768"
224 224
225 local t1_111=$(tc_rule_stats_get $ul1 111 egress) 225 local t1_111=$(tc_rule_stats_get $ul2 111 ingress)
226 local t1_222=$(tc_rule_stats_get $ul1 222 egress) 226 local t1_222=$(tc_rule_stats_get $ul2 222 ingress)
227 227
228 local d111=$((t1_111 - t0_111)) 228 local d111=$((t1_111 - t0_111))
229 local d222=$((t1_222 - t0_222)) 229 local d222=$((t1_222 - t0_222))