net/ice: remove VSI update on DCF reset by PF
[dpdk.git] / drivers / net / mlx5 / mlx5_txpp.c
index 9960cc4..34f92fa 100644 (file)
@@ -230,7 +230,7 @@ mlx5_txpp_create_rearm_queue(struct mlx5_dev_ctx_shared *sh)
                .cd_master = 1,
                .state = MLX5_SQC_STATE_RST,
                .tis_lst_sz = 1,
-               .tis_num = sh->tis->id,
+               .tis_num = sh->tis[0]->id,
                .wq_attr = (struct mlx5_devx_wq_attr){
                        .pd = sh->cdev->pdn,
                        .uar_page = mlx5_os_get_devx_uar_page_id(sh->tx_uar),
@@ -434,7 +434,7 @@ mlx5_txpp_create_clock_queue(struct mlx5_dev_ctx_shared *sh)
        /* Create send queue object for Clock Queue. */
        if (sh->txpp.test) {
                sq_attr.tis_lst_sz = 1;
-               sq_attr.tis_num = sh->tis->id;
+               sq_attr.tis_num = sh->tis[0]->id;
                sq_attr.non_wire = 0;
                sq_attr.static_sq_wq = 1;
        } else {
@@ -759,11 +759,11 @@ mlx5_txpp_interrupt_handler(void *cb_arg)
 static void
 mlx5_txpp_stop_service(struct mlx5_dev_ctx_shared *sh)
 {
-       if (!sh->txpp.intr_handle.fd)
+       if (!rte_intr_fd_get(sh->txpp.intr_handle))
                return;
-       mlx5_intr_callback_unregister(&sh->txpp.intr_handle,
+       mlx5_intr_callback_unregister(sh->txpp.intr_handle,
                                      mlx5_txpp_interrupt_handler, sh);
-       sh->txpp.intr_handle.fd = 0;
+       rte_intr_instance_free(sh->txpp.intr_handle);
 }
 
 /* Attach interrupt handler and fires first request to Rearm Queue. */
@@ -787,13 +787,22 @@ mlx5_txpp_start_service(struct mlx5_dev_ctx_shared *sh)
                rte_errno = errno;
                return -rte_errno;
        }
-       memset(&sh->txpp.intr_handle, 0, sizeof(sh->txpp.intr_handle));
+       sh->txpp.intr_handle =
+                       rte_intr_instance_alloc(RTE_INTR_INSTANCE_F_SHARED);
+       if (sh->txpp.intr_handle == NULL) {
+               DRV_LOG(ERR, "Fail to allocate intr_handle");
+               return -ENOMEM;
+       }
        fd = mlx5_os_get_devx_channel_fd(sh->txpp.echan);
-       sh->txpp.intr_handle.fd = fd;
-       sh->txpp.intr_handle.type = RTE_INTR_HANDLE_EXT;
-       if (rte_intr_callback_register(&sh->txpp.intr_handle,
+       if (rte_intr_fd_set(sh->txpp.intr_handle, fd))
+               return -rte_errno;
+
+       if (rte_intr_type_set(sh->txpp.intr_handle, RTE_INTR_HANDLE_EXT))
+               return -rte_errno;
+
+       if (rte_intr_callback_register(sh->txpp.intr_handle,
                                       mlx5_txpp_interrupt_handler, sh)) {
-               sh->txpp.intr_handle.fd = 0;
+               rte_intr_fd_set(sh->txpp.intr_handle, 0);
                DRV_LOG(ERR, "Failed to register CQE interrupt %d.", rte_errno);
                return -rte_errno;
        }