From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 87AA0A04DD; Mon, 16 Nov 2020 20:48:23 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 94EC72BAB; Mon, 16 Nov 2020 20:48:20 +0100 (CET) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id B21E0F90 for ; Mon, 16 Nov 2020 20:48:18 +0100 (CET) Received: from Internal Mail-Server by MTLPINE1 (envelope-from akozyrev@nvidia.com) with SMTP; 16 Nov 2020 21:48:16 +0200 Received: from nvidia.com (pegasus02.mtr.labs.mlnx [10.210.16.122]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 0AGJmGup001882; Mon, 16 Nov 2020 21:48:16 +0200 From: Alexander Kozyrev To: dev@dpdk.org Cc: stable@dpdk.org, rasland@nvidia.com, viacheslavo@nvidia.com, matan@nvidia.com Date: Mon, 16 Nov 2020 19:48:15 +0000 Message-Id: <20201116194815.29712-1-akozyrev@nvidia.com> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH] net/mlx5: fix WQE counter assert in free completion queue X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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") Cc: stable@dpdk.org Signed-off-by: Alexander Kozyrev Acked-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5_rxtx.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c index 844a1c633d..c185c40666 100644 --- a/drivers/net/mlx5/mlx5_rxtx.c +++ b/drivers/net/mlx5/mlx5_rxtx.c @@ -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; -- 2.24.1