Skip to content

virtio_ring: per virtqueue DMA device

Jason Wang lkml virtualization 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest5 patches 1 replyIn review
  2. v15 patches 14 repliesSuperseded

Changes in v2 from the cover letter

- make mlx5_get_vq_dma_dev() static

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5virtio_ring: per virtqueue dma devicedrivers/virtio/virtio_ring.c include/linux/virtio_ring.h+109 -400 replies
2/5vdpa: introduce get_vq_dma_device()include/linux/vdpa.h+6 -00 replies
3/5virtio-vdpa: support per vq dma devicedrivers/virtio/virtio_vdpa.c+10 -30 replies
4/5vdpa: set dma mask for vDPA devicedrivers/vdpa/vdpa.c+5 -00 replies
5/5vdpa: mlx5: support per virtqueue dma devicedrivers/vdpa/mlx5/net/mlx5_vnet.c+11 -01 reply

Reviews trailers per patch

All 5 patches have a Reviewed-by or Acked-by.

PatchEli Cohen
1/5R-b T-b
2/5R-b T-b
3/5R-b T-b
4/5R-b T-b
5/5R-b T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH V2 0/5] virtio_ring: per virtqueue DMA device

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.

Changes since V1:
- make mlx5_get_vq_dma_dev() static

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(-)
Signature · 6 lines
2.25.1

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization