summaryrefslogtreecommitdiff
path: root/drivers/vdpa/vdpa_sim
diff options
context:
space:
mode:
authorSi-Wei Liu <si-wei.liu@oracle.com>2023-10-21 12:25:18 +0300
committerMichael S. Tsirkin <mst@redhat.com>2023-11-01 16:20:00 +0300
commit2eacf4b5e3ebe771f0fca0c8913c5a10a1953b72 (patch)
treede9f1df690a740533ca57549433ad9c968148457 /drivers/vdpa/vdpa_sim
parentbc91df5c70ac720eca18bd1f4a288f2582713d3e (diff)
downloadlinux-2eacf4b5e3ebe771f0fca0c8913c5a10a1953b72.tar.xz
vdpa/mlx5: implement .reset_map driver op
Since commit 6f5312f80183 ("vdpa/mlx5: Add support for running with virtio_vdpa"), mlx5_vdpa starts with preallocate 1:1 DMA MR at device creation time. This 1:1 DMA MR will be implicitly destroyed while the first .set_map call is invoked, in which case callers like vhost-vdpa will start to set up custom mappings. When the .reset callback is invoked, the custom mappings will be cleared and the 1:1 DMA MR will be re-created. In order to reduce excessive memory mapping cost in live migration, it is desirable to decouple the vhost-vdpa IOTLB abstraction from the virtio device life cycle, i.e. mappings can be kept around intact across virtio device reset. Leverage the .reset_map callback, which is meant to destroy the regular MR (including cvq mapping) on the given ASID and recreate the initial DMA mapping. That way, the device .reset op runs free from having to maintain and clean up memory mappings by itself. Additionally, implement .compat_reset to cater for older userspace, which may wish to see mapping to be cleared during reset. Co-developed-by: Dragos Tatulea <dtatulea@nvidia.com> Signed-off-by: Dragos Tatulea <dtatulea@nvidia.com> Signed-off-by: Si-Wei Liu <si-wei.liu@oracle.com> Message-Id: <1697880319-4937-7-git-send-email-si-wei.liu@oracle.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Tested-by: Lei Yang <leiyang@redhat.com>
Diffstat (limited to 'drivers/vdpa/vdpa_sim')
0 files changed, 0 insertions, 0 deletions