Commit 50645610 authored by David S. Miller's avatar David S. Miller
Browse files

Merge tag 'mlx5-fixes-2023-02-24' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux

Saeed Mahemeed says:

====================
mlx5 fixes 2023-02-24

V1->V2:
 - Toss away arguably non-fixes patches

This series provides bug fixes for mlx5 driver.
Please pull and let me know if there is any problem.
====================
parents 25ff6f8a d28a06d7
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -98,4 +98,8 @@ void mlx5_ec_cleanup(struct mlx5_core_dev *dev)
	err = mlx5_wait_for_pages(dev, &dev->priv.page_counters[MLX5_HOST_PF]);
	if (err)
		mlx5_core_warn(dev, "Timeout reclaiming external host PF pages err(%d)\n", err);

	err = mlx5_wait_for_pages(dev, &dev->priv.page_counters[MLX5_VF]);
	if (err)
		mlx5_core_warn(dev, "Timeout reclaiming external host VFs pages err(%d)\n", err);
}
+22 −3
Original line number Diff line number Diff line
@@ -86,7 +86,19 @@ static bool mlx5e_ptp_ts_cqe_drop(struct mlx5e_ptpsq *ptpsq, u16 skb_cc, u16 skb
	return (ptpsq->ts_cqe_ctr_mask && (skb_cc != skb_id));
}

static void mlx5e_ptp_skb_fifo_ts_cqe_resync(struct mlx5e_ptpsq *ptpsq, u16 skb_cc, u16 skb_id)
static bool mlx5e_ptp_ts_cqe_ooo(struct mlx5e_ptpsq *ptpsq, u16 skb_id)
{
	u16 skb_cc = PTP_WQE_CTR2IDX(ptpsq->skb_fifo_cc);
	u16 skb_pc = PTP_WQE_CTR2IDX(ptpsq->skb_fifo_pc);

	if (PTP_WQE_CTR2IDX(skb_id - skb_cc) >= PTP_WQE_CTR2IDX(skb_pc - skb_cc))
		return true;

	return false;
}

static void mlx5e_ptp_skb_fifo_ts_cqe_resync(struct mlx5e_ptpsq *ptpsq, u16 skb_cc,
					     u16 skb_id, int budget)
{
	struct skb_shared_hwtstamps hwts = {};
	struct sk_buff *skb;
@@ -98,6 +110,7 @@ static void mlx5e_ptp_skb_fifo_ts_cqe_resync(struct mlx5e_ptpsq *ptpsq, u16 skb_
		hwts.hwtstamp = mlx5e_skb_cb_get_hwts(skb)->cqe_hwtstamp;
		skb_tstamp_tx(skb, &hwts);
		ptpsq->cq_stats->resync_cqe++;
		napi_consume_skb(skb, budget);
		skb_cc = PTP_WQE_CTR2IDX(ptpsq->skb_fifo_cc);
	}
}
@@ -118,8 +131,14 @@ static void mlx5e_ptp_handle_ts_cqe(struct mlx5e_ptpsq *ptpsq,
		goto out;
	}

	if (mlx5e_ptp_ts_cqe_drop(ptpsq, skb_cc, skb_id))
		mlx5e_ptp_skb_fifo_ts_cqe_resync(ptpsq, skb_cc, skb_id);
	if (mlx5e_ptp_ts_cqe_drop(ptpsq, skb_cc, skb_id)) {
		if (mlx5e_ptp_ts_cqe_ooo(ptpsq, skb_id)) {
			/* already handled by a previous resync */
			ptpsq->cq_stats->ooo_cqe_drop++;
			return;
		}
		mlx5e_ptp_skb_fifo_ts_cqe_resync(ptpsq, skb_cc, skb_id, budget);
	}

	skb = mlx5e_skb_fifo_pop(&ptpsq->skb_fifo);
	hwtstamp = mlx5e_cqe_ts_to_ns(sq->ptp_cyc2time, sq->clock, get_cqe_ts(cqe));
+1 −2
Original line number Diff line number Diff line
@@ -710,7 +710,6 @@ void mlx5e_rep_tc_receive(struct mlx5_cqe64 *cqe, struct mlx5e_rq *rq,
	else
		napi_gro_receive(rq->cq.napi, skb);

	if (tc_priv.fwd_dev)
	dev_put(tc_priv.fwd_dev);

	return;
+1 −1
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@ mlx5e_tc_act_stats_create(void)
	int err;

	handle = kvzalloc(sizeof(*handle), GFP_KERNEL);
	if (IS_ERR(handle))
	if (!handle)
		return ERR_PTR(-ENOMEM);

	err = rhashtable_init(&handle->ht, &act_counters_ht_params);
+3 −1
Original line number Diff line number Diff line
@@ -86,7 +86,7 @@ void mlx5e_free_txqsq_descs(struct mlx5e_txqsq *sq);
static inline bool
mlx5e_skb_fifo_has_room(struct mlx5e_skb_fifo *fifo)
{
	return (*fifo->pc - *fifo->cc) < fifo->mask;
	return (u16)(*fifo->pc - *fifo->cc) < fifo->mask;
}

static inline bool
@@ -302,6 +302,8 @@ void mlx5e_skb_fifo_push(struct mlx5e_skb_fifo *fifo, struct sk_buff *skb)
static inline
struct sk_buff *mlx5e_skb_fifo_pop(struct mlx5e_skb_fifo *fifo)
{
	WARN_ON_ONCE(*fifo->pc == *fifo->cc);

	return *mlx5e_skb_fifo_get(fifo, (*fifo->cc)++);
}

Loading