Commit 4fc7885c authored by Jakub Kicinski's avatar Jakub Kicinski
Browse files

Merge branch 'mlx5e-misc-fixes-2025-07-23'

Tariq Toukan says:

====================
mlx5e misc fixes 2025-07-23

This small patchset provides misc bug fixes from the team to the mlx5e
driver.
====================

Link: https://patch.msgid.link/1753256672-337784-1-git-send-email-tariqt@nvidia.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents c8f13134 e80d6556
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -728,6 +728,7 @@ struct mlx5e_rq {
	struct xsk_buff_pool  *xsk_pool;

	struct work_struct     recover_work;
	struct work_struct     rx_timeout_work;

	/* control */
	struct mlx5_wq_ctrl    wq_ctrl;
+3 −0
Original line number Diff line number Diff line
@@ -331,6 +331,9 @@ static int port_set_buffer(struct mlx5e_priv *priv,
	if (err)
		goto out;

	/* RO bits should be set to 0 on write */
	MLX5_SET(pbmc_reg, in, port_buffer_size, 0);

	err = mlx5e_port_set_pbmc(mdev, in);
out:
	kfree(in);
+7 −0
Original line number Diff line number Diff line
@@ -170,16 +170,23 @@ static int mlx5e_rx_reporter_err_rq_cqe_recover(void *ctx)
static int mlx5e_rx_reporter_timeout_recover(void *ctx)
{
	struct mlx5_eq_comp *eq;
	struct mlx5e_priv *priv;
	struct mlx5e_rq *rq;
	int err;

	rq = ctx;
	priv = rq->priv;

	mutex_lock(&priv->state_lock);

	eq = rq->cq.mcq.eq;

	err = mlx5e_health_channel_eq_recover(rq->netdev, eq, rq->cq.ch_stats);
	if (err && rq->icosq)
		clear_bit(MLX5E_SQ_STATE_ENABLED, &rq->icosq->state);

	mutex_unlock(&priv->state_lock);

	return err;
}

+4 −0
Original line number Diff line number Diff line
@@ -327,6 +327,10 @@ void mlx5e_ipsec_offload_handle_rx_skb(struct net_device *netdev,
	if (unlikely(!sa_entry)) {
		rcu_read_unlock();
		atomic64_inc(&ipsec->sw_stats.ipsec_rx_drop_sadb_miss);
		/* Clear secpath to prevent invalid dereference
		 * in downstream XFRM policy checks.
		 */
		secpath_reset(skb);
		return;
	}
	xfrm_state_hold(sa_entry->x);
+25 −1
Original line number Diff line number Diff line
@@ -707,6 +707,27 @@ static void mlx5e_rq_err_cqe_work(struct work_struct *recover_work)
	mlx5e_reporter_rq_cqe_err(rq);
}

static void mlx5e_rq_timeout_work(struct work_struct *timeout_work)
{
	struct mlx5e_rq *rq = container_of(timeout_work,
					   struct mlx5e_rq,
					   rx_timeout_work);

	/* Acquire netdev instance lock to synchronize with channel close and
	 * reopen flows. Either successfully obtain the lock, or detect that
	 * channels are closing for another reason, making this work no longer
	 * necessary.
	 */
	while (!netdev_trylock(rq->netdev)) {
		if (!test_bit(MLX5E_STATE_CHANNELS_ACTIVE, &rq->priv->state))
			return;
		msleep(20);
	}

	mlx5e_reporter_rx_timeout(rq);
	netdev_unlock(rq->netdev);
}

static int mlx5e_alloc_mpwqe_rq_drop_page(struct mlx5e_rq *rq)
{
	rq->wqe_overflow.page = alloc_page(GFP_KERNEL);
@@ -830,6 +851,7 @@ static int mlx5e_alloc_rq(struct mlx5e_params *params,

	rqp->wq.db_numa_node = node;
	INIT_WORK(&rq->recover_work, mlx5e_rq_err_cqe_work);
	INIT_WORK(&rq->rx_timeout_work, mlx5e_rq_timeout_work);

	if (params->xdp_prog)
		bpf_prog_inc(params->xdp_prog);
@@ -1204,7 +1226,8 @@ int mlx5e_wait_for_min_rx_wqes(struct mlx5e_rq *rq, int wait_time)
	netdev_warn(rq->netdev, "Failed to get min RX wqes on Channel[%d] RQN[0x%x] wq cur_sz(%d) min_rx_wqes(%d)\n",
		    rq->ix, rq->rqn, mlx5e_rqwq_get_cur_sz(rq), min_wqes);

	mlx5e_reporter_rx_timeout(rq);
	queue_work(rq->priv->wq, &rq->rx_timeout_work);

	return -ETIMEDOUT;
}

@@ -1375,6 +1398,7 @@ void mlx5e_close_rq(struct mlx5e_rq *rq)
	if (rq->dim)
		cancel_work_sync(&rq->dim->work);
	cancel_work_sync(&rq->recover_work);
	cancel_work_sync(&rq->rx_timeout_work);
	mlx5e_destroy_rq(rq);
	mlx5e_free_rx_descs(rq);
	mlx5e_free_rq(rq);