diff options
author | Jason Wang <jasowang@redhat.com> | 2020-08-04 19:20:40 +0300 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2020-08-06 01:39:18 +0300 |
commit | 25abc060d282132ea5c945392f900dca0a7e9bbb (patch) | |
tree | 20a86393e136ddaa5c70869e3057efb776f90ed5 /include/uapi/linux/vhost.h | |
parent | 653055b9acd45d602435f2f70b7a85cb3130f018 (diff) | |
download | linux-25abc060d282132ea5c945392f900dca0a7e9bbb.tar.xz |
vhost-vdpa: support IOTLB batching hints
This patches extend the vhost IOTLB API to accept batch updating hints
form userspace. When userspace wants update the device IOTLB in a
batch, it may do:
1) Write vhost_iotlb_msg with VHOST_IOTLB_BATCH_BEGIN flag
2) Perform a batch of IOTLB updating via VHOST_IOTLB_UPDATE/INVALIDATE
3) Write vhost_iotlb_msg with VHOST_IOTLB_BATCH_END flag
Vhost-vdpa may decide to batch the IOMMU/IOTLB updating in step 3 when
vDPA device support set_map() ops. This is useful for the vDPA device
that want to know all the mappings to tweak their own DMA translation
logic.
For vDPA device that doesn't require set_map(), no behavior changes.
This capability is advertised via VHOST_BACKEND_F_IOTLB_BATCH capability.
Signed-off-by: Jason Wang <jasowang@redhat.com>
Link: https://lore.kernel.org/r/20200804162048.22587-5-eli@mellanox.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'include/uapi/linux/vhost.h')
-rw-r--r-- | include/uapi/linux/vhost.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/uapi/linux/vhost.h b/include/uapi/linux/vhost.h index 0c2349612e77..75232185324a 100644 --- a/include/uapi/linux/vhost.h +++ b/include/uapi/linux/vhost.h @@ -91,6 +91,8 @@ /* Use message type V2 */ #define VHOST_BACKEND_F_IOTLB_MSG_V2 0x1 +/* IOTLB can accept batching hints */ +#define VHOST_BACKEND_F_IOTLB_BATCH 0x2 #define VHOST_SET_BACKEND_FEATURES _IOW(VHOST_VIRTIO, 0x25, __u64) #define VHOST_GET_BACKEND_FEATURES _IOR(VHOST_VIRTIO, 0x26, __u64) |