Skip to content

Commit fdce06b

Browse files
cjubrankuba-moo
authored andcommitted
net/mlx5e: Acquire RTNL lock before RQs/SQs activation/deactivation
netif_queue_set_napi asserts whether RTNL lock is held if the netdev is initialized. Acquire the RTNL lock before activating or deactivating RQs/SQs if the lock has not been held before in the flow. Fixes: f25e7b8 ("net/mlx5e: link NAPI instances to queues and IRQs") Cc: Joe Damato <[email protected]> Signed-off-by: Carolina Jubran <[email protected]> Reviewed-by: Rahul Rameshbabu <[email protected]> Signed-off-by: Tariq Toukan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 6c685bd commit fdce06b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,10 @@ static int mlx5e_tx_reporter_err_cqe_recover(void *ctx)
108108
mlx5e_reset_txqsq_cc_pc(sq);
109109
sq->stats->recover++;
110110
clear_bit(MLX5E_SQ_STATE_RECOVERING, &sq->state);
111+
rtnl_lock();
111112
mlx5e_activate_txqsq(sq);
113+
rtnl_unlock();
114+
112115
if (sq->channel)
113116
mlx5e_trigger_napi_icosq(sq->channel);
114117
else
@@ -179,12 +182,16 @@ static int mlx5e_tx_reporter_ptpsq_unhealthy_recover(void *ctx)
179182
carrier_ok = netif_carrier_ok(netdev);
180183
netif_carrier_off(netdev);
181184

185+
rtnl_lock();
182186
mlx5e_deactivate_priv_channels(priv);
187+
rtnl_unlock();
183188

184189
mlx5e_ptp_close(chs->ptp);
185190
err = mlx5e_ptp_open(priv, &chs->params, chs->c[0]->lag_port, &chs->ptp);
186191

192+
rtnl_lock();
187193
mlx5e_activate_priv_channels(priv);
194+
rtnl_unlock();
188195

189196
/* return carrier back if needed */
190197
if (carrier_ok)

0 commit comments

Comments
 (0)