virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] virtio_ring: per virtqueue DMA device
@ 2023-01-11  6:28 Jason Wang
  2023-01-11  6:28 ` [PATCH 1/5] virtio_ring: per virtqueue dma device Jason Wang
                   ` (5 more replies)
  0 siblings, 6 replies; 13+ messages in thread
From: Jason Wang @ 2023-01-11  6:28 UTC (permalink / raw)
  To: mst, jasowang; +Cc: gdawar, elic, linux-kernel, tanuj.kamde, virtualization

Hi All:

In some cases, the virtqueue could be backed by different devices. One
example is that in the case of vDPA some parent may emualte virtqueue
via vringh. In this case, it would be wrong if we stick with the
physical DMA device for software emulated device, since there's no
easy way for vringh to know about the hardware IOMMU mappings.

So this series tries to introduce per virtqueue DMA device, then
software virtqueues can utilize the transport specific method to
assign appropirate DMA device.

This fixes the crash of mlx5_vdpa + virtio_vdpa when platform IOMMU is
enabled but not in the passthrough mode. The reason for the crash is
that the virito_ring tries to map the control virtqueue into platform
IOMMU but the vringh assumes a direct mapping (PA as IOVA). This is
fixed by advetise the vDPA device that doesnt do DMA (without a DMA
ops). So DMA API can go with the direct mapping then the vringh will
be happy since mlx5_vdpa assuems a direct/identical mapping by
default.

Please review.

Thanks

Jason Wang (5):
  virtio_ring: per virtqueue dma device
  vdpa: introduce get_vq_dma_device()
  virtio-vdpa: support per vq dma device
  vdpa: set dma mask for vDPA device
  vdpa: mlx5: support per virtqueue dma device

 drivers/vdpa/mlx5/net/mlx5_vnet.c |  11 +++
 drivers/vdpa/vdpa.c               |   5 ++
 drivers/virtio/virtio_ring.c      | 133 +++++++++++++++++++++---------
 drivers/virtio/virtio_vdpa.c      |  13 ++-
 include/linux/vdpa.h              |   6 ++
 include/linux/virtio_ring.h       |  16 ++++
 6 files changed, 141 insertions(+), 43 deletions(-)

-- 
2.25.1

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2023-01-16  2:49 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-11  6:28 [PATCH 0/5] virtio_ring: per virtqueue DMA device Jason Wang
2023-01-11  6:28 ` [PATCH 1/5] virtio_ring: per virtqueue dma device Jason Wang
     [not found]   ` <DM8PR12MB5400E61C7E968AC7604556EBABFC9@DM8PR12MB5400.namprd12.prod.outlook.com>
2023-01-11 13:52     ` Michael S. Tsirkin
     [not found]       ` <DM8PR12MB54008B92885A8971C4CFED0EABFC9@DM8PR12MB5400.namprd12.prod.outlook.com>
2023-01-11 14:54         ` Michael S. Tsirkin
     [not found]           ` <DM8PR12MB54005A89EB05BF46AD7D2DFEABFC9@DM8PR12MB5400.namprd12.prod.outlook.com>
2023-01-11 16:26             ` Michael S. Tsirkin
2023-01-11  6:28 ` [PATCH 2/5] vdpa: introduce get_vq_dma_device() Jason Wang
2023-01-11  6:28 ` [PATCH 3/5] virtio-vdpa: support per vq dma device Jason Wang
2023-01-11  6:28 ` [PATCH 4/5] vdpa: set dma mask for vDPA device Jason Wang
2023-01-11  6:28 ` [PATCH 5/5] vdpa: mlx5: support per virtqueue dma device Jason Wang
2023-01-11 12:38   ` kernel test robot
2023-01-12  2:07   ` kernel test robot
     [not found]   ` <DM8PR12MB5400D84460E084D3459B49B1ABC09@DM8PR12MB5400.namprd12.prod.outlook.com>
2023-01-16  2:49     ` Jason Wang
     [not found] ` <DM8PR12MB540054712BACEF34E065C2BBABFC9@DM8PR12MB5400.namprd12.prod.outlook.com>
2023-01-12  4:03   ` [PATCH 0/5] virtio_ring: per virtqueue DMA device Jason Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).