Skip to content

Commit 07a2da4

Browse files
dtatuleamstsirkin
authored andcommitted
vdpa/mlx5: Rename mr destroy functions
Make mlx5_destroy_mr symmetric to mlx5_create_mr. Acked-by: Jason Wang <[email protected]> Acked-by: Eugenio Pérez <[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 1c06cd5 commit 07a2da4

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
@@ -2684,7 +2684,7 @@ static int mlx5_vdpa_change_map(struct mlx5_vdpa_dev *mvdev,
26842684
goto err_mr;
26852685

26862686
teardown_driver(ndev);
2687-
mlx5_vdpa_destroy_mr_asid(mvdev, asid);
2687+
mlx5_vdpa_destroy_mr(mvdev, asid);
26882688
err = mlx5_vdpa_create_mr(mvdev, iotlb, asid);
26892689
if (err)
26902690
goto err_mr;
@@ -2700,7 +2700,7 @@ static int mlx5_vdpa_change_map(struct mlx5_vdpa_dev *mvdev,
27002700
return 0;
27012701

27022702
err_setup:
2703-
mlx5_vdpa_destroy_mr_asid(mvdev, asid);
2703+
mlx5_vdpa_destroy_mr(mvdev, asid);
27042704
err_mr:
27052705
return err;
27062706
}
@@ -2841,7 +2841,7 @@ static void mlx5_vdpa_set_status(struct vdpa_device *vdev, u8 status)
28412841
err_driver:
28422842
unregister_link_notifier(ndev);
28432843
err_setup:
2844-
mlx5_vdpa_destroy_mr(&ndev->mvdev);
2844+
mlx5_vdpa_destroy_mr_resources(&ndev->mvdev);
28452845
ndev->mvdev.status |= VIRTIO_CONFIG_S_FAILED;
28462846
err_clear:
28472847
up_write(&ndev->reslock);
@@ -2868,7 +2868,7 @@ static int mlx5_vdpa_reset(struct vdpa_device *vdev)
28682868
unregister_link_notifier(ndev);
28692869
teardown_driver(ndev);
28702870
clear_vqs_ready(ndev);
2871-
mlx5_vdpa_destroy_mr(&ndev->mvdev);
2871+
mlx5_vdpa_destroy_mr_resources(&ndev->mvdev);
28722872
ndev->mvdev.status = 0;
28732873
ndev->mvdev.suspended = false;
28742874
ndev->cur_num_vqs = 0;
@@ -2988,7 +2988,7 @@ static void mlx5_vdpa_free(struct vdpa_device *vdev)
29882988
ndev = to_mlx5_vdpa_ndev(mvdev);
29892989

29902990
free_resources(ndev);
2991-
mlx5_vdpa_destroy_mr(mvdev);
2991+
mlx5_vdpa_destroy_mr_resources(mvdev);
29922992
if (!is_zero_ether_addr(ndev->config.mac)) {
29932993
pfmdev = pci_get_drvdata(pci_physfn(mvdev->mdev->pdev));
29942994
mlx5_mpfs_del_mac(pfmdev, ndev->config.mac);
@@ -3518,7 +3518,7 @@ static int mlx5_vdpa_dev_add(struct vdpa_mgmt_dev *v_mdev, const char *name,
35183518
err_res2:
35193519
free_resources(ndev);
35203520
err_mr:
3521-
mlx5_vdpa_destroy_mr(mvdev);
3521+
mlx5_vdpa_destroy_mr_resources(mvdev);
35223522
err_res:
35233523
mlx5_vdpa_free_resources(&ndev->mvdev);
35243524
err_mpfs:

0 commit comments

Comments
 (0)