From: Ophir Munk <ophirmu@nvidia.com>
To: dev@dpdk.org
Cc: Ophir Munk <ophirmu@nvidia.com>,
Gregory Etelson <getelson@mellanox.com>,
Ophir Munk <ophirmu@mellanox.com>
Subject: [dpdk-dev] [PATCH v1 11/13] net/mlx5: remove ibv_* dependency in rx/tx objects
Date: Thu, 20 Aug 2020 14:50:26 +0000 [thread overview]
Message-ID: <20200820145028.4090-11-ophirmu@nvidia.com> (raw)
In-Reply-To: <20200820145028.4090-1-ophirmu@nvidia.com>
From: Ophir Munk <ophirmu@mellanox.com>
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 <ophirmu@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
---
drivers/net/mlx5/mlx5_rxq.c | 14 +++++++-------
drivers/net/mlx5/mlx5_rxtx.h | 14 +++++++-------
drivers/net/mlx5/mlx5_trigger.c | 2 +-
drivers/net/mlx5/mlx5_txq.c | 2 +-
4 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index 79eb8f8..534f1b7 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -1444,7 +1444,7 @@ mlx5_devx_wq_attr_fill(struct mlx5_priv *priv, struct mlx5_rxq_ctrl *rxq_ctrl,
wq_attr->dbr_addr = rxq_ctrl->rq_dbr_offset;
wq_attr->dbr_umem_id = rxq_ctrl->rq_dbr_umem_id;
wq_attr->dbr_umem_valid = 1;
- wq_attr->wq_umem_id = rxq_ctrl->wq_umem->umem_id;
+ wq_attr->wq_umem_id = mlx5_os_get_umem_id(rxq_ctrl->wq_umem);
wq_attr->wq_umem_valid = 1;
}
@@ -1620,8 +1620,8 @@ mlx5_devx_cq_new(struct rte_eth_dev *dev, unsigned int cqe_n, uint16_t idx,
DRV_LOG(ERR, "Failed to register umem for CQ.");
goto error;
}
- cq_attr.uar_page_id = priv->sh->devx_rx_uar->page_id;
- cq_attr.q_umem_id = rxq_ctrl->cq_umem->umem_id;
+ cq_attr.uar_page_id = mlx5_os_get_devx_uar_page_id(priv->sh->devx_rx_uar);
+ cq_attr.q_umem_id = mlx5_os_get_umem_id(rxq_ctrl->cq_umem);
cq_attr.q_umem_valid = 1;
cq_attr.log_cq_size = log_cqe_n;
cq_attr.log_page_size = rte_log2_u32(page_size);
@@ -1789,7 +1789,7 @@ 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;
@@ -1805,7 +1805,7 @@ mlx5_rxq_obj_new(struct rte_eth_dev *dev, uint16_t idx,
rte_errno);
goto error;
}
- tmpl->fd = tmpl->devx_channel->fd;
+ tmpl->fd = mlx5_os_get_devx_channel_fd(tmpl->devx_channel);
}
}
if (mlx5_rxq_mprq_enabled(rxq_data))
@@ -1897,7 +1897,7 @@ mlx5_rxq_obj_new(struct rte_eth_dev *dev, uint16_t idx,
rxq_data->cq_db =
(uint32_t *)((uintptr_t)dbr_page->dbrs +
(uintptr_t)rxq_ctrl->cq_dbr_offset);
- rxq_data->cq_uar = priv->sh->devx_rx_uar->base_addr;
+ rxq_data->cq_uar = mlx5_os_get_devx_uar_base_addr(priv->sh->devx_rx_uar);
/* Create CQ using DevX API. */
tmpl->devx_cq = mlx5_devx_cq_new(dev, cqe_n, idx, tmpl);
if (!tmpl->devx_cq) {
@@ -3296,7 +3296,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..2a98064 100644
--- a/drivers/net/mlx5/mlx5_trigger.c
+++ b/drivers/net/mlx5/mlx5_trigger.c
@@ -153,7 +153,7 @@ 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
next prev parent reply other threads:[~2020-08-20 14:52 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-20 14:50 [dpdk-dev] [PATCH v1 01/13] common/mlx5: replace strsep with strtok_r Ophir Munk
2020-08-20 14:50 ` [dpdk-dev] [PATCH v1 02/13] common/mlx5: replace linux __bexx types with rte Ophir Munk
2020-08-20 14:50 ` [dpdk-dev] [PATCH v1 03/13] net/mlx5: rename mlx5 enumeration REG_NONE Ophir Munk
2020-08-20 14:50 ` [dpdk-dev] [PATCH v1 04/13] net/mlx5: move mlx5_get_ifname prototype under Linux Ophir Munk
2020-08-20 14:50 ` [dpdk-dev] [PATCH v1 05/13] net/mlx5: fix removal of unused inclusion files Ophir Munk
2020-08-20 14:50 ` [dpdk-dev] [PATCH v1 06/13] net/mlx5: remove Netlink dependency in shared code Ophir Munk
2020-08-20 14:50 ` [dpdk-dev] [PATCH v1 07/13] net/mlx5: fix unused utility macros Ophir Munk
2020-08-20 14:50 ` [dpdk-dev] [PATCH v1 08/13] net/mlx5: call meter detach only if DR is supported Ophir Munk
2020-08-20 14:50 ` [dpdk-dev] [PATCH v1 09/13] net/mlx5: add ICMP protocol number definition Ophir Munk
2020-08-20 14:50 ` [dpdk-dev] [PATCH v1 10/13] net/mlx5: remove more DV dependencies Ophir Munk
2020-08-20 14:50 ` Ophir Munk [this message]
2020-08-20 14:50 ` [dpdk-dev] [PATCH v1 12/13] net/mlx5: separate vlan strip modification Ophir Munk
2020-08-20 14:50 ` [dpdk-dev] [PATCH v1 13/13] linux/mlx5: refactor VLAN Ophir Munk
2020-08-25 9:31 ` [dpdk-dev] [PATCH v2 00/13] mlx5 PMD multi OS support - part #4 Ophir Munk
2020-08-25 9:31 ` [dpdk-dev] [PATCH v2 01/13] common/mlx5: replace strsep with strtok_r Ophir Munk
2020-08-25 9:31 ` [dpdk-dev] [PATCH v2 02/13] common/mlx5: replace Linux __bexx types with rte Ophir Munk
2020-08-25 9:31 ` [dpdk-dev] [PATCH v2 03/13] net/mlx5: rename mlx5 enumeration REG_NONE Ophir Munk
2020-08-25 9:31 ` [dpdk-dev] [PATCH v2 04/13] net/mlx5: move mlx5_get_ifname prototype under Linux Ophir Munk
2020-08-25 9:31 ` [dpdk-dev] [PATCH v2 05/13] net/mlx5: fix removal of unused inclusion files Ophir Munk
2020-08-25 9:31 ` [dpdk-dev] [PATCH v2 06/13] net/mlx5: remove Netlink dependency in shared code Ophir Munk
2020-08-25 9:31 ` [dpdk-dev] [PATCH v2 07/13] net/mlx5: fix unused utility macros Ophir Munk
2020-08-25 9:31 ` [dpdk-dev] [PATCH v2 08/13] net/mlx5: call meter detach only if DR is supported Ophir Munk
2020-08-25 9:31 ` [dpdk-dev] [PATCH v2 09/13] net/mlx5: add ICMP protocol number definition Ophir Munk
2020-09-22 11:49 ` Thomas Monjalon
2020-09-22 12:20 ` Ophir Munk
2020-08-25 9:31 ` [dpdk-dev] [PATCH v2 10/13] net/mlx5: remove more DV dependencies Ophir Munk
2020-08-25 9:31 ` [dpdk-dev] [PATCH v2 11/13] net/mlx5: remove ibv_* dependency in Rx/Tx objects Ophir Munk
2020-08-25 9:31 ` [dpdk-dev] [PATCH v2 12/13] net/mlx5: separate VLAN strip modification Ophir Munk
2020-08-25 9:31 ` [dpdk-dev] [PATCH v2 13/13] linux/mlx5: refactor VLAN Ophir Munk
[not found] ` <20200825092943.26312-1-ophirmu@mellanox.com>
2020-08-27 9:53 ` [dpdk-dev] [PATCH v2 00/13] mlx5 PMD multi OS support - part #4 Raslan Darawsheh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200820145028.4090-11-ophirmu@nvidia.com \
--to=ophirmu@nvidia.com \
--cc=dev@dpdk.org \
--cc=getelson@mellanox.com \
--cc=ophirmu@mellanox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).