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

selftests: forwarding: Make VXLAN ECN encap tests more robust

These tests sometimes fail on the netdev CI because the expected number
of packets is larger than expected [1].

Make the tests more robust by specifically matching on VXLAN
encapsulated packets and allowing up to five stray packets instead of
just two.

[1]
[...]
# TEST: VXLAN: ECN encap: 0x00->0x00 [FAIL]
# v1: Expected to capture 10 packets, got 13.
# TEST: VXLAN: ECN encap: 0x01->0x01 [ OK ]
# TEST: VXLAN: ECN encap: 0x02->0x02 [ OK ]
# TEST: VXLAN: ECN encap: 0x03->0x02 [ OK ]
[...]

Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Link: https://lore.kernel.org/r/20240304095612.462900-6-idosch@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Ido Schimmel and committed by
Jakub Kicinski
f0008b04 dfbab740

+4 -4
+2 -2
tools/testing/selftests/net/forwarding/vxlan_bridge_1d.sh
··· 495 495 local delta=$((t1 - t0)) 496 496 497 497 # Tolerate a couple stray extra packets. 498 - ((expect <= delta && delta <= expect + 2)) 498 + ((expect <= delta && delta <= expect + 5)) 499 499 check_err $? "$capture_dev: Expected to capture $expect packets, got $delta." 500 500 } 501 501 ··· 532 532 RET=0 533 533 534 534 tc filter add dev v1 egress pref 77 prot ip \ 535 - flower ip_tos $tos action pass 535 + flower ip_tos $tos ip_proto udp dst_port $VXPORT action pass 536 536 sleep 1 537 537 vxlan_ping_test $h1 192.0.2.3 "-Q $q" v1 egress 77 10 538 538 tc filter del dev v1 egress pref 77 prot ip
+2 -2
tools/testing/selftests/net/forwarding/vxlan_bridge_1d_ipv6.sh
··· 616 616 local delta=$((t1 - t0)) 617 617 618 618 # Tolerate a couple stray extra packets. 619 - ((expect <= delta && delta <= expect + 2)) 619 + ((expect <= delta && delta <= expect + 5)) 620 620 check_err $? "$capture_dev: Expected to capture $expect packets, got $delta." 621 621 } 622 622 ··· 653 653 RET=0 654 654 655 655 tc filter add dev v1 egress pref 77 protocol ipv6 \ 656 - flower ip_tos $tos action pass 656 + flower ip_tos $tos ip_proto udp dst_port $VXPORT action pass 657 657 sleep 1 658 658 vxlan_ping_test $h1 2001:db8:1::3 "-Q $q" v1 egress 77 10 659 659 tc filter del dev v1 egress pref 77 protocol ipv6