summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorJason Wang <jasowang@redhat.com>2023-01-19 09:15:21 +0300
committerMichael S. Tsirkin <mst@redhat.com>2023-02-21 03:26:58 +0300
commit2713ea3c7d930aa1ff5ef7d4a57a1e4fcc3b9985 (patch)
tree75cf4887ebbf9cd1f5f27da12bce05125f2e2179 /include/linux
parent759aba1e6e7d238d9d37decd8ad1ecc84ebb02b0 (diff)
downloadlinux-2713ea3c7d930aa1ff5ef7d4a57a1e4fcc3b9985.tar.xz
virtio_ring: per virtqueue dma device
This patch introduces a per virtqueue dma device. This will be used for virtio devices whose virtqueue are backed by different underlayer devices. One example is the vDPA that where the control virtqueue could be implemented through software mediation. Some of the work are actually done before since the helper like vring_dma_device(). This work left are: - Let vring_dma_device() return the per virtqueue dma device instead of the vdev's parent. - Allow passing a dma_device when creating the virtqueue through a new helper, old vring creation helper will keep using vdev's parent. Reviewed-by: Eli Cohen <elic@nvidia.com> Tested-by: Eli Cohen <elic@nvidia.com> Signed-off-by: Jason Wang <jasowang@redhat.com> Message-Id: <20230119061525.75068-2-jasowang@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/virtio_ring.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/linux/virtio_ring.h b/include/linux/virtio_ring.h
index 8b8af1a38991..8b95b69ef694 100644
--- a/include/linux/virtio_ring.h
+++ b/include/linux/virtio_ring.h
@@ -77,6 +77,22 @@ struct virtqueue *vring_create_virtqueue(unsigned int index,
const char *name);
/*
+ * Creates a virtqueue and allocates the descriptor ring with per
+ * virtqueue DMA device.
+ */
+struct virtqueue *vring_create_virtqueue_dma(unsigned int index,
+ unsigned int num,
+ unsigned int vring_align,
+ struct virtio_device *vdev,
+ bool weak_barriers,
+ bool may_reduce_num,
+ bool ctx,
+ bool (*notify)(struct virtqueue *vq),
+ void (*callback)(struct virtqueue *vq),
+ const char *name,
+ struct device *dma_dev);
+
+/*
* Creates a virtqueue with a standard layout but a caller-allocated
* ring.
*/