Skip to contentSkip to conversation

net/mlx5e: Stop asserting for RTNL when closing channels

PATCH Applied Tariq Toukan 4 participants 4 messages Oct 20 – Oct 22

Subsystems (5)
lore
Share & tools
lore

Tariq Toukan

author maintainer
#0 lore raw

PATCH 1/1 net/mlx5e: Stop asserting for RTNL when closing channels

From: Cosmin Ratiu <[email protected]>

mlx5e_close_channels() has an ASSERT_RTNL() from the time when RTNL was required for closing channels.
But the driver has been switched to using the netdev lock a while back, and this fired from a flow which was forgotten during the conversion:

mlx5e_tx_timeout_work()
-> mlx5e_reporter_tx_timeout()
-> mlx5e_health_report()
-> mlx5e_tx_reporter_timeout_recover()
-> mlx5e_safe_reopen_channels()
-> mlx5e_safe_switch_params()
-> mlx5e_close_channels()

The RTNL is not acquired here, but the netdev lock is, and it is enough.

Rather than switching to netdev_assert_locked(), simply drop the assert. Upper layers (networking core, ethtool core) provide locking and lower layers (NAPI helpers) assert that the netdev lock is held.

Fixes 8f7b00307bf1 ("net/mlx5e: Convert mlx5 netdevs to instance locking")
---
 drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 1 -
 1 file changed, 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/en_main.c +0 -1
index 4c6060d54fbe..38ce7d0a9001 100644
@@ -3075,7 +3075,6 @@ void mlx5e_close_channels(struct mlx5e_channels *chs)
 {
 	int i;
 
-	ASSERT_RTNL();
 	if (chs->ptp) {
 		mlx5e_ptp_close(chs->ptp);
 		chs->ptp = NULL;

base-commit: b6ef0d965fe8ce0ee4b4dcb58b3511f83003e42d

Signature · 1 line
2.44.0
#1 lore raw
Sashiko has reviewed this patch and found no issues.
Quoted 17 lines

From: Cosmin Ratiu <[email protected]>

mlx5e_close_channels() has an ASSERT_RTNL() from the time when RTNL was required for closing channels.
But the driver has been switched to using the netdev lock a while back, and this fired from a flow which was forgotten during the conversion:

mlx5e_tx_timeout_work()
-> mlx5e_reporter_tx_timeout()
-> mlx5e_health_report()
-> mlx5e_tx_reporter_timeout_recover()
-> mlx5e_safe_reopen_channels()
-> mlx5e_safe_switch_params()
-> mlx5e_close_channels()

The RTNL is not acquired here, but the netdev lock is, and it is enough.

Quoted 8 lines

Rather than switching to netdev_assert_locked(), simply drop the assert. Upper layers (networking core, ethtool core) provide locking and lower layers (NAPI helpers) assert that the netdev lock is held.

Fixes 8f7b00307bf1 ("net/mlx5e: Convert mlx5 netdevs to instance locking")

Sashiko has reviewed this patch and found no issues.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Acked-by on v1 1/1
#2 lore raw
In reply to Tariq Toukan
Quoted 17 lines · Tariq Toukan

From: Cosmin Ratiu <[email protected]>

mlx5e_close_channels() has an ASSERT_RTNL() from the time when RTNL was required for closing channels.
But the driver has been switched to using the netdev lock a while back, and this fired from a flow which was forgotten during the conversion:

mlx5e_tx_timeout_work()
-> mlx5e_reporter_tx_timeout()
-> mlx5e_health_report()
-> mlx5e_tx_reporter_timeout_recover()
-> mlx5e_safe_reopen_channels()
-> mlx5e_safe_switch_params()
-> mlx5e_close_channels()

The RTNL is not acquired here, but the netdev lock is, and it is enough.

Quoted 8 lines

Rather than switching to netdev_assert_locked(), simply drop the assert. Upper layers (networking core, ethtool core) provide locking and lower layers (NAPI helpers) assert that the netdev lock is held.

Fixes 8f7b00307bf1 ("net/mlx5e: Convert mlx5 netdevs to instance locking")
#3 lore raw
In reply to Tariq Toukan
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:

Quoted 8 lines · On Tue, 20 Oct 2026 18:36:59 +0300 you wrote:

From: Cosmin Ratiu <[email protected]>

mlx5e_close_channels() has an ASSERT_RTNL() from the time when RTNL was required for closing channels.
But the driver has been switched to using the netdev lock a while back, and this fired from a flow which was forgotten during the conversion:

[...]

Here is the summary with links:
- [net] net/mlx5e: Stop asserting for RTNL when closing channels

    https://git.kernel.org/netdev/net/c/e0a958ddfc89

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html