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

selftests: forwarding: Fix test for different devices

When running the test on the Spectrum ASIC the generated packets are
counted on the ingress filter and injected back to the pipeline because
of the 'pass' action. The router block then drops the packets due to
checksum error, as the test generates packets with zero checksum.

When running the test on an emulator that is not as strict about
checksum errors the test fails since packets are counted twice. Once by
the emulated ASIC on its ingress filter and again by the kernel as the
emulator does not perform checksum validation and allows the packets to
be trapped by a matching host route.

Fix this by changing the action to 'drop', which will prevent the packet
from continuing further in the pipeline to the router block.

For veth pairs this change is essentially a NOP given packets are only
processed once (by the kernel).

Fixes: a0b61f3d8ebf ("selftests: forwarding: vxlan_bridge_1d: Add an ECN decap test")
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Reviewed-by: Petr Machata <petrm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Ido Schimmel and committed by
David S. Miller
289fb44d 27973793

+1 -1
+1 -1
tools/testing/selftests/net/forwarding/vxlan_bridge_1d.sh
··· 629 629 RET=0 630 630 631 631 tc filter add dev $h1 ingress pref 77 prot ip \ 632 - flower ip_tos $decapped_tos action pass 632 + flower ip_tos $decapped_tos action drop 633 633 sleep 1 634 634 vxlan_encapped_ping_test v2 v1 192.0.2.17 \ 635 635 $orig_inner_tos $orig_outer_tos \