[v1,3/8] drivers: remove mlx5 protection domain dependency on ibv
diff mbox series

Message ID 20200603150602.4686-4-ophirmu@mellanox.com
State Accepted
Delegated to: Raslan Darawsheh
Headers show
Series
  • mlx5 PMD multi OS support
Related show

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Ophir Munk June 3, 2020, 3:05 p.m. UTC
Replace 'struct ibv_pd *' with 'void *' in struct mlx5_ctx_shared and
all function calls in mlx5 PMD.

Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
---
 drivers/common/mlx5/mlx5_common_mr.c | 24 ++++++++++++------------
 drivers/common/mlx5/mlx5_common_mr.h |  6 +++---
 drivers/net/mlx5/mlx5.h              |  2 +-
 3 files changed, 16 insertions(+), 16 deletions(-)

Patch
diff mbox series

diff --git a/drivers/common/mlx5/mlx5_common_mr.c b/drivers/common/mlx5/mlx5_common_mr.c
index 3b46446..e894523 100644
--- a/drivers/common/mlx5/mlx5_common_mr.c
+++ b/drivers/common/mlx5/mlx5_common_mr.c
@@ -521,7 +521,7 @@  mr_find_contig_memsegs_cb(const struct rte_memseg_list *msl,
  * request fails.
  *
  * @param pd
- *   Pointer to ibv_pd of a device (net, regex, vdpa,...).
+ *   Pointer to pd of a device (net, regex, vdpa,...).
  * @param share_cache
  *   Pointer to a global shared MR cache.
  * @param[out] entry
@@ -536,7 +536,7 @@  mr_find_contig_memsegs_cb(const struct rte_memseg_list *msl,
  *   Searched LKey on success, UINT32_MAX on failure and rte_errno is set.
  */
 static uint32_t
-mlx5_mr_create_secondary(struct ibv_pd *pd __rte_unused,
+mlx5_mr_create_secondary(void *pd __rte_unused,
 			 struct mlx5_mp_id *mp_id,
 			 struct mlx5_mr_share_cache *share_cache,
 			 struct mr_cache_entry *entry, uintptr_t addr,
@@ -569,7 +569,7 @@  mlx5_mr_create_secondary(struct ibv_pd *pd __rte_unused,
  * Register entire virtually contiguous memory chunk around the address.
  *
  * @param pd
- *   Pointer to ibv_pd of a device (net, regex, vdpa,...).
+ *   Pointer to pd of a device (net, regex, vdpa,...).
  * @param share_cache
  *   Pointer to a global shared MR cache.
  * @param[out] entry
@@ -584,7 +584,7 @@  mlx5_mr_create_secondary(struct ibv_pd *pd __rte_unused,
  *   Searched LKey on success, UINT32_MAX on failure and rte_errno is set.
  */
 uint32_t
-mlx5_mr_create_primary(struct ibv_pd *pd,
+mlx5_mr_create_primary(void *pd,
 		       struct mlx5_mr_share_cache *share_cache,
 		       struct mr_cache_entry *entry, uintptr_t addr,
 		       unsigned int mr_ext_memseg_en)
@@ -816,7 +816,7 @@  mlx5_mr_create_primary(struct ibv_pd *pd,
  * This can be called from primary and secondary process.
  *
  * @param pd
- *   Pointer to ibv_pd of a device (net, regex, vdpa,...).
+ *   Pointer to pd handle of a device (net, regex, vdpa,...).
  * @param share_cache
  *   Pointer to a global shared MR cache.
  * @param[out] entry
@@ -829,7 +829,7 @@  mlx5_mr_create_primary(struct ibv_pd *pd,
  *   Searched LKey on success, UINT32_MAX on failure and rte_errno is set.
  */
 static uint32_t
-mlx5_mr_create(struct ibv_pd *pd, struct mlx5_mp_id *mp_id,
+mlx5_mr_create(void *pd, struct mlx5_mp_id *mp_id,
 	       struct mlx5_mr_share_cache *share_cache,
 	       struct mr_cache_entry *entry, uintptr_t addr,
 	       unsigned int mr_ext_memseg_en)
@@ -856,7 +856,7 @@  mlx5_mr_create(struct ibv_pd *pd, struct mlx5_mp_id *mp_id,
  * Insert the found/created entry to local bottom-half cache table.
  *
  * @param pd
- *   Pointer to ibv_pd of a device (net, regex, vdpa,...).
+ *   Pointer to pd of a device (net, regex, vdpa,...).
  * @param share_cache
  *   Pointer to a global shared MR cache.
  * @param mr_ctrl
@@ -871,7 +871,7 @@  mlx5_mr_create(struct ibv_pd *pd, struct mlx5_mp_id *mp_id,
  *   Searched LKey on success, UINT32_MAX on no match.
  */
 static uint32_t
-mr_lookup_caches(struct ibv_pd *pd, struct mlx5_mp_id *mp_id,
+mr_lookup_caches(void *pd, struct mlx5_mp_id *mp_id,
 		 struct mlx5_mr_share_cache *share_cache,
 		 struct mlx5_mr_ctrl *mr_ctrl,
 		 struct mr_cache_entry *entry, uintptr_t addr,
@@ -920,7 +920,7 @@  mr_lookup_caches(struct ibv_pd *pd, struct mlx5_mp_id *mp_id,
  * per-queue local caches.
  *
  * @param pd
- *   Pointer to ibv_pd of a device (net, regex, vdpa,...).
+ *   Pointer to pd of a device (net, regex, vdpa,...).
  * @param share_cache
  *   Pointer to a global shared MR cache.
  * @param mr_ctrl
@@ -931,7 +931,7 @@  mr_lookup_caches(struct ibv_pd *pd, struct mlx5_mp_id *mp_id,
  * @return
  *   Searched LKey on success, UINT32_MAX on no match.
  */
-uint32_t mlx5_mr_addr2mr_bh(struct ibv_pd *pd, struct mlx5_mp_id *mp_id,
+uint32_t mlx5_mr_addr2mr_bh(void *pd, struct mlx5_mp_id *mp_id,
 			    struct mlx5_mr_share_cache *share_cache,
 			    struct mlx5_mr_ctrl *mr_ctrl,
 			    uintptr_t addr, unsigned int mr_ext_memseg_en)
@@ -1022,7 +1022,7 @@  mlx5_mr_flush_local_cache(struct mlx5_mr_ctrl *mr_ctrl)
  * part of the DPDK memory segments.
  *
  * @param pd
- *   Pointer to ibv_pd of a device (net, regex, vdpa,...).
+ *   Pointer to pd of a device (net, regex, vdpa,...).
  * @param addr
  *   Starting virtual address of memory.
  * @param len
@@ -1034,7 +1034,7 @@  mlx5_mr_flush_local_cache(struct mlx5_mr_ctrl *mr_ctrl)
  *   Pointer to MR structure on success, NULL otherwise.
  */
 struct mlx5_mr *
-mlx5_create_mr_ext(struct ibv_pd *pd, uintptr_t addr, size_t len, int socket_id)
+mlx5_create_mr_ext(void *pd, uintptr_t addr, size_t len, int socket_id)
 {
 	struct mlx5_mr *mr = NULL;
 
diff --git a/drivers/common/mlx5/mlx5_common_mr.h b/drivers/common/mlx5/mlx5_common_mr.h
index 4ea47cd..7add4da 100644
--- a/drivers/common/mlx5/mlx5_common_mr.h
+++ b/drivers/common/mlx5/mlx5_common_mr.h
@@ -122,7 +122,7 @@  void mlx5_mr_btree_free(struct mlx5_mr_btree *bt);
 __rte_internal
 void mlx5_mr_btree_dump(struct mlx5_mr_btree *bt __rte_unused);
 __rte_internal
-uint32_t mlx5_mr_addr2mr_bh(struct ibv_pd *pd, struct mlx5_mp_id *mp_id,
+uint32_t mlx5_mr_addr2mr_bh(void *pd, struct mlx5_mp_id *mp_id,
 			    struct mlx5_mr_share_cache *share_cache,
 			    struct mlx5_mr_ctrl *mr_ctrl,
 			    uintptr_t addr, unsigned int mr_ext_memseg_en);
@@ -148,11 +148,11 @@  mlx5_mr_lookup_list(struct mlx5_mr_share_cache *share_cache,
 		    struct mr_cache_entry *entry, uintptr_t addr);
 __rte_internal
 struct mlx5_mr *
-mlx5_create_mr_ext(struct ibv_pd *pd, uintptr_t addr, size_t len,
+mlx5_create_mr_ext(void *pd, uintptr_t addr, size_t len,
 		   int socket_id);
 __rte_internal
 uint32_t
-mlx5_mr_create_primary(struct ibv_pd *pd,
+mlx5_mr_create_primary(void *pd,
 		       struct mlx5_mr_share_cache *share_cache,
 		       struct mr_cache_entry *entry, uintptr_t addr,
 		       unsigned int mr_ext_memseg_en);
diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h
index d020c10..30678aa 100644
--- a/drivers/net/mlx5/mlx5.h
+++ b/drivers/net/mlx5/mlx5.h
@@ -494,7 +494,7 @@  struct mlx5_dev_ctx_shared {
 	uint32_t devx:1; /* Opened with DV. */
 	uint32_t max_port; /* Maximal IB device port index. */
 	void *ctx; /* Verbs/DV/DevX context. */
-	struct ibv_pd *pd; /* Protection Domain. */
+	void *pd; /* Protection Domain. */
 	uint32_t pdn; /* Protection Domain number. */
 	uint32_t tdn; /* Transport Domain number. */
 	char ibdev_name[IBV_SYSFS_NAME_MAX]; /* IB device name. */