From: Matan Azrad Date: Wed, 20 Nov 2019 09:21:16 +0000 (+0000) Subject: net/mlx5: fix Rx queue release assertions X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=e7f4fbb30153702438e7b776eb05966caefc2c77;p=dpdk.git net/mlx5: fix Rx queue release assertions In debug mode, there is assertion to validate the CQ object before the release. Wrongly, the assertion is done for any type of RX queue even if it doesn't use CQ at all, for example in hairpin Rx queue. Ignore CQ assertion when hairpin queue is released. Fixes: e79c9be91515 ("net/mlx5: support Rx hairpin queues") Signed-off-by: Matan Azrad Acked-by: Ori Kam --- diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c index 2a12d5fa34..986ec016df 100644 --- a/drivers/net/mlx5/mlx5_rxq.c +++ b/drivers/net/mlx5/mlx5_rxq.c @@ -671,23 +671,25 @@ static int mlx5_rxq_obj_release(struct mlx5_rxq_obj *rxq_obj) { assert(rxq_obj); - if (rxq_obj->type == MLX5_RXQ_OBJ_TYPE_IBV) - assert(rxq_obj->wq); - assert(rxq_obj->cq); if (rte_atomic32_dec_and_test(&rxq_obj->refcnt)) { switch (rxq_obj->type) { case MLX5_RXQ_OBJ_TYPE_IBV: + assert(rxq_obj->wq); + assert(rxq_obj->cq); rxq_free_elts(rxq_obj->rxq_ctrl); claim_zero(mlx5_glue->destroy_wq(rxq_obj->wq)); claim_zero(mlx5_glue->destroy_cq(rxq_obj->cq)); break; case MLX5_RXQ_OBJ_TYPE_DEVX_RQ: + assert(rxq_obj->cq); + assert(rxq_obj->rq); rxq_free_elts(rxq_obj->rxq_ctrl); claim_zero(mlx5_devx_cmd_destroy(rxq_obj->rq)); rxq_release_rq_resources(rxq_obj->rxq_ctrl); claim_zero(mlx5_glue->destroy_cq(rxq_obj->cq)); break; case MLX5_RXQ_OBJ_TYPE_DEVX_HAIRPIN: + assert(rxq_obj->rq); rxq_obj_hairpin_release(rxq_obj); break; }