Skip to content

Commit

Permalink
Merge branch 'selftests-forwarding-GRE-multipath-fixes'
Browse files Browse the repository at this point in the history
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 <davem@davemloft.net>
  • Loading branch information
davem330 committed Jul 23, 2019
2 parents b3e487c + 1be79d8 commit 8eadf9b
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions tools/testing/selftests/net/forwarding/gre_multipath.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -211,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))
Expand Down

0 comments on commit 8eadf9b

Please sign in to comment.