patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Alexander Kozyrev <akozyrev@nvidia.com>
To: <dev@dpdk.org>
Cc: <stable@dpdk.org>, <rasland@nvidia.com>, <viacheslavo@nvidia.com>,
	<matan@nvidia.com>, <stephen@networkplumber.org>
Subject: [PATCH v2] drivers: ignore non-critical syndromes for Tx queues
Date: Thu, 3 Oct 2024 23:28:15 +0300	[thread overview]
Message-ID: <20241003202815.870524-1-akozyrev@nvidia.com> (raw)
In-Reply-To: <20230502185047.3250224-1-akozyrev@nvidia.com>

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: 957e45fb7b ("net/mlx5: handle Tx completion with error")
Cc: stable@dpdk.org

Signed-off-by: Alexander Kozyrev <akozyrev@nvidia.com>
---
 drivers/common/mlx5/mlx5_prm.h | 17 +++++++++++++++++
 drivers/net/mlx5/mlx5_rx.c     |  4 +---
 drivers/net/mlx5/mlx5_tx.c     |  4 ++--
 3 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/drivers/common/mlx5/mlx5_prm.h b/drivers/common/mlx5/mlx5_prm.h
index 210158350d..e4034699d8 100644
--- a/drivers/common/mlx5/mlx5_prm.h
+++ b/drivers/common/mlx5/mlx5_prm.h
@@ -5614,4 +5614,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_ */
diff --git a/drivers/net/mlx5/mlx5_rx.c b/drivers/net/mlx5/mlx5_rx.c
index 5e58eb8bc9..a562daa7c3 100644
--- a/drivers/net/mlx5/mlx5_rx.c
+++ b/drivers/net/mlx5/mlx5_rx.c
@@ -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;
 			}
diff --git a/drivers/net/mlx5/mlx5_tx.c b/drivers/net/mlx5/mlx5_tx.c
index 2f48bbc82e..2c53feeb9c 100644
--- a/drivers/net/mlx5/mlx5_tx.c
+++ b/drivers/net/mlx5/mlx5_tx.c
@@ -85,7 +85,7 @@ static int
 mlx5_tx_error_cqe_handle(struct mlx5_txq_data *__rte_restrict txq,
 			 volatile struct mlx5_error_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);
@@ -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;
-- 
2.18.2


      parent reply	other threads:[~2024-10-03 20:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-02 18:50 [PATCH] " Alexander Kozyrev
2024-10-03 19:02 ` Stephen Hemminger
2024-10-03 20:28 ` Alexander Kozyrev [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241003202815.870524-1-akozyrev@nvidia.com \
    --to=akozyrev@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=matan@nvidia.com \
    --cc=rasland@nvidia.com \
    --cc=stable@dpdk.org \
    --cc=stephen@networkplumber.org \
    --cc=viacheslavo@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).