a5bd05800f
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>
28 lines
641 B
C
28 lines
641 B
C
/*
|
|
* vhost-vdpa.h
|
|
*
|
|
* Copyright(c) 2017-2018 Intel Corporation.
|
|
* Copyright(c) 2020 Red Hat, Inc.
|
|
*
|
|
* This work is licensed under the terms of the GNU GPL, version 2 or later.
|
|
* See the COPYING file in the top-level directory.
|
|
*
|
|
*/
|
|
|
|
#ifndef HW_VIRTIO_VHOST_VDPA_H
|
|
#define HW_VIRTIO_VHOST_VDPA_H
|
|
|
|
#include "hw/virtio/virtio.h"
|
|
|
|
typedef struct vhost_vdpa {
|
|
int device_fd;
|
|
uint32_t msg_type;
|
|
MemoryListener listener;
|
|
struct vhost_dev *dev;
|
|
} VhostVDPA;
|
|
|
|
extern AddressSpace address_space_memory;
|
|
extern int vhost_vdpa_get_device_id(struct vhost_dev *dev,
|
|
uint32_t *device_id);
|
|
#endif
|