Skip to content

Commit

Permalink
drivers: ignore non-critical syndromes for Tx queues
Browse files Browse the repository at this point in the history
Only 3 syndromes are considered critical and warrant a queue restart.
All other syndromes can be safely ignored. We ignore them for Rx queues.
Skip non-critical error CQEs for Tx queues as well.

Fixes: 957e45f ("net/mlx5: handle Tx completion with error")
Cc: stable@dpdk.org

Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
Signed-off-by: 0-day Robot <robot@bytheb.org>
  • Loading branch information
aleks-kozyrev authored and ovsrobot committed May 2, 2023
1 parent d034467 commit 6259bc5
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
17 changes: 17 additions & 0 deletions drivers/common/mlx5/mlx5_prm.h
Original file line number Diff line number Diff line change
Expand Up @@ -5238,4 +5238,21 @@ mlx5_ts_format_conv(uint32_t ts_format)
MLX5_QPC_TIMESTAMP_FORMAT_DEFAULT;
}

/**
* Check if an error CQE syndrome is critical.
*
* @param syndrome
* Error CQE syndrome to check.
*
* @return
* Positive value if critical, 0 otherwise.
*/
static inline uint32_t
mlx5_critical_syndrome(uint8_t syndrome)
{
return (syndrome == MLX5_CQE_SYNDROME_LOCAL_QP_OP_ERR ||
syndrome == MLX5_CQE_SYNDROME_LOCAL_PROT_ERR ||
syndrome == MLX5_CQE_SYNDROME_WR_FLUSH_ERR);
}

#endif /* RTE_PMD_MLX5_PRM_H_ */
4 changes: 1 addition & 3 deletions drivers/net/mlx5/mlx5_rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -479,9 +479,7 @@ mlx5_rx_err_handle(struct mlx5_rxq_data *rxq, uint8_t vec,
for (i = 0; i < (int)err_n; i++) {
u.cqe = &(*rxq->cqes)[(rxq->cq_ci - vec - i) & cqe_mask];
if (MLX5_CQE_OPCODE(u.cqe->op_own) == MLX5_CQE_RESP_ERR) {
if (u.err_cqe->syndrome == MLX5_CQE_SYNDROME_LOCAL_QP_OP_ERR ||
u.err_cqe->syndrome == MLX5_CQE_SYNDROME_LOCAL_PROT_ERR ||
u.err_cqe->syndrome == MLX5_CQE_SYNDROME_WR_FLUSH_ERR)
if (mlx5_critical_syndrome(u.err_cqe->syndrome))
critical_syndrome = true;
break;
}
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/mlx5/mlx5_tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ static int
mlx5_tx_error_cqe_handle(struct mlx5_txq_data *__rte_restrict txq,
volatile struct mlx5_err_cqe *err_cqe)
{
if (err_cqe->syndrome != MLX5_CQE_SYNDROME_WR_FLUSH_ERR) {
if (mlx5_critical_syndrome(err_cqe->syndrome)) {
const uint16_t wqe_m = ((1 << txq->wqe_n) - 1);
struct mlx5_txq_ctrl *txq_ctrl =
container_of(txq, struct mlx5_txq_ctrl, txq);
Expand Down Expand Up @@ -217,7 +217,7 @@ mlx5_tx_handle_completion(struct mlx5_txq_data *__rte_restrict txq,
}
/*
* We are going to fetch all entries with
* MLX5_CQE_SYNDROME_WR_FLUSH_ERR status.
* non-critical error syndromes.
* The send queue is supposed to be empty.
*/
ring_doorbell = true;
Expand Down

0 comments on commit 6259bc5

Please sign in to comment.