From: Alexander Kozyrev Date: Mon, 16 Nov 2020 19:48:15 +0000 (+0000) Subject: net/mlx5: fix WQE counter assert in free completion queue X-Git-Url: http://git.droids-corp.org/?p=dpdk.git;a=commitdiff_plain;h=af01eeb755b48209fa7e17266afa920d53387572 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: 0afacb04f506 ("common/mlx5: remove NDEBUG") Cc: stable@dpdk.org Signed-off-by: Alexander Kozyrev Acked-by: Viacheslav Ovsiienko --- diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c index 2ecf901fb1..d12d746c2f 100644 --- a/drivers/net/mlx5/mlx5_rxtx.c +++ b/drivers/net/mlx5/mlx5_rxtx.c @@ -2113,8 +2113,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;