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

selftests: forwarding: Tweak tc filters for mirror-to-gretap tests

When running mirror_gre_bridge_1d_vlan tests on veth, several issues
cause spurious failures:

- vlan_ethtype should be ip, not ipv6 even in mirror-to-ip6gretap case,
because the overlay packet is still IPv4.
- Similarly ip_proto matches the innermost IP protocol, so can't be used
to filter out GRE packet. Drop the corresponding condition.
- Because the above fixes the filters to match in slow path as well,
they need to be made skip_hw so as not to double-count packets.

Signed-off-by: Petr Machata <petrm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Petr Machata and committed by
David S. Miller
ec9fdc99 ac0fcadf

+9 -5
+4 -2
tools/testing/selftests/net/forwarding/mirror_gre_bridge_1d_vlan.sh
··· 74 74 75 75 test_gretap() 76 76 { 77 - test_vlan_match gt4 'vlan_id 555 vlan_ethtype ip' "mirror to gretap" 77 + test_vlan_match gt4 'skip_hw vlan_id 555 vlan_ethtype ip' \ 78 + "mirror to gretap" 78 79 } 79 80 80 81 test_ip6gretap() 81 82 { 82 - test_vlan_match gt6 'vlan_id 555 vlan_ethtype ipv6' "mirror to ip6gretap" 83 + test_vlan_match gt6 'skip_hw vlan_id 555 vlan_ethtype ip' \ 84 + "mirror to ip6gretap" 83 85 } 84 86 85 87 test_gretap_stp()
+1 -1
tools/testing/selftests/net/forwarding/mirror_gre_lib.sh
··· 62 62 "$backward_type" "$ip1" "$ip2" 63 63 64 64 tc filter add dev $h3 ingress pref 77 prot 802.1q \ 65 - flower $vlan_match ip_proto 0x2f \ 65 + flower $vlan_match \ 66 66 action pass 67 67 mirror_test v$h1 $ip1 $ip2 $h3 77 10 68 68 tc filter del dev $h3 ingress pref 77
+4 -2
tools/testing/selftests/net/forwarding/mirror_gre_vlan_bridge_1q.sh
··· 88 88 89 89 test_gretap() 90 90 { 91 - test_vlan_match gt4 'vlan_id 555 vlan_ethtype ip' "mirror to gretap" 91 + test_vlan_match gt4 'skip_hw vlan_id 555 vlan_ethtype ip' \ 92 + "mirror to gretap" 92 93 } 93 94 94 95 test_ip6gretap() 95 96 { 96 - test_vlan_match gt6 'vlan_id 555 vlan_ethtype ipv6' "mirror to ip6gretap" 97 + test_vlan_match gt6 'skip_hw vlan_id 555 vlan_ethtype ip' \ 98 + "mirror to ip6gretap" 97 99 } 98 100 99 101 test_span_gre_forbidden_cpu()