Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Ido Schimmel and committed by
David S. Miller
1be79d89 efa7b79f

+12 -12
+12 -12
tools/testing/selftests/net/forwarding/gre_multipath.sh
··· 93 93 ip route add vrf v$ol1 192.0.2.16/28 \ 94 94 nexthop dev g1a \ 95 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 104 98 sw1_destroy() 105 99 { 106 - tc qdisc del dev $ul1 clsact 107 - 108 100 ip route del vrf v$ol1 192.0.2.16/28 109 101 110 102 ip route del vrf v$ol1 192.0.2.82/32 via 192.0.2.146 ··· 131 139 ip route add vrf v$ol2 192.0.2.0/28 \ 132 140 nexthop dev g2a \ 133 141 nexthop dev g2b 142 + 143 + tc qdisc add dev $ul2 clsact 144 + tc filter add dev $ul2 ingress pref 111 prot 802.1Q \ 145 + flower vlan_id 111 action pass 146 + tc filter add dev $ul2 ingress pref 222 prot 802.1Q \ 147 + flower vlan_id 222 action pass 134 148 } 135 149 136 150 sw2_destroy() 137 151 { 152 + tc qdisc del dev $ul2 clsact 153 + 138 154 ip route del vrf v$ol2 192.0.2.0/28 139 155 140 156 ip route del vrf v$ol2 192.0.2.81/32 via 192.0.2.145 ··· 215 215 nexthop dev g1a weight $weight1 \ 216 216 nexthop dev g1b weight $weight2 217 217 218 - local t0_111=$(tc_rule_stats_get $ul1 111 egress) 219 - 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) 220 220 221 221 ip vrf exec v$h1 \ 222 222 $MZ $h1 -q -p 64 -A 192.0.2.1 -B 192.0.2.18 \ 223 223 -d 1msec -t udp "sp=1024,dp=0-32768" 224 224 225 - local t1_111=$(tc_rule_stats_get $ul1 111 egress) 226 - 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) 227 227 228 228 local d111=$((t1_111 - t0_111)) 229 229 local d222=$((t1_222 - t0_222))