Re: [PATCH net-next 2/6] net/mlx5e: Use regular ICOSQ for triggering NAPI

From: Jakub Kicinski

Date: Fri Nov 14 2025 - 21:53:46 EST


On Wed, 12 Nov 2025 11:29:05 +0200 Tariq Toukan wrote:
> +static inline enum mlx5e_lock_type
> +mlx5e_icosq_sync_lock(struct mlx5e_icosq *sq)
> +{
> + if (!test_bit(MLX5E_SQ_STATE_LOCK_NEEDED, &sq->state))
> + return MLX5E_LOCK_TYPE_NONE;
> +
> + if (in_softirq()) {
> + spin_lock(&sq->lock);
> + return MLX5E_LOCK_TYPE_SOFTIRQ;
> + }
> +
> + spin_lock_bh(&sq->lock);
> + return MLX5E_LOCK_TYPE_BH;
> +}

Conditional locking complicates code a lot. Very odd to see it in
a series which is about improving performance of the control path.

Could you please provide some data to justify this construct?

The in_softirq() optimization is a hard no, pretty sure core
maintainers complained about drivers containing context-conditional
code in the past.

The rest LGTM, FWIW I think the XDP redir behavior changes is fine.
--
pw-bot: cr