Skip to content

Commit 5dd29f4

Browse files
gal-pressmanSaeed Mahameed
authored andcommitted
net/mlx5e: Add recovery flow in case of error CQE
The rep legacy RQ completion handling was missing the appropriate handling of error CQEs (dump the CQE and queue a recover work), fix it by calling trigger_report() when needed. Since all CQE handling flows do the exact same error CQE handling, extract it to a common helper function. Signed-off-by: Gal Pressman <[email protected]> Reviewed-by: Aya Levin <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent 68511b4 commit 5dd29f4

File tree

1 file changed

+11
-9
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core

1 file changed

+11
-9
lines changed

drivers/net/ethernet/mellanox/mlx5/core/en_rx.c

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1603,6 +1603,12 @@ static void trigger_report(struct mlx5e_rq *rq, struct mlx5_cqe64 *cqe)
16031603
}
16041604
}
16051605

1606+
static void mlx5e_handle_rx_err_cqe(struct mlx5e_rq *rq, struct mlx5_cqe64 *cqe)
1607+
{
1608+
trigger_report(rq, cqe);
1609+
rq->stats->wqe_err++;
1610+
}
1611+
16061612
static void mlx5e_handle_rx_cqe(struct mlx5e_rq *rq, struct mlx5_cqe64 *cqe)
16071613
{
16081614
struct mlx5_wq_cyc *wq = &rq->wqe.wq;
@@ -1616,8 +1622,7 @@ static void mlx5e_handle_rx_cqe(struct mlx5e_rq *rq, struct mlx5_cqe64 *cqe)
16161622
cqe_bcnt = be32_to_cpu(cqe->byte_cnt);
16171623

16181624
if (unlikely(MLX5E_RX_ERR_CQE(cqe))) {
1619-
trigger_report(rq, cqe);
1620-
rq->stats->wqe_err++;
1625+
mlx5e_handle_rx_err_cqe(rq, cqe);
16211626
goto free_wqe;
16221627
}
16231628

@@ -1670,7 +1675,7 @@ static void mlx5e_handle_rx_cqe_rep(struct mlx5e_rq *rq, struct mlx5_cqe64 *cqe)
16701675
cqe_bcnt = be32_to_cpu(cqe->byte_cnt);
16711676

16721677
if (unlikely(MLX5E_RX_ERR_CQE(cqe))) {
1673-
rq->stats->wqe_err++;
1678+
mlx5e_handle_rx_err_cqe(rq, cqe);
16741679
goto free_wqe;
16751680
}
16761681

@@ -1719,8 +1724,7 @@ static void mlx5e_handle_rx_cqe_mpwrq_rep(struct mlx5e_rq *rq, struct mlx5_cqe64
17191724
wi->consumed_strides += cstrides;
17201725

17211726
if (unlikely(MLX5E_RX_ERR_CQE(cqe))) {
1722-
trigger_report(rq, cqe);
1723-
rq->stats->wqe_err++;
1727+
mlx5e_handle_rx_err_cqe(rq, cqe);
17241728
goto mpwrq_cqe_out;
17251729
}
17261730

@@ -1988,8 +1992,7 @@ static void mlx5e_handle_rx_cqe_mpwrq_shampo(struct mlx5e_rq *rq, struct mlx5_cq
19881992
wi->consumed_strides += cstrides;
19891993

19901994
if (unlikely(MLX5E_RX_ERR_CQE(cqe))) {
1991-
trigger_report(rq, cqe);
1992-
stats->wqe_err++;
1995+
mlx5e_handle_rx_err_cqe(rq, cqe);
19931996
goto mpwrq_cqe_out;
19941997
}
19951998

@@ -2058,8 +2061,7 @@ static void mlx5e_handle_rx_cqe_mpwrq(struct mlx5e_rq *rq, struct mlx5_cqe64 *cq
20582061
wi->consumed_strides += cstrides;
20592062

20602063
if (unlikely(MLX5E_RX_ERR_CQE(cqe))) {
2061-
trigger_report(rq, cqe);
2062-
rq->stats->wqe_err++;
2064+
mlx5e_handle_rx_err_cqe(rq, cqe);
20632065
goto mpwrq_cqe_out;
20642066
}
20652067

0 commit comments

Comments
 (0)