Skip to contentSkip to conversation

net/mlx5: fix WQE counter assert in free completion queue

PATCH In review Alexander Kozyrev 2 participants 2 messages Nov 16, 2020 – Nov 17, 2020 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/mlx5: fix WQE counter assert in free completion queue

The following assertion fails in case RTE_ENABLE_ASSERT is enabled:
PANIC in mlx5_tx_handle_completion():
assert "(txq->fcqs[txq->cq_ci & txq->cqe_m] >> 16)

	== cqe->wqe_counter" failed

The free completion queue only contains an expected WQE counter if RTE_LIBRTE_MLX5_DEBUG is enabled as well. Thus enabling RTE_ENABLE_ASSERT alone causes the assert to fail.

Compile the assert conditionally only if RTE_ENABLE_ASSERT is enabled.

Fixes 0afacb04f5 ("common/mlx5: remove NDEBUG")
---
 drivers/net/mlx5/mlx5_rxtx.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/mlx5/mlx5_rxtx.c +2 -0
index 844a1c633d..c185c40666 100644
@@ -2106,8 +2106,10 @@ mlx5_tx_handle_completion(struct mlx5_txq_data *__rte_restrict txq,
 		}
 		/* Normal transmit completion. */
 		MLX5_ASSERT(txq->cq_ci != txq->cq_pi);
+#ifdef RTE_LIBRTE_MLX5_DEBUG
 		MLX5_ASSERT((txq->fcqs[txq->cq_ci & txq->cqe_m] >> 16) ==
 			    cqe->wqe_counter);
+#endif
 		ring_doorbell = true;
 		++txq->cq_ci;
 		last_cqe = cqe;
Signature · 1 line
2.24.1
#1 lore raw

Hi,

Quoted 17 lines

-----Original Message-----
From: Alexander Kozyrev <[email protected]>
Sent: Monday, November 16, 2020 9:48 PM
To: [email protected]
Cc: [email protected]; Raslan Darawsheh <[email protected]>; Slava Ovsiienko <[email protected]>; Matan Azrad <[email protected]>
Subject: [PATCH] net/mlx5: fix WQE counter assert in free completion queue

The following assertion fails in case RTE_ENABLE_ASSERT is enabled:
PANIC in mlx5_tx_handle_completion():
assert "(txq->fcqs[txq->cq_ci & txq->cqe_m] >> 16)

	== cqe->wqe_counter" failed

The free completion queue only contains an expected WQE counter if RTE_LIBRTE_MLX5_DEBUG is enabled as well. Thus enabling RTE_ENABLE_ASSERT alone causes the assert to fail.

Quoted 8 lines

Compile the assert conditionally only if RTE_ENABLE_ASSERT is enabled.

Fixes 0afacb04f5 ("common/mlx5: remove NDEBUG")

---

Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh