net/hns3: refactor multi-process initialization
[dpdk.git] / drivers / vdpa / mlx5 / mlx5_vdpa.c
index 9a6f647..b9e84dd 100644 (file)
@@ -543,6 +543,12 @@ mlx5_vdpa_dev_probe(struct mlx5_common_device *cdev)
                DRV_LOG(ERR, "Failed to allocate VAR %u.", errno);
                goto error;
        }
+       priv->err_intr_handle =
+               rte_intr_instance_alloc(RTE_INTR_INSTANCE_F_SHARED);
+       if (priv->err_intr_handle == NULL) {
+               DRV_LOG(ERR, "Fail to allocate intr_handle");
+               goto error;
+       }
        priv->vdev = rte_vdpa_register_device(cdev->dev, &mlx5_vdpa_ops);
        if (priv->vdev == NULL) {
                DRV_LOG(ERR, "Failed to register vDPA device.");
@@ -561,6 +567,7 @@ error:
        if (priv) {
                if (priv->var)
                        mlx5_glue->dv_free_var(priv->var);
+               rte_intr_instance_free(priv->err_intr_handle);
                rte_free(priv);
        }
        return -rte_errno;
@@ -592,6 +599,7 @@ mlx5_vdpa_dev_remove(struct mlx5_common_device *cdev)
                if (priv->vdev)
                        rte_vdpa_unregister_device(priv->vdev);
                pthread_mutex_destroy(&priv->vq_config_lock);
+               rte_intr_instance_free(priv->err_intr_handle);
                rte_free(priv);
        }
        return 0;