Skip to content

Commit 049cbea

Browse files
dtatuleamstsirkin
authored andcommitted
vdpa/mlx5: Create helper function for dma mappings
Necessary for upcoming cvq separation from mr allocation. Acked-by: Jason Wang <[email protected]> Signed-off-by: Dragos Tatulea <[email protected]> Message-Id: <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]> Reviewed-by: Si-Wei Liu <[email protected]> Tested-by: Si-Wei Liu <[email protected]> Tested-by: Lei Yang <[email protected]>
1 parent c8068d9 commit 049cbea

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

drivers/vdpa/mlx5/core/mlx5_vdpa.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ int mlx5_vdpa_create_mr(struct mlx5_vdpa_dev *mvdev, struct vhost_iotlb *iotlb,
120120
unsigned int asid);
121121
void mlx5_vdpa_destroy_mr(struct mlx5_vdpa_dev *mvdev);
122122
void mlx5_vdpa_destroy_mr_asid(struct mlx5_vdpa_dev *mvdev, unsigned int asid);
123+
int mlx5_vdpa_create_dma_mr(struct mlx5_vdpa_dev *mvdev);
123124

124125
#define mlx5_vdpa_warn(__dev, format, ...) \
125126
dev_warn((__dev)->mdev->device, "%s:%d:(pid %d) warning: " format, __func__, __LINE__, \

drivers/vdpa/mlx5/core/mr.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -619,3 +619,8 @@ int mlx5_vdpa_handle_set_map(struct mlx5_vdpa_dev *mvdev, struct vhost_iotlb *io
619619

620620
return err;
621621
}
622+
623+
int mlx5_vdpa_create_dma_mr(struct mlx5_vdpa_dev *mvdev)
624+
{
625+
return mlx5_vdpa_create_mr(mvdev, NULL, 0);
626+
}

drivers/vdpa/mlx5/net/mlx5_vnet.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2880,7 +2880,7 @@ static int mlx5_vdpa_reset(struct vdpa_device *vdev)
28802880
++mvdev->generation;
28812881

28822882
if (MLX5_CAP_GEN(mvdev->mdev, umem_uid_0)) {
2883-
if (mlx5_vdpa_create_mr(mvdev, NULL, 0))
2883+
if (mlx5_vdpa_create_dma_mr(mvdev))
28842884
mlx5_vdpa_warn(mvdev, "create MR failed\n");
28852885
}
28862886
up_write(&ndev->reslock);
@@ -3485,7 +3485,7 @@ static int mlx5_vdpa_dev_add(struct vdpa_mgmt_dev *v_mdev, const char *name,
34853485
goto err_mpfs;
34863486

34873487
if (MLX5_CAP_GEN(mvdev->mdev, umem_uid_0)) {
3488-
err = mlx5_vdpa_create_mr(mvdev, NULL, 0);
3488+
err = mlx5_vdpa_create_dma_mr(mvdev);
34893489
if (err)
34903490
goto err_res;
34913491
}

0 commit comments

Comments
 (0)