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 8199CA04B1; Tue, 25 Aug 2020 11:33:21 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 928A11C210; Tue, 25 Aug 2020 11:31:45 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id C97731C1B9 for ; Tue, 25 Aug 2020 11:31:29 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from ophirmu@nvidia.com) with SMTP; 25 Aug 2020 12:31:25 +0300 Received: from nvidia.com (pegasus05.mtr.labs.mlnx [10.210.16.100]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 07P9VPN1030009; Tue, 25 Aug 2020 12:31:25 +0300 From: Ophir Munk To: dev@dpdk.org Cc: Ophir Munk Date: Tue, 25 Aug 2020 09:31:14 +0000 Message-Id: <20200825093116.26538-12-ophirmu@nvidia.com> X-Mailer: git-send-email 2.8.4 In-Reply-To: <20200825093116.26538-1-ophirmu@nvidia.com> References: <20200820145028.4090-1-ophirmu@nvidia.com> <20200825093116.26538-1-ophirmu@nvidia.com> Subject: [dpdk-dev] [PATCH v2 11/13] net/mlx5: remove ibv_* dependency in Rx/Tx objects 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" From: Ophir Munk Replace pointers to ibv structs with pointers to void (file mlx5_rxtx.h). Specifically the following pointers were replaced: 'struct ibv_cq *', 'struct ibv_wq *', 'struct ibv_comp_channel *', 'struct ibv_rwq_ind_table *a', 'struct ibv_qp *'. Signed-off-by: Ophir Munk Acked-by: Matan Azrad --- drivers/net/mlx5/mlx5_rxq.c | 5 +++-- drivers/net/mlx5/mlx5_rxtx.h | 14 +++++++------- drivers/net/mlx5/mlx5_trigger.c | 3 ++- drivers/net/mlx5/mlx5_txq.c | 2 +- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c index 92d8876..946f745 100644 --- a/drivers/net/mlx5/mlx5_rxq.c +++ b/drivers/net/mlx5/mlx5_rxq.c @@ -1790,7 +1790,8 @@ mlx5_rxq_obj_new(struct rte_eth_dev *dev, uint16_t idx, rte_errno = ENOMEM; goto error; } - tmpl->fd = tmpl->ibv_channel->fd; + tmpl->fd = ((struct ibv_comp_channel *) + (tmpl->ibv_channel))->fd; } else if (tmpl->type == MLX5_RXQ_OBJ_TYPE_DEVX_RQ) { int devx_ev_flag = MLX5DV_DEVX_CREATE_EVENT_CHANNEL_FLAGS_OMIT_EV_DATA; @@ -3299,7 +3300,7 @@ mlx5_ind_table_obj_drop_new(struct rte_eth_dev *dev) (priv->sh->ctx, &(struct ibv_rwq_ind_table_init_attr){ .log_ind_tbl_size = 0, - .ind_tbl = &rxq->wq, + .ind_tbl = (struct ibv_wq **)&rxq->wq, .comp_mask = 0, }); if (!tmpl.ind_table) { diff --git a/drivers/net/mlx5/mlx5_rxtx.h b/drivers/net/mlx5/mlx5_rxtx.h index 0fc7754..f3fe2e1 100644 --- a/drivers/net/mlx5/mlx5_rxtx.h +++ b/drivers/net/mlx5/mlx5_rxtx.h @@ -178,9 +178,9 @@ struct mlx5_rxq_obj { RTE_STD_C11 union { struct { - struct ibv_wq *wq; /* Work Queue. */ - struct ibv_cq *ibv_cq; /* Completion Queue. */ - struct ibv_comp_channel *ibv_channel; + void *wq; /* Work Queue. */ + void *ibv_cq; /* Completion Queue. */ + void *ibv_channel; }; struct { struct mlx5_devx_obj *rq; /* DevX Rx Queue object. */ @@ -229,7 +229,7 @@ struct mlx5_ind_table_obj { enum mlx5_ind_tbl_type type; RTE_STD_C11 union { - struct ibv_rwq_ind_table *ind_table; /**< Indirection table. */ + void *ind_table; /**< Indirection table. */ struct mlx5_devx_obj *rqt; /* DevX RQT object. */ }; uint32_t queues_n; /**< Number of queues in the list. */ @@ -243,7 +243,7 @@ struct mlx5_hrxq { struct mlx5_ind_table_obj *ind_table; /* Indirection table. */ RTE_STD_C11 union { - struct ibv_qp *qp; /* Verbs queue pair. */ + void *qp; /* Verbs queue pair. */ struct mlx5_devx_obj *tir; /* DevX TIR object. */ }; #ifdef HAVE_IBV_FLOW_DV_SUPPORT @@ -350,8 +350,8 @@ struct mlx5_txq_obj { RTE_STD_C11 union { struct { - struct ibv_cq *cq; /* Completion Queue. */ - struct ibv_qp *qp; /* Queue Pair. */ + void *cq; /* Completion Queue. */ + void *qp; /* Queue Pair. */ }; struct { struct mlx5_devx_obj *sq; diff --git a/drivers/net/mlx5/mlx5_trigger.c b/drivers/net/mlx5/mlx5_trigger.c index 6f1e6d4..549af35 100644 --- a/drivers/net/mlx5/mlx5_trigger.c +++ b/drivers/net/mlx5/mlx5_trigger.c @@ -153,7 +153,8 @@ mlx5_rxq_start(struct rte_eth_dev *dev) if (!rxq_ctrl->obj) goto error; if (obj_type == MLX5_RXQ_OBJ_TYPE_IBV) - rxq_ctrl->wqn = rxq_ctrl->obj->wq->wq_num; + rxq_ctrl->wqn = + ((struct ibv_wq *)(rxq_ctrl->obj->wq))->wq_num; else if (obj_type == MLX5_RXQ_OBJ_TYPE_DEVX_RQ) rxq_ctrl->wqn = rxq_ctrl->obj->rq->id; } diff --git a/drivers/net/mlx5/mlx5_txq.c b/drivers/net/mlx5/mlx5_txq.c index fed9d8a..66ad368 100644 --- a/drivers/net/mlx5/mlx5_txq.c +++ b/drivers/net/mlx5/mlx5_txq.c @@ -1317,7 +1317,7 @@ mlx5_txq_obj_new(struct rte_eth_dev *dev, uint16_t idx, txq_data->cqe_n = log2above(cq_info.cqe_cnt); txq_data->cqe_s = 1 << txq_data->cqe_n; txq_data->cqe_m = txq_data->cqe_s - 1; - txq_data->qp_num_8s = tmpl.qp->qp_num << 8; + txq_data->qp_num_8s = ((struct ibv_qp *)tmpl.qp)->qp_num << 8; txq_data->wqes = qp.sq.buf; txq_data->wqe_n = log2above(qp.sq.wqe_cnt); txq_data->wqe_s = 1 << txq_data->wqe_n; -- 2.8.4