Skip to content

Commit 39f7c12

Browse files
dtatuleamstsirkin
authored andcommitted
vdpa/mlx5: Rename mr destroy functions
Make mlx5_destroy_mr symmetric to mlx5_create_mr. Acked-by: Jason Wang <jasowang@redhat.com> Acked-by: Eugenio Pérez <eperezma@redhat.com> Signed-off-by: Dragos Tatulea <dtatulea@nvidia.com> Message-Id: <20231018171456.1624030-11-dtatulea@nvidia.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
1 parent a650b1c commit 39f7c12

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

drivers/vdpa/mlx5/core/mlx5_vdpa.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ int mlx5_vdpa_handle_set_map(struct mlx5_vdpa_dev *mvdev, struct vhost_iotlb *io
118118
bool *change_map, unsigned int asid);
119119
int mlx5_vdpa_create_mr(struct mlx5_vdpa_dev *mvdev, struct vhost_iotlb *iotlb,
120120
unsigned int asid);
121-
void mlx5_vdpa_destroy_mr(struct mlx5_vdpa_dev *mvdev);
122-
void mlx5_vdpa_destroy_mr_asid(struct mlx5_vdpa_dev *mvdev, unsigned int asid);
121+
void mlx5_vdpa_destroy_mr_resources(struct mlx5_vdpa_dev *mvdev);
122+
void mlx5_vdpa_destroy_mr(struct mlx5_vdpa_dev *mvdev, unsigned int asid);
123123
int mlx5_vdpa_update_cvq_iotlb(struct mlx5_vdpa_dev *mvdev,
124124
struct vhost_iotlb *iotlb,
125125
unsigned int asid);

drivers/vdpa/mlx5/core/mr.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ static void _mlx5_vdpa_destroy_mr(struct mlx5_vdpa_dev *mvdev, unsigned int asid
507507
mr->initialized = false;
508508
}
509509

510-
void mlx5_vdpa_destroy_mr_asid(struct mlx5_vdpa_dev *mvdev, unsigned int asid)
510+
void mlx5_vdpa_destroy_mr(struct mlx5_vdpa_dev *mvdev, unsigned int asid)
511511
{
512512
struct mlx5_vdpa_mr *mr = &mvdev->mr;
513513

@@ -518,9 +518,9 @@ void mlx5_vdpa_destroy_mr_asid(struct mlx5_vdpa_dev *mvdev, unsigned int asid)
518518
mutex_unlock(&mr->mkey_mtx);
519519
}
520520

521-
void mlx5_vdpa_destroy_mr(struct mlx5_vdpa_dev *mvdev)
521+
void mlx5_vdpa_destroy_mr_resources(struct mlx5_vdpa_dev *mvdev)
522522
{
523-
mlx5_vdpa_destroy_mr_asid(mvdev, mvdev->group2asid[MLX5_VDPA_DATAVQ_GROUP]);
523+
mlx5_vdpa_destroy_mr(mvdev, mvdev->group2asid[MLX5_VDPA_DATAVQ_GROUP]);
524524
prune_iotlb(mvdev);
525525
}
526526

drivers/vdpa/mlx5/net/mlx5_vnet.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2690,7 +2690,7 @@ static int mlx5_vdpa_change_map(struct mlx5_vdpa_dev *mvdev,
26902690
goto err_mr;
26912691

26922692
teardown_driver(ndev);
2693-
mlx5_vdpa_destroy_mr_asid(mvdev, asid);
2693+
mlx5_vdpa_destroy_mr(mvdev, asid);
26942694
err = mlx5_vdpa_create_mr(mvdev, iotlb, asid);
26952695
if (err)
26962696
goto err_mr;
@@ -2706,7 +2706,7 @@ static int mlx5_vdpa_change_map(struct mlx5_vdpa_dev *mvdev,
27062706
return 0;
27072707

27082708
err_setup:
2709-
mlx5_vdpa_destroy_mr_asid(mvdev, asid);
2709+
mlx5_vdpa_destroy_mr(mvdev, asid);
27102710
err_mr:
27112711
return err;
27122712
}
@@ -2847,7 +2847,7 @@ static void mlx5_vdpa_set_status(struct vdpa_device *vdev, u8 status)
28472847
err_driver:
28482848
unregister_link_notifier(ndev);
28492849
err_setup:
2850-
mlx5_vdpa_destroy_mr(&ndev->mvdev);
2850+
mlx5_vdpa_destroy_mr_resources(&ndev->mvdev);
28512851
ndev->mvdev.status |= VIRTIO_CONFIG_S_FAILED;
28522852
err_clear:
28532853
up_write(&ndev->reslock);
@@ -2874,7 +2874,7 @@ static int mlx5_vdpa_reset(struct vdpa_device *vdev)
28742874
unregister_link_notifier(ndev);
28752875
teardown_driver(ndev);
28762876
clear_vqs_ready(ndev);
2877-
mlx5_vdpa_destroy_mr(&ndev->mvdev);
2877+
mlx5_vdpa_destroy_mr_resources(&ndev->mvdev);
28782878
ndev->mvdev.status = 0;
28792879
ndev->mvdev.suspended = false;
28802880
ndev->cur_num_vqs = 0;
@@ -2994,7 +2994,7 @@ static void mlx5_vdpa_free(struct vdpa_device *vdev)
29942994
ndev = to_mlx5_vdpa_ndev(mvdev);
29952995

29962996
free_resources(ndev);
2997-
mlx5_vdpa_destroy_mr(mvdev);
2997+
mlx5_vdpa_destroy_mr_resources(mvdev);
29982998
if (!is_zero_ether_addr(ndev->config.mac)) {
29992999
pfmdev = pci_get_drvdata(pci_physfn(mvdev->mdev->pdev));
30003000
mlx5_mpfs_del_mac(pfmdev, ndev->config.mac);
@@ -3525,7 +3525,7 @@ static int mlx5_vdpa_dev_add(struct vdpa_mgmt_dev *v_mdev, const char *name,
35253525
err_res2:
35263526
free_resources(ndev);
35273527
err_mr:
3528-
mlx5_vdpa_destroy_mr(mvdev);
3528+
mlx5_vdpa_destroy_mr_resources(mvdev);
35293529
err_res:
35303530
mlx5_vdpa_free_resources(&ndev->mvdev);
35313531
err_mpfs:

0 commit comments

Comments
 (0)