OSDN Git Service

vhost-vdpa: batch updating IOTLB mappings
authorJason Wang <jasowang@redhat.com>
Mon, 7 Sep 2020 10:49:03 +0000 (18:49 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 29 Sep 2020 06:14:29 +0000 (02:14 -0400)
commita5bd05800f8659851d9d0a1546726e16b7da9db3
tree5188269fbdeb733e563d73f743dc374f5404c825
parentb37556edec8372bef83959901fc142a272a7e1fa
vhost-vdpa: batch updating IOTLB mappings

To speed up the memory mapping updating between vhost-vDPA and vDPA
device driver, this patch passes the IOTLB batching flags via IOTLB
API. Two new flags was introduced, VHOST_IOTLB_BATCH_BEGIN is a hint
that a bathced IOTLB updating may be initiated from the
userspace. VHOST_IOTLB_BATCH_END is a hint that userspace has finished
the updating:

VHOST_IOTLB_BATCH_BEGIN
VHOST_IOTLB_UPDATE/VHOST_IOTLB_INVALIDATE
...
VHOST_IOTLB_BATCH_END

Vhost-vDPA can then know that all mappings has been set and can do
optimization like passing all the mappings to the vDPA device driver.

Signed-off-by: Jason Wang <jasowang@redhat.com>
Message-Id: <20200907104903.31551-4-jasowang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/virtio/vhost-vdpa.c
include/hw/virtio/vhost-vdpa.h