Skip to content

Commit

Permalink
selftests: mirror_gre_changes: Tighten up the TTL test match
Browse files Browse the repository at this point in the history
[ Upstream commit 855067d ]

This test verifies whether the encapsulated packets have the correct
configured TTL. It does so by sending ICMP packets through the test
topology and mirroring them to a gretap netdevice. On a busy host
however, more than just the test ICMP packets may end up flowing
through the topology, get mirrored, and counted. This leads to
potential spurious failures as the test observes much more mirrored
packets than the sent test packets, and assumes a bug.

Fix this by tightening up the mirror action match. Change it from
matchall to a flower classifier matching on ICMP packets specifically.

Fixes: 4531567 ("selftests: forwarding: Test changes in mirror-to-gretap")
Signed-off-by: Petr Machata <petrm@nvidia.com>
Tested-by: Mirsad Todorovac <mirsad.todorovac@alu.unizg.hr>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
pmachata authored and gregkh committed Aug 23, 2023
1 parent cd4460b commit 2f07f13
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tools/testing/selftests/net/forwarding/mirror_gre_changes.sh
Expand Up @@ -72,7 +72,8 @@ test_span_gre_ttl()

RET=0

mirror_install $swp1 ingress $tundev "matchall $tcflags"
mirror_install $swp1 ingress $tundev \
"prot ip flower $tcflags ip_prot icmp"
tc filter add dev $h3 ingress pref 77 prot $prot \
flower skip_hw ip_ttl 50 action pass

Expand Down

0 comments on commit 2f07f13

Please sign in to comment.