]> www.infradead.org Git - users/hch/configfs.git/commit
selftests: mirror: do_test_span_dir_ips(): Install accurate taps
authorPetr Machata <petrm@nvidia.com>
Thu, 27 Jun 2024 14:48:42 +0000 (16:48 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 28 Jun 2024 09:55:37 +0000 (10:55 +0100)
commit833415358f341941f35b6ffc53c569db057b2ab5
tree7fb6832ca0ab19b8db8beb45410679487f16e352
parent95e7b860e16dbdfb07a0f36c9f954764799a3632
selftests: mirror: do_test_span_dir_ips(): Install accurate taps

The mirroring selftests work by sending ICMP traffic between two hosts.
Along the way, this traffic is mirrored to a gretap netdevice, and counter
taps are then installed strategically along the path of the mirrored
traffic to verify the mirroring took place.

The problem with this is that besides mirroring the primary traffic, any
other service traffic is mirrored as well. At the same time, because the
tests need to work in HW-offloaded scenarios, the ability of the device to
do arbitrary packet inspection should not be taken for granted. Most tests
therefore simply use matchall, one uses flower to match on IP address.

As a result, the selftests are noisy, because besides the primary ICMP
traffic, any amount of other service traffic is mirrored as well.

However, often the counter tap is installed at the remote end of the gretap
tunnel. Since this is a SW-datapath scenario anyway, we can make the filter
arbitrarily accurate.

Thus in this patch, add parameters forward_type and backward_type to
several mirroring test helpers, as some other helpers already have. Then
change do_test_span_dir_ips() to instead of installing one generic tap and
using it for test in both directions, install the tap for each direction
separately, matching on the ICMP type given by these parameters.

Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Danielle Ratson <danieller@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
tools/testing/selftests/net/forwarding/mirror_gre.sh
tools/testing/selftests/net/forwarding/mirror_gre_lib.sh
tools/testing/selftests/net/forwarding/mirror_gre_neigh.sh
tools/testing/selftests/net/forwarding/mirror_lib.sh