virtio_ring: per virtqueue dma device
authorJason Wang <jasowang@redhat.com>
Thu, 19 Jan 2023 06:15:21 +0000 (14:15 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 21 Feb 2023 00:26:58 +0000 (19:26 -0500)
commit2713ea3c7d930aa1ff5ef7d4a57a1e4fcc3b9985
tree75cf4887ebbf9cd1f5f27da12bce05125f2e2179
parent759aba1e6e7d238d9d37decd8ad1ecc84ebb02b0
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>
drivers/virtio/virtio_ring.c
include/linux/virtio_ring.h