net/mlx5: remove completion object dependency on DV
authorOphir Munk <ophirmu@mellanox.com>
Wed, 10 Jun 2020 09:32:26 +0000 (09:32 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 16 Jun 2020 17:21:07 +0000 (19:21 +0200)
Replace 'struct mlx5dv_devx_cmd_comp *' with 'void *' in 'struct
mlx5_dev_ctx_shared'.

Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
drivers/net/mlx5/linux/mlx5_os.c
drivers/net/mlx5/mlx5.h

index 6286121..faa7b14 100644 (file)
@@ -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)) {
index 8c4b234..d624740 100644 (file)
@@ -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. */