summaryrefslogtreecommitdiff
path: root/drivers/vdpa/mlx5/net
diff options
context:
space:
mode:
authorDragos Tatulea <dtatulea@nvidia.com>2023-10-18 20:14:45 +0300
committerMichael S. Tsirkin <mst@redhat.com>2023-11-01 16:19:56 +0300
commit512c0cdd80c19ec11f6dbe769d5899dcfefcd5c9 (patch)
tree9ee20a3a3df866b806bb9429fc1a5b7ee58a60b6 /drivers/vdpa/mlx5/net
parent049cbeab861ef483e39f1f65540305400d33771a (diff)
downloadlinux-512c0cdd80c19ec11f6dbe769d5899dcfefcd5c9.tar.xz
vdpa/mlx5: Decouple cvq iotlb handling from hw mapping code
The handling of the cvq iotlb is currently coupled with the creation and destruction of the hardware mkeys (mr). This patch moves cvq iotlb handling into its own function and shifts it to a scope that is not related to mr handling. As cvq handling is just a prune_iotlb + dup_iotlb cycle, put it all in the same "update" function. Finally, the destruction path is handled by directly pruning the iotlb. After this move is done the ASID mr code can be collapsed into a single function. 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-8-dtatulea@nvidia.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Si-Wei Liu <si-wei.liu@oracle.com> Tested-by: Si-Wei Liu <si-wei.liu@oracle.com> Tested-by: Lei Yang <leiyang@redhat.com>
Diffstat (limited to 'drivers/vdpa/mlx5/net')
-rw-r--r--drivers/vdpa/mlx5/net/mlx5_vnet.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c b/drivers/vdpa/mlx5/net/mlx5_vnet.c
index 3f3c9542e878..27ed237a3897 100644
--- a/drivers/vdpa/mlx5/net/mlx5_vnet.c
+++ b/drivers/vdpa/mlx5/net/mlx5_vnet.c
@@ -2928,10 +2928,13 @@ static int set_map_data(struct mlx5_vdpa_dev *mvdev, struct vhost_iotlb *iotlb,
return err;
}
- if (change_map)
+ if (change_map) {
err = mlx5_vdpa_change_map(mvdev, iotlb, asid);
+ if (err)
+ return err;
+ }
- return err;
+ return mlx5_vdpa_update_cvq_iotlb(mvdev, iotlb, asid);
}
static int mlx5_vdpa_set_map(struct vdpa_device *vdev, unsigned int asid,