vdpa/mlx5: move virtual doorbell alloc to probe
[dpdk.git] / drivers / vdpa / mlx5 / mlx5_vdpa_virtq.c
index cb2d61b..dd37016 100644 (file)
@@ -105,10 +105,6 @@ mlx5_vdpa_virtqs_release(struct mlx5_vdpa_priv *priv)
                claim_zero(munmap(priv->virtq_db_addr, priv->var->length));
                priv->virtq_db_addr = NULL;
        }
-       if (priv->var) {
-               mlx5_glue->dv_free_var(priv->var);
-               priv->var = NULL;
-       }
        priv->features = 0;
 }
 
@@ -350,11 +346,6 @@ mlx5_vdpa_virtqs_prepare(struct mlx5_vdpa_priv *priv)
                DRV_LOG(ERR, "Failed to configure negotiated features.");
                return -1;
        }
-       priv->var = mlx5_glue->dv_alloc_var(priv->ctx, 0);
-       if (!priv->var) {
-               DRV_LOG(ERR, "Failed to allocate VAR %u.\n", errno);
-               return -1;
-       }
        /* Always map the entire page. */
        priv->virtq_db_addr = mmap(NULL, priv->var->length, PROT_READ |
                                   PROT_WRITE, MAP_SHARED, priv->ctx->cmd_fd,