Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

vdpa: introduce get_vq_notification method

This patch introduces a new method in the vdpa_config_ops which
reports the physical address and the size of the doorbell for a
specific virtqueue.

This will be used by the future patches that maps doorbell to
userspace.

Signed-off-by: Jason Wang <jasowang@redhat.com>
Link: https://lore.kernel.org/r/20200529080303.15449-4-jasowang@redhat.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

authored by

Jason Wang and committed by
Michael S. Tsirkin
c25a26e6 5ce995f3

+16
+16
include/linux/vdpa.h
··· 18 18 }; 19 19 20 20 /** 21 + * vDPA notification area 22 + * @addr: base address of the notification area 23 + * @size: size of the notification area 24 + */ 25 + struct vdpa_notification_area { 26 + resource_size_t addr; 27 + resource_size_t size; 28 + }; 29 + 30 + /** 21 31 * vDPA device - representation of a vDPA device 22 32 * @dev: underlying device 23 33 * @dma_dev: the actual device that is performing DMA ··· 83 73 * @vdev: vdpa device 84 74 * @idx: virtqueue index 85 75 * Returns virtqueue state (last_avail_idx) 76 + * @get_vq_notification: Get the notification area for a virtqueue 77 + * @vdev: vdpa device 78 + * @idx: virtqueue index 79 + * Returns the notifcation area 86 80 * @get_vq_align: Get the virtqueue align requirement 87 81 * for the device 88 82 * @vdev: vdpa device ··· 176 162 bool (*get_vq_ready)(struct vdpa_device *vdev, u16 idx); 177 163 int (*set_vq_state)(struct vdpa_device *vdev, u16 idx, u64 state); 178 164 u64 (*get_vq_state)(struct vdpa_device *vdev, u16 idx); 165 + struct vdpa_notification_area 166 + (*get_vq_notification)(struct vdpa_device *vdev, u16 idx); 179 167 180 168 /* Device ops */ 181 169 u32 (*get_vq_align)(struct vdpa_device *vdev);