selftests: forwarding: Fix packet matching in mirroring selftests
authorPetr Machata <petrm@nvidia.com>
Tue, 9 Nov 2021 16:17:34 +0000 (17:17 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 10 Nov 2021 14:38:44 +0000 (14:38 +0000)
commitaf0a51113cb7445435488e5f9514598f2b52d7a7
treef9e00b468a700d3521df75242bc6fab86a90de04
parentc7cd82b90599fa10915f41e3dd9098a77d0aa7b6
selftests: forwarding: Fix packet matching in mirroring selftests

In commit 6de6e46d27ef ("cls_flower: Fix inability to match GRE/IPIP
packets"), cls_flower was fixed to match an outer packet of a tunneled
packet as would be expected, rather than dissecting to the inner packet and
matching on that.

This fix uncovered several issues in packet matching in mirroring
selftests:

- in mirror_gre_bridge_1d_vlan.sh and mirror_gre_vlan_bridge_1q.sh, the
  vlan_ethtype match is copied around as "ip", even as some of the tests
  are running over ip6gretap. This is fixed by using an "ipv6" for
  vlan_ethtype in the ip6gretap tests.

- in mirror_gre_changes.sh, a filter to count GRE packets is set up to
  match TTL of 50. This used to trigger in the offloaded datapath, where
  the envelope TTL was matched, but not in the software datapath, which
  considered TTL of the inner packet. Now that both match consistently, all
  the packets were double-counted. This is fixed by marking the filter as
  skip_hw, leaving only the SW datapath component active.

Fixes: 6de6e46d27ef ("cls_flower: Fix inability to match GRE/IPIP packets")
Signed-off-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
tools/testing/selftests/net/forwarding/mirror_gre_bridge_1d_vlan.sh
tools/testing/selftests/net/forwarding/mirror_gre_changes.sh
tools/testing/selftests/net/forwarding/mirror_gre_vlan_bridge_1q.sh
tools/testing/selftests/net/forwarding/mirror_lib.sh
tools/testing/selftests/net/forwarding/mirror_vlan.sh