[v1,1/8] net/mlx5: remove dv dependency in mlx5_dev_ctx_shared struct

Message ID 20200610093233.23902-2-ophirmu@mellanox.com (mailing list archive)
State Accepted, archived
Delegated to: Raslan Darawsheh
Headers
Series mlx5 PMD multi OS support - part #2 |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-nxp-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-testing success Testing PASS
ci/Intel-compilation success Compilation OK

Commit Message

Ophir Munk June 10, 2020, 9:32 a.m. UTC
  Replace 'struct mlx5dv_devx_cmd_comp *' with 'void *' in 'struct
mlx5_dev_ctx_shared'.

Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
---
 drivers/net/mlx5/linux/mlx5_os.c | 12 +++++++-----
 drivers/net/mlx5/mlx5.h          |  2 +-
 2 files changed, 8 insertions(+), 6 deletions(-)
  

Patch

diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c
index 92422db..21eff38 100644
--- a/drivers/net/mlx5/linux/mlx5_os.c
+++ b/drivers/net/mlx5/linux/mlx5_os.c
@@ -1944,19 +1944,21 @@  mlx5_os_dev_shared_handler_install(struct mlx5_dev_ctx_shared *sh)
 	if (sh->devx) {
 #ifdef HAVE_IBV_DEVX_ASYNC
 		sh->intr_handle_devx.fd = -1;
-		sh->devx_comp = mlx5_glue->devx_create_cmd_comp(sh->ctx);
-		if (!sh->devx_comp) {
+		sh->devx_comp =
+			(void *)mlx5_glue->devx_create_cmd_comp(sh->ctx);
+		struct mlx5dv_devx_cmd_comp *devx_comp = sh->devx_comp;
+		if (!devx_comp) {
 			DRV_LOG(INFO, "failed to allocate devx_comp.");
 			return;
 		}
-		flags = fcntl(sh->devx_comp->fd, F_GETFL);
-		ret = fcntl(sh->devx_comp->fd, F_SETFL, flags | O_NONBLOCK);
+		flags = fcntl(devx_comp->fd, F_GETFL);
+		ret = fcntl(devx_comp->fd, F_SETFL, flags | O_NONBLOCK);
 		if (ret) {
 			DRV_LOG(INFO, "failed to change file descriptor"
 				" devx comp");
 			return;
 		}
-		sh->intr_handle_devx.fd = sh->devx_comp->fd;
+		sh->intr_handle_devx.fd = devx_comp->fd;
 		sh->intr_handle_devx.type = RTE_INTR_HANDLE_EXT;
 		if (rte_intr_callback_register(&sh->intr_handle_devx,
 					mlx5_dev_interrupt_handler_devx, sh)) {
diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h
index 8c4b234..d624740 100644
--- a/drivers/net/mlx5/mlx5.h
+++ b/drivers/net/mlx5/mlx5.h
@@ -567,7 +567,7 @@  struct mlx5_dev_ctx_shared {
 	/* Shared interrupt handler section. */
 	struct rte_intr_handle intr_handle; /* Interrupt handler for device. */
 	struct rte_intr_handle intr_handle_devx; /* DEVX interrupt handler. */
-	struct mlx5dv_devx_cmd_comp *devx_comp; /* DEVX async comp obj. */
+	void *devx_comp; /* DEVX async comp obj. */
 	struct mlx5_devx_obj *tis; /* TIS object. */
 	struct mlx5_devx_obj *td; /* Transport domain. */
 	struct mlx5_flow_id_pool *flow_id_pool; /* Flow ID pool. */