diff mbox series

[net-next] selftests: mlxsw: rtnetlink: Use devlink_reload() API

Message ID 844509e3057b65277a7181a23c95b71ec95e8a56.1727706741.git.petrm@nvidia.com
State New
Headers show
Series [net-next] selftests: mlxsw: rtnetlink: Use devlink_reload() API | expand

Commit Message

Petr Machata Sept. 30, 2024, 3:12 p.m. UTC
From: Amit Cohen <amcohen@nvidia.com>

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>
---
 tools/testing/selftests/drivers/net/mlxsw/rtnetlink.sh | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

Comments

patchwork-bot+netdevbpf@kernel.org Oct. 4, 2024, midnight UTC | #1
Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Mon, 30 Sep 2024 17:12:50 +0200 you wrote:
> From: Amit Cohen <amcohen@nvidia.com>
> 
> 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>
> 
> [...]

Here is the summary with links:
  - [net-next] selftests: mlxsw: rtnetlink: Use devlink_reload() API
    https://git.kernel.org/netdev/net-next/c/be4e32354457

You are awesome, thank you!
diff mbox series

Patch

diff --git a/tools/testing/selftests/drivers/net/mlxsw/rtnetlink.sh b/tools/testing/selftests/drivers/net/mlxsw/rtnetlink.sh
index 893a693ad805..45a569618424 100755
--- a/tools/testing/selftests/drivers/net/mlxsw/rtnetlink.sh
+++ b/tools/testing/selftests/drivers/net/mlxsw/rtnetlink.sh
@@ -186,10 +186,7 @@  bridge_vlan_flags_test()
 
 	# If we did not handle references correctly, then this should produce a
 	# trace
-	devlink dev reload "$DEVLINK_DEV"
-
-	# Allow netdevices to be re-created following the reload
-	sleep 20
+	devlink_reload
 
 	log_test "bridge vlan flags"
 }
@@ -923,12 +920,9 @@  devlink_reload_test()
 	# devlink reload can be performed without errors
 	RET=0
 
-	devlink dev reload "$DEVLINK_DEV"
-	check_err $? "devlink reload failed"
+	devlink_reload
 
 	log_test "devlink reload - last test"
-
-	sleep 20
 }
 
 trap cleanup EXIT