On Wed, Aug 13, 2025 at 4:58 PM Michael S. Tsirkin <m...@redhat.com> wrote: > > On Wed, Aug 13, 2025 at 01:48:26PM +0800, Jason Wang wrote: > > Following patch will introduce the mapping operations for virtio > > device. In order to achieve this, besides the dma device, virtio core > > needs to support a transport or device specific mapping token as well. > > So this patch introduces a union container of a dma device and opaque > > mapping token. The idea is the allow the transport layer to pass > > device specific mapping token which will be used as a parameter for > > the virtio mapping operations. For the transport or device that is > > using DMA, dma device is still being used. > > > > Signed-off-by: Jason Wang <jasow...@redhat.com> > > --- > > drivers/virtio/virtio_ring.c | 110 ++++++++++++++++++----------------- > > drivers/virtio/virtio_vdpa.c | 6 +- > > include/linux/virtio.h | 7 +++ > > include/linux/virtio_ring.h | 7 ++- > > 4 files changed, 72 insertions(+), 58 deletions(-) > > > > diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c > > index 482a268af851..fb1d407d5f1b 100644 > > --- a/drivers/virtio/virtio_ring.c > > +++ b/drivers/virtio/virtio_ring.c > > @@ -210,8 +210,7 @@ struct vring_virtqueue { > > /* DMA, allocation, and size information */ > > bool we_own_ring; > > > > - /* Device used for doing DMA */ > > - struct device *dma_dev; > > + union vring_mapping_token mapping_token; > > For name I don't much like "token". and it's not just > mapping right? maybe it is just union virtio_dma ? >
It's not limited to dma, maybe virtio_map? (I'm fine with either). Thanks