Skip to content

Commit e239c6d

Browse files
ayalevin123Saeed Mahameed
authored andcommitted
net/mlx5e: Fix ICOSQ recovery flow with Striding RQ
In striding RQ mode, the buffers of an RX WQE are first prepared and posted to the HW using a UMR WQEs via the ICOSQ. We maintain the state of these in-progress WQEs in the RQ SW struct. In the flow of ICOSQ recovery, the corresponding RQ is not in error state, hence: - The buffers of the in-progress WQEs must be released and the RQ metadata should reflect it. - Existing RX WQEs in the RQ should not be affected. For this, wrap the dealloc of the in-progress WQEs in a function, and use it in the ICOSQ recovery flow instead of mlx5e_free_rx_descs(). Fixes: be5323c ("net/mlx5e: Report and recover from CQE error on ICOSQ") Signed-off-by: Aya Levin <[email protected]> Reviewed-by: Tariq Toukan <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent 39369fd commit e239c6d

File tree

3 files changed

+26
-8
lines changed

3 files changed

+26
-8
lines changed

drivers/net/ethernet/mellanox/mlx5/core/en.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,6 +1060,7 @@ int mlx5e_modify_rq_state(struct mlx5e_rq *rq, int curr_state, int next_state);
10601060
void mlx5e_activate_rq(struct mlx5e_rq *rq);
10611061
void mlx5e_deactivate_rq(struct mlx5e_rq *rq);
10621062
void mlx5e_free_rx_descs(struct mlx5e_rq *rq);
1063+
void mlx5e_free_rx_in_progress_descs(struct mlx5e_rq *rq);
10631064
void mlx5e_activate_icosq(struct mlx5e_icosq *icosq);
10641065
void mlx5e_deactivate_icosq(struct mlx5e_icosq *icosq);
10651066

drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ static int mlx5e_rx_reporter_err_icosq_cqe_recover(void *ctx)
9090
goto out;
9191

9292
mlx5e_reset_icosq_cc_pc(icosq);
93-
mlx5e_free_rx_descs(rq);
93+
mlx5e_free_rx_in_progress_descs(rq);
9494
clear_bit(MLX5E_SQ_STATE_RECOVERING, &icosq->state);
9595
mlx5e_activate_icosq(icosq);
9696
mlx5e_activate_rq(rq);

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

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -813,21 +813,38 @@ int mlx5e_wait_for_min_rx_wqes(struct mlx5e_rq *rq, int wait_time)
813813
return -ETIMEDOUT;
814814
}
815815

816+
void mlx5e_free_rx_in_progress_descs(struct mlx5e_rq *rq)
817+
{
818+
struct mlx5_wq_ll *wq;
819+
u16 head;
820+
int i;
821+
822+
if (rq->wq_type != MLX5_WQ_TYPE_LINKED_LIST_STRIDING_RQ)
823+
return;
824+
825+
wq = &rq->mpwqe.wq;
826+
head = wq->head;
827+
828+
/* Outstanding UMR WQEs (in progress) start at wq->head */
829+
for (i = 0; i < rq->mpwqe.umr_in_progress; i++) {
830+
rq->dealloc_wqe(rq, head);
831+
head = mlx5_wq_ll_get_wqe_next_ix(wq, head);
832+
}
833+
834+
rq->mpwqe.actual_wq_head = wq->head;
835+
rq->mpwqe.umr_in_progress = 0;
836+
rq->mpwqe.umr_completed = 0;
837+
}
838+
816839
void mlx5e_free_rx_descs(struct mlx5e_rq *rq)
817840
{
818841
__be16 wqe_ix_be;
819842
u16 wqe_ix;
820843

821844
if (rq->wq_type == MLX5_WQ_TYPE_LINKED_LIST_STRIDING_RQ) {
822845
struct mlx5_wq_ll *wq = &rq->mpwqe.wq;
823-
u16 head = wq->head;
824-
int i;
825846

826-
/* Outstanding UMR WQEs (in progress) start at wq->head */
827-
for (i = 0; i < rq->mpwqe.umr_in_progress; i++) {
828-
rq->dealloc_wqe(rq, head);
829-
head = mlx5_wq_ll_get_wqe_next_ix(wq, head);
830-
}
847+
mlx5e_free_rx_in_progress_descs(rq);
831848

832849
while (!mlx5_wq_ll_is_empty(wq)) {
833850
struct mlx5e_rx_wqe_ll *wqe;

0 commit comments

Comments
 (0)