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

selftests: router_mpath: Sleep after MZ

In the context of an offloaded datapath, it may take a while for the ip
link stats to be updated. This causes the test to fail when MZ_DELAY is too
low. Sleep after the packets are sent for the link stats to get up to date.

Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Link: https://patch.msgid.link/8b1971d948273afd7de2da3d6a2ba35200540e55.1723036486.git.petrm@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Petr Machata and committed by
Jakub Kicinski
110d3ffe b72a6a7a

+6
+2
tools/testing/selftests/net/forwarding/router_mpath_nh.sh
··· 243 243 244 244 ip vrf exec vrf-h1 $MZ $h1 -q -p 64 -A 192.0.2.2 -B 198.51.100.2 \ 245 245 -d $MZ_DELAY -t udp "sp=1024,dp=0-32768" 246 + sleep 1 246 247 247 248 t1_rp12=$(link_stats_tx_packets_get $rp12) 248 249 t1_rp13=$(link_stats_tx_packets_get $rp13) ··· 277 276 278 277 $MZ $h1 -6 -q -p 64 -A 2001:db8:1::2 -B 2001:db8:2::2 \ 279 278 -d $MZ_DELAY -t udp "sp=1024,dp=0-32768" 279 + sleep 1 280 280 281 281 t1_rp12=$(link_stats_tx_packets_get $rp12) 282 282 t1_rp13=$(link_stats_tx_packets_get $rp13)
+2
tools/testing/selftests/net/forwarding/router_mpath_nh_res.sh
··· 244 244 245 245 ip vrf exec vrf-h1 $MZ $h1 -q -p 64 -A 192.0.2.2 -B 198.51.100.2 \ 246 246 -d $MZ_DELAY -t udp "sp=1024,dp=0-32768" 247 + sleep 1 247 248 248 249 t1_rp12=$(link_stats_tx_packets_get $rp12) 249 250 t1_rp13=$(link_stats_tx_packets_get $rp13) ··· 275 274 276 275 $MZ $h1 -6 -q -p 64 -A 2001:db8:1::2 -B 2001:db8:2::2 \ 277 276 -d $MZ_DELAY -t udp "sp=1024,dp=0-32768" 277 + sleep 1 278 278 279 279 t1_rp12=$(link_stats_tx_packets_get $rp12) 280 280 t1_rp13=$(link_stats_tx_packets_get $rp13)
+2
tools/testing/selftests/net/forwarding/router_multipath.sh
··· 180 180 181 181 ip vrf exec vrf-h1 $MZ $h1 -q -p 64 -A 192.0.2.2 -B 198.51.100.2 \ 182 182 -d $MZ_DELAY -t udp "sp=1024,dp=0-32768" 183 + sleep 1 183 184 184 185 t1_rp12=$(link_stats_tx_packets_get $rp12) 185 186 t1_rp13=$(link_stats_tx_packets_get $rp13) ··· 218 217 219 218 $MZ $h1 -6 -q -p 64 -A 2001:db8:1::2 -B 2001:db8:2::2 \ 220 219 -d $MZ_DELAY -t udp "sp=1024,dp=0-32768" 220 + sleep 1 221 221 222 222 t1_rp12=$(link_stats_tx_packets_get $rp12) 223 223 t1_rp13=$(link_stats_tx_packets_get $rp13)