Commit 63f0cbad authored by Dragos Tatulea's avatar Dragos Tatulea Committed by Michael S. Tsirkin

vdpa/mlx5: Make setup/teardown_vq_resources() symmetrical

... by changing the setup_vq_resources() parameter type.
Reviewed-by: default avatarCosmin Ratiu <cratiu@nvidia.com>
Acked-by: default avatarEugenio Pérez <eperezma@redhat.com>
Signed-off-by: default avatarDragos Tatulea <dtatulea@nvidia.com>
Message-Id: <20240626-stage-vdpa-vq-precreate-v2-2-560c491078df@nvidia.com>
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
parent 1f5d6476
...@@ -146,7 +146,7 @@ static bool is_index_valid(struct mlx5_vdpa_dev *mvdev, u16 idx) ...@@ -146,7 +146,7 @@ static bool is_index_valid(struct mlx5_vdpa_dev *mvdev, u16 idx)
static void free_fixed_resources(struct mlx5_vdpa_net *ndev); static void free_fixed_resources(struct mlx5_vdpa_net *ndev);
static void init_mvqs(struct mlx5_vdpa_net *ndev); static void init_mvqs(struct mlx5_vdpa_net *ndev);
static int setup_vq_resources(struct mlx5_vdpa_dev *mvdev); static int setup_vq_resources(struct mlx5_vdpa_net *ndev);
static void teardown_vq_resources(struct mlx5_vdpa_net *ndev); static void teardown_vq_resources(struct mlx5_vdpa_net *ndev);
static bool mlx5_vdpa_debug; static bool mlx5_vdpa_debug;
...@@ -2862,7 +2862,7 @@ static int mlx5_vdpa_change_map(struct mlx5_vdpa_dev *mvdev, ...@@ -2862,7 +2862,7 @@ static int mlx5_vdpa_change_map(struct mlx5_vdpa_dev *mvdev,
if (teardown) { if (teardown) {
restore_channels_info(ndev); restore_channels_info(ndev);
err = setup_vq_resources(mvdev); err = setup_vq_resources(ndev);
if (err) if (err)
return err; return err;
} }
...@@ -2873,9 +2873,9 @@ static int mlx5_vdpa_change_map(struct mlx5_vdpa_dev *mvdev, ...@@ -2873,9 +2873,9 @@ static int mlx5_vdpa_change_map(struct mlx5_vdpa_dev *mvdev,
} }
/* reslock must be held for this function */ /* reslock must be held for this function */
static int setup_vq_resources(struct mlx5_vdpa_dev *mvdev) static int setup_vq_resources(struct mlx5_vdpa_net *ndev)
{ {
struct mlx5_vdpa_net *ndev = to_mlx5_vdpa_ndev(mvdev); struct mlx5_vdpa_dev *mvdev = &ndev->mvdev;
int err; int err;
WARN_ON(!rwsem_is_locked(&ndev->reslock)); WARN_ON(!rwsem_is_locked(&ndev->reslock));
...@@ -2997,7 +2997,7 @@ static void mlx5_vdpa_set_status(struct vdpa_device *vdev, u8 status) ...@@ -2997,7 +2997,7 @@ static void mlx5_vdpa_set_status(struct vdpa_device *vdev, u8 status)
goto err_setup; goto err_setup;
} }
register_link_notifier(ndev); register_link_notifier(ndev);
err = setup_vq_resources(mvdev); err = setup_vq_resources(ndev);
if (err) { if (err) {
mlx5_vdpa_warn(mvdev, "failed to setup driver\n"); mlx5_vdpa_warn(mvdev, "failed to setup driver\n");
goto err_driver; goto err_driver;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment