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

selftests: mlxsw: rtnetlink: Use devlink_reload() API

The test runs "devlink reload" explicitly. Instead, it is better to use
devlink_reload() which waits for udev events to be processed. Do not sleep
after reload, as devlink_reload() blocks until all the netdevs are renamed.

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/844509e3057b65277a7181a23c95b71ec95e8a56.1727706741.git.petrm@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Amit Cohen and committed by
Jakub Kicinski
be4e3235 25ba2a5a

+2 -8
+2 -8
tools/testing/selftests/drivers/net/mlxsw/rtnetlink.sh
··· 186 186 187 187 # If we did not handle references correctly, then this should produce a 188 188 # trace 189 - devlink dev reload "$DEVLINK_DEV" 190 - 191 - # Allow netdevices to be re-created following the reload 192 - sleep 20 189 + devlink_reload 193 190 194 191 log_test "bridge vlan flags" 195 192 } ··· 920 923 # devlink reload can be performed without errors 921 924 RET=0 922 925 923 - devlink dev reload "$DEVLINK_DEV" 924 - check_err $? "devlink reload failed" 926 + devlink_reload 925 927 926 928 log_test "devlink reload - last test" 927 - 928 - sleep 20 929 929 } 930 930 931 931 trap cleanup EXIT