Skip to content

vDPA: doorbell mapping

Jason Wang kvm lkml netdev oe-kbuild-all virtio-dev virtualization 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 30 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6vhost: allow device that does not depend on vhost workerdrivers/vhost/net.c drivers/vhost/scsi.c drivers/vhost/vdpa.c +3 more+31 -172 replies
2/6vhost: use mmgrab() instead of mmget() for non worker devicedrivers/vhost/vhost.c+34 -80 replies
3/6vdpa: introduce get_vq_notification methodinclude/linux/vdpa.h+16 -00 replies
4/6vhost_vdpa: support doorbell mapping via mmapdrivers/vhost/vdpa.c+59 -010 replies
5/6vdpa: introduce virtio pci driverdrivers/vdpa/Kconfig drivers/vdpa/Makefile drivers/vdpa/vp_vdpa/Makefile +1 more+592 -018 replies
6/6vdpa: vp_vdpa: report doorbell locationdrivers/vdpa/vp_vdpa/vp_vdpa.c+25 -40 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/6] vDPA: doorbell mapping

Hi all:

This series introduce basic functionality of doorbell mapping support for vhost-vDPA. Userspace program may use mmap() to map a the doorbell of a specific virtqueue into its address space. This is help to reudce the syscall or vmexit overhead.

A new vdpa_config_ops was introduced to report the location of the doorbell, vhost_vdpa may then choose to map the doorbell when:

- The doorbell register is localted at page boundary
- The doorbell register does not share page with non doorbell registers.

With these two requriements, doorbells layout could be modelled more easily from guest (e.g Qemu's page-per-vq model) and it would be more safe to avoid exposing other registers to userspace directly.

IFCVF was reported to support this feature but unfortuantely the one I used does not meet those requirements. So a new virtio-pci driver for vDPA bus is introduced, and I verify this with page-per-vq=on with a userspace vhost-vdpa driver in guest.

Please review.

Thanks

Jason Wang (6):
vhost: allow device that does not depend on vhost worker
vhost: use mmgrab() instead of mmget() for non worker device
vdpa: introduce get_vq_notification method
vhost_vdpa: support doorbell mapping via mmap
vdpa: introduce virtio pci driver
vdpa: vp_vdpa: report doorbell location

 drivers/vdpa/Kconfig           |   6 +
 drivers/vdpa/Makefile          |   1 +
 drivers/vdpa/vp_vdpa/Makefile  |   2 +
 drivers/vdpa/vp_vdpa/vp_vdpa.c | 604 +++++++++++++++++++++++++++++++++
 drivers/vhost/net.c            |   2 +-
 drivers/vhost/scsi.c           |   2 +-
 drivers/vhost/vdpa.c           |  61 +++-
 drivers/vhost/vhost.c          |  80 +++--
 drivers/vhost/vhost.h          |   2 +
 drivers/vhost/vsock.c          |   2 +-
 include/linux/vdpa.h           |  16 +
 11 files changed, 753 insertions(+), 25 deletions(-)
 create mode 100644 drivers/vdpa/vp_vdpa/Makefile
 create mode 100644 drivers/vdpa/vp_vdpa/vp_vdpa.c
Signature · 1 line
2.20.1