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

selftests: forwarding: Make {, ip6}gre-inner-v6-multipath tests more robust

These tests generate various IPv6 flows, encapsulate them in GRE packets
and check that the encapsulated packets are distributed between the
available nexthops according to the configured weights.

Unlike the corresponding IPv4 tests, these tests sometimes fail in the
netdev CI because of large discrepancies between the expected and
measured ratios [1]. This can be explained by the fact that the IPv4
tests generate about 3,600 different flows whereas the IPv6 tests only
generate about 784 different flows (potentially by mistake).

Fix by aligning the IPv6 tests to the IPv4 ones and increase the number
of generated flows.

[1]
[...]
# TEST: ping [ OK ]
# INFO: Running IPv6 over GRE over IPv4 multipath tests
# TEST: ECMP [FAIL]
# Too large discrepancy between expected and measured ratios
# INFO: Expected ratio 1.00 Measured ratio 1.18
[...]

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

authored by

Ido Schimmel and committed by
Jakub Kicinski
35df2ce8 f0008b04

+4 -4
+2 -2
tools/testing/selftests/net/forwarding/gre_inner_v6_multipath.sh
··· 266 266 local t0_222=$(tc_rule_stats_get $ul32 222 ingress) 267 267 268 268 ip vrf exec v$h1 \ 269 - $MZ $h1 -6 -q -p 64 -A "2001:db8:1::2-2001:db8:1::1e" \ 270 - -B "2001:db8:2::2-2001:db8:2::1e" \ 269 + $MZ $h1 -6 -q -p 64 -A "2001:db8:1::2-2001:db8:1::3e" \ 270 + -B "2001:db8:2::2-2001:db8:2::3e" \ 271 271 -d $MZ_DELAY -c 50 -t udp "sp=1024,dp=1024" 272 272 sleep 1 273 273
+2 -2
tools/testing/selftests/net/forwarding/ip6gre_inner_v6_multipath.sh
··· 265 265 local t0_222=$(tc_rule_stats_get $ul32 222 ingress) 266 266 267 267 ip vrf exec v$h1 \ 268 - $MZ $h1 -6 -q -p 64 -A "2001:db8:1::2-2001:db8:1::1e" \ 269 - -B "2001:db8:2::2-2001:db8:2::1e" \ 268 + $MZ $h1 -6 -q -p 64 -A "2001:db8:1::2-2001:db8:1::3e" \ 269 + -B "2001:db8:2::2-2001:db8:2::3e" \ 270 270 -d $MZ_DELAY -c 50 -t udp "sp=1024,dp=1024" 271 271 sleep 1 272 272