Skip to content

Commit 8eadf9b

Browse files
committed
Merge branch 'selftests-forwarding-GRE-multipath-fixes'
Ido Schimmel says: ==================== selftests: forwarding: GRE multipath fixes 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. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents b3e487c + 1be79d8 commit 8eadf9b

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

tools/testing/selftests/net/forwarding/gre_multipath.sh

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -93,18 +93,10 @@ sw1_create()
9393
ip route add vrf v$ol1 192.0.2.16/28 \
9494
nexthop dev g1a \
9595
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
10296
}
10397

10498
sw1_destroy()
10599
{
106-
tc qdisc del dev $ul1 clsact
107-
108100
ip route del vrf v$ol1 192.0.2.16/28
109101

110102
ip route del vrf v$ol1 192.0.2.82/32 via 192.0.2.146
@@ -139,10 +131,18 @@ sw2_create()
139131
ip route add vrf v$ol2 192.0.2.0/28 \
140132
nexthop dev g2a \
141133
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
142140
}
143141

144142
sw2_destroy()
145143
{
144+
tc qdisc del dev $ul2 clsact
145+
146146
ip route del vrf v$ol2 192.0.2.0/28
147147

148148
ip route del vrf v$ol2 192.0.2.81/32 via 192.0.2.145
@@ -187,12 +187,16 @@ setup_prepare()
187187
sw1_create
188188
sw2_create
189189
h2_create
190+
191+
forwarding_enable
190192
}
191193

192194
cleanup()
193195
{
194196
pre_cleanup
195197

198+
forwarding_restore
199+
196200
h2_destroy
197201
sw2_destroy
198202
sw1_destroy
@@ -211,15 +215,15 @@ multipath4_test()
211215
nexthop dev g1a weight $weight1 \
212216
nexthop dev g1b weight $weight2
213217

214-
local t0_111=$(tc_rule_stats_get $ul1 111 egress)
215-
local t0_222=$(tc_rule_stats_get $ul1 222 egress)
218+
local t0_111=$(tc_rule_stats_get $ul2 111 ingress)
219+
local t0_222=$(tc_rule_stats_get $ul2 222 ingress)
216220

217221
ip vrf exec v$h1 \
218222
$MZ $h1 -q -p 64 -A 192.0.2.1 -B 192.0.2.18 \
219223
-d 1msec -t udp "sp=1024,dp=0-32768"
220224

221-
local t1_111=$(tc_rule_stats_get $ul1 111 egress)
222-
local t1_222=$(tc_rule_stats_get $ul1 222 egress)
225+
local t1_111=$(tc_rule_stats_get $ul2 111 ingress)
226+
local t1_222=$(tc_rule_stats_get $ul2 222 ingress)
223227

224228
local d111=$((t1_111 - t0_111))
225229
local d222=$((t1_222 - t0_222))

0 commit comments

Comments
 (0)