kernel_samsung_a53x/tools/testing/selftests/net
Amit Cohen 988bb5ed8f selftests: forwarding: devlink_lib: Wait for udev events after reloading
[ Upstream commit f67a90a0c8f5b3d0acc18f10650d90fec44775f9 ]

Lately, an additional locking was added by commit c0a40097f0bc
("drivers: core: synchronize really_probe() and dev_uevent()"). The
locking protects dev_uevent() calling. This function is used to send
messages from the kernel to user space. Uevent messages notify user space
about changes in device states, such as when a device is added, removed,
or changed. These messages are used by udev (or other similar user-space
tools) to apply device-specific rules.

After reloading devlink instance, udev events should be processed. This
locking causes a short delay of udev events handling.

One example for useful udev rule is renaming ports. 'forwading.config'
can be configured to use names after udev rules are applied. Some tests run
devlink_reload() and immediately use the updated names. This worked before
the above mentioned commit was pushed, but now the delay of uevent messages
causes that devlink_reload() returns before udev events are handled and
tests fail.

Adjust devlink_reload() to not assume that udev events are already
processed when devlink reload is done, instead, wait for udev events to
ensure they are processed before returning from the function.

Without this patch:
TESTS='rif_mac_profile' ./resource_scale.sh
TEST: 'rif_mac_profile' 4                                           [ OK ]
sysctl: cannot stat /proc/sys/net/ipv6/conf/swp1/disable_ipv6: No such file or directory
sysctl: cannot stat /proc/sys/net/ipv6/conf/swp1/disable_ipv6: No such file or directory
sysctl: cannot stat /proc/sys/net/ipv6/conf/swp2/disable_ipv6: No such file or directory
sysctl: cannot stat /proc/sys/net/ipv6/conf/swp2/disable_ipv6: No such file or directory
Cannot find device "swp1"
Cannot find device "swp2"
TEST: setup_wait_dev (: Interface swp1 does not come up.) [FAIL]

With this patch:
$ TESTS='rif_mac_profile' ./resource_scale.sh
TEST: 'rif_mac_profile' 4                                           [ OK ]
TEST: 'rif_mac_profile' overflow 5                                  [ OK ]

This is relevant not only for this test.

Fixes: bc7cbb1e9f4c ("selftests: forwarding: Add devlink_lib.sh")
Signed-off-by: Amit Cohen <amcohen@nvidia.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: Petr Machata <petrm@nvidia.com>
Link: https://patch.msgid.link/89367666e04b38a8993027f1526801ca327ab96a.1720709333.git.petrm@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-23 23:20:08 +01:00
..
forwarding selftests: forwarding: devlink_lib: Wait for udev events after reloading 2024-11-23 23:20:08 +01:00
mptcp selftests/net: mptcp: fix uninitialized variable warnings 2024-11-18 12:11:10 +01:00
altnames.sh Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
config Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
devlink_port_split.py Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
drop_monitor_tests.sh Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
fcnal-test.sh Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
fib-onlink-tests.sh Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
fib_nexthop_multiprefix.sh selftests/net: fix grep checking for fib_nexthop_multiprefix 2024-11-18 12:12:36 +01:00
fib_nexthops.sh Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
fib_rule_tests.sh Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
fib_tests.sh Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
fin_ack_lat.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
fin_ack_lat.sh Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hwtstamp_config.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
icmp_redirect.sh Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
in_netns.sh Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ip6_gre_headroom.sh Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ip_defrag.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ip_defrag.sh Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ipsec.c selftests/net: ipsec: fix constant out of range 2024-11-18 12:11:10 +01:00
ipv6_flowlabel.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ipv6_flowlabel.sh Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ipv6_flowlabel_mgr.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
l2tp.sh Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
msg_zerocopy.c selftests: make order checking verbose in msg_zerocopy selftest 2024-11-19 14:19:41 +01:00
msg_zerocopy.sh Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
netdevice.sh Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nettest.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pmtu.sh selftests: net: avoid just another constant wait 2024-11-18 12:13:24 +01:00
psock_fanout.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
psock_lib.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
psock_snd.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
psock_snd.sh Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
psock_tpacket.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
reuseaddr_conflict.c selftests: reuseaddr_conflict: add missing new line at the end of the output 2024-11-19 09:22:47 +01:00
reuseaddr_ports_exhausted.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
reuseaddr_ports_exhausted.sh Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
reuseport_addr_any.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
reuseport_addr_any.sh Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
reuseport_bpf.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
reuseport_bpf_cpu.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
reuseport_bpf_numa.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
reuseport_dualstack.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
route_localnet.sh Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rtnetlink.sh Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
run_afpackettests Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
run_netsocktests Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rxtimestamp.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rxtimestamp.sh Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
so_txtime.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
so_txtime.sh Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
socket.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tcp_fastopen_backup_key.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tcp_fastopen_backup_key.sh Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tcp_inq.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tcp_mmap.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
test_blackhole_dev.sh Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
test_bpf.sh Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
test_vxlan_fdb_changelink.sh Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
test_vxlan_under_vrf.sh Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
timestamping.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tls.c selftests: tls: use exact comparison in recv_partial 2024-11-19 08:44:35 +01:00
traceroute.sh Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
txring_overwrite.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
txtimestamp.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
txtimestamp.sh Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
udpgro.sh Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
udpgro_bench.sh Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
udpgso.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
udpgso.sh Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
udpgso_bench.sh Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
udpgso_bench_rx.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
udpgso_bench_tx.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
vrf-xfrm-tests.sh Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
vrf_route_leaking.sh Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
vrf_strict_mode_test.sh Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
xfrm_policy.sh Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00