Skip to content

Commit

Permalink
net/mlx5e: Acquire RTNL lock before RQs/SQs activation/deactivation
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
cjubran authored and kuba-moo committed Apr 13, 2024
1 parent 6c685bd commit fdce06b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,10 @@ static int mlx5e_tx_reporter_err_cqe_recover(void *ctx)
mlx5e_reset_txqsq_cc_pc(sq);
sq->stats->recover++;
clear_bit(MLX5E_SQ_STATE_RECOVERING, &sq->state);
rtnl_lock();
mlx5e_activate_txqsq(sq);
rtnl_unlock();

if (sq->channel)
mlx5e_trigger_napi_icosq(sq->channel);
else
Expand Down Expand Up @@ -179,12 +182,16 @@ static int mlx5e_tx_reporter_ptpsq_unhealthy_recover(void *ctx)
carrier_ok = netif_carrier_ok(netdev);
netif_carrier_off(netdev);

rtnl_lock();
mlx5e_deactivate_priv_channels(priv);
rtnl_unlock();

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

rtnl_lock();
mlx5e_activate_priv_channels(priv);
rtnl_unlock();

/* return carrier back if needed */
if (carrier_ok)
Expand Down

0 comments on commit fdce06b

Please sign in to comment.