From: Dekel Peled Date: Mon, 27 Jul 2020 08:50:47 +0000 (+0300) Subject: net/mlx5: fix Rx interrupt handling and cleanup X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=1ccc4790148f6d6c8f8f45f45345a919b45b25a9;p=dpdk.git net/mlx5: fix Rx interrupt handling and cleanup Recent patch added creation of Rx CQ using DevX API. The reading of events from DevX channel was not done correctly. This patch fixes the event reading, using the correct data structure. Cleanup after CQ creation, in case of error, is also updated. Fixes: 08d1838f645a ("net/mlx5: implement CQ for Rx using DevX API") Signed-off-by: Dekel Peled Acked-by: Viacheslav Ovsiienko --- diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c index c78e522669..79eb8f8d72 100644 --- a/drivers/net/mlx5/mlx5_rxq.c +++ b/drivers/net/mlx5/mlx5_rxq.c @@ -1193,12 +1193,16 @@ mlx5_rx_intr_disable(struct rte_eth_dev *dev, uint16_t rx_queue_id) mlx5_glue->ack_cq_events(rxq_obj->ibv_cq, 1); } else if (rxq_obj->type == MLX5_RXQ_OBJ_TYPE_DEVX_RQ) { #ifdef HAVE_IBV_DEVX_EVENT - struct mlx5dv_devx_async_event_hdr *event_data = NULL; + union { + struct mlx5dv_devx_async_event_hdr event_resp; + uint8_t buf[sizeof(struct mlx5dv_devx_async_event_hdr) + + 128]; + } out; ret = mlx5_glue->devx_get_event - (rxq_obj->devx_channel, event_data, - sizeof(struct mlx5dv_devx_async_event_hdr)); - if (ret < 0 || event_data->cookie != + (rxq_obj->devx_channel, &out.event_resp, + sizeof(out.buf)); + if (ret < 0 || out.event_resp.cookie != (uint64_t)(uintptr_t)rxq_obj->devx_cq) goto exit; #endif /* HAVE_IBV_DEVX_EVENT */ @@ -1646,6 +1650,8 @@ mlx5_devx_cq_new(struct rte_eth_dev *dev, unsigned int cqe_n, uint16_t idx, memset((void *)(uintptr_t)rxq_data->cqes, 0xFF, cq_size); return cq_obj; error: + if (cq_obj) + mlx5_devx_cmd_destroy(cq_obj); rxq_release_devx_cq_resources(rxq_ctrl); return NULL; }