Commit 5ad05123 authored by Jakub Kicinski's avatar Jakub Kicinski
Browse files

Merge branch 'selftests-forwarding-various-improvements'

Ido Schimmel says:

====================
selftests: forwarding: Various improvements

This patchset speeds up the multipath tests (patches #1-#2) and makes
other tests more stable (patches #3-#6) so that they will not randomly
fail in the netdev CI.

On my system, after applying the first two patches, the run time of
gre_multipath_nh_res.sh is reduced by over 90%.
====================

Link: https://lore.kernel.org/r/20240304095612.462900-1-idosch@nvidia.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents 00af2aa9 35df2ce8
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -183,42 +183,42 @@ send_src_ipv4()
{
	ip vrf exec v$h1 $MZ $h1 -q -p 64 \
		-A "198.51.100.2-198.51.100.253" -B 203.0.113.2 \
		-d 1msec -c 50 -t udp "sp=20000,dp=30000"
		-d $MZ_DELAY -c 50 -t udp "sp=20000,dp=30000"
}

send_dst_ipv4()
{
	ip vrf exec v$h1 $MZ $h1 -q -p 64 \
		-A 198.51.100.2 -B "203.0.113.2-203.0.113.253" \
		-d 1msec -c 50 -t udp "sp=20000,dp=30000"
		-d $MZ_DELAY -c 50 -t udp "sp=20000,dp=30000"
}

send_src_udp4()
{
	ip vrf exec v$h1 $MZ $h1 -q -p 64 \
		-A 198.51.100.2 -B 203.0.113.2 \
		-d 1msec -t udp "sp=0-32768,dp=30000"
		-d $MZ_DELAY -t udp "sp=0-32768,dp=30000"
}

send_dst_udp4()
{
	ip vrf exec v$h1 $MZ $h1 -q -p 64 \
		-A 198.51.100.2 -B 203.0.113.2 \
		-d 1msec -t udp "sp=20000,dp=0-32768"
		-d $MZ_DELAY -t udp "sp=20000,dp=0-32768"
}

send_src_ipv6()
{
	ip vrf exec v$h1 $MZ -6 $h1 -q -p 64 \
		-A "2001:db8:1::2-2001:db8:1::fd" -B 2001:db8:4::2 \
		-d 1msec -c 50 -t udp "sp=20000,dp=30000"
		-d $MZ_DELAY -c 50 -t udp "sp=20000,dp=30000"
}

send_dst_ipv6()
{
	ip vrf exec v$h1 $MZ -6 $h1 -q -p 64 \
		-A 2001:db8:1::2 -B "2001:db8:4::2-2001:db8:4::fd" \
		-d 1msec -c 50 -t udp "sp=20000,dp=30000"
		-d $MZ_DELAY -c 50 -t udp "sp=20000,dp=30000"
}

send_flowlabel()
@@ -234,14 +234,14 @@ send_src_udp6()
{
	ip vrf exec v$h1 $MZ -6 $h1 -q -p 64 \
		-A 2001:db8:1::2 -B 2001:db8:4::2 \
		-d 1msec -t udp "sp=0-32768,dp=30000"
		-d $MZ_DELAY -t udp "sp=0-32768,dp=30000"
}

send_dst_udp6()
{
	ip vrf exec v$h1 $MZ -6 $h1 -q -p 64 \
		-A 2001:db8:1::2 -B 2001:db8:4::2 \
		-d 1msec -t udp "sp=20000,dp=0-32768"
		-d $MZ_DELAY -t udp "sp=20000,dp=0-32768"
}

custom_hash_test()
+2 −0
Original line number Diff line number Diff line
@@ -28,6 +28,8 @@ PING=ping
PING6=ping6
# Packet generator. Some distributions use 'mz'.
MZ=mausezahn
# mausezahn delay between transmissions in microseconds.
MZ_DELAY=0
# Time to wait after interfaces participating in the test are all UP
WAIT_TIME=5
# Whether to pause on failure or not.
+8 −8
Original line number Diff line number Diff line
@@ -278,42 +278,42 @@ send_src_ipv4()
{
	ip vrf exec v$h1 $MZ $h1 -q -p 64 \
		-A "198.51.100.2-198.51.100.253" -B 203.0.113.2 \
		-d 1msec -c 50 -t udp "sp=20000,dp=30000"
		-d $MZ_DELAY -c 50 -t udp "sp=20000,dp=30000"
}

send_dst_ipv4()
{
	ip vrf exec v$h1 $MZ $h1 -q -p 64 \
		-A 198.51.100.2 -B "203.0.113.2-203.0.113.253" \
		-d 1msec -c 50 -t udp "sp=20000,dp=30000"
		-d $MZ_DELAY -c 50 -t udp "sp=20000,dp=30000"
}

send_src_udp4()
{
	ip vrf exec v$h1 $MZ $h1 -q -p 64 \
		-A 198.51.100.2 -B 203.0.113.2 \
		-d 1msec -t udp "sp=0-32768,dp=30000"
		-d $MZ_DELAY -t udp "sp=0-32768,dp=30000"
}

send_dst_udp4()
{
	ip vrf exec v$h1 $MZ $h1 -q -p 64 \
		-A 198.51.100.2 -B 203.0.113.2 \
		-d 1msec -t udp "sp=20000,dp=0-32768"
		-d $MZ_DELAY -t udp "sp=20000,dp=0-32768"
}

send_src_ipv6()
{
	ip vrf exec v$h1 $MZ -6 $h1 -q -p 64 \
		-A "2001:db8:1::2-2001:db8:1::fd" -B 2001:db8:2::2 \
		-d 1msec -c 50 -t udp "sp=20000,dp=30000"
		-d $MZ_DELAY -c 50 -t udp "sp=20000,dp=30000"
}

send_dst_ipv6()
{
	ip vrf exec v$h1 $MZ -6 $h1 -q -p 64 \
		-A 2001:db8:1::2 -B "2001:db8:2::2-2001:db8:2::fd" \
		-d 1msec -c 50 -t udp "sp=20000,dp=30000"
		-d $MZ_DELAY -c 50 -t udp "sp=20000,dp=30000"
}

send_flowlabel()
@@ -329,14 +329,14 @@ send_src_udp6()
{
	ip vrf exec v$h1 $MZ -6 $h1 -q -p 64 \
		-A 2001:db8:1::2 -B 2001:db8:2::2 \
		-d 1msec -t udp "sp=0-32768,dp=30000"
		-d $MZ_DELAY -t udp "sp=0-32768,dp=30000"
}

send_dst_udp6()
{
	ip vrf exec v$h1 $MZ -6 $h1 -q -p 64 \
		-A 2001:db8:1::2 -B 2001:db8:2::2 \
		-d 1msec -t udp "sp=20000,dp=0-32768"
		-d $MZ_DELAY -t udp "sp=20000,dp=0-32768"
}

custom_hash_test()
+1 −1
Original line number Diff line number Diff line
@@ -267,7 +267,7 @@ multipath4_test()

	ip vrf exec v$h1 \
	   $MZ $h1 -q -p 64 -A "192.0.3.2-192.0.3.62" -B "192.0.4.2-192.0.4.62" \
	       -d 1msec -c 50 -t udp "sp=1024,dp=1024"
	       -d $MZ_DELAY -c 50 -t udp "sp=1024,dp=1024"
	sleep 1

	local t1_111=$(tc_rule_stats_get $ul32 111 ingress)
+3 −3
Original line number Diff line number Diff line
@@ -266,9 +266,9 @@ multipath6_test()
	local t0_222=$(tc_rule_stats_get $ul32 222 ingress)

	ip vrf exec v$h1 \
	   $MZ $h1 -6 -q -p 64 -A "2001:db8:1::2-2001:db8:1::1e" \
	       -B "2001:db8:2::2-2001:db8:2::1e" \
	       -d 1msec -c 50 -t udp "sp=1024,dp=1024"
	   $MZ $h1 -6 -q -p 64 -A "2001:db8:1::2-2001:db8:1::3e" \
	       -B "2001:db8:2::2-2001:db8:2::3e" \
	       -d $MZ_DELAY -c 50 -t udp "sp=1024,dp=1024"
	sleep 1

	local t1_111=$(tc_rule_stats_get $ul32 111 ingress)
Loading