Skip to content

RFC virtio,vhost: Add VIRTIO_F_NOTIFICATION_DATA support

Jonah Palmer qemu-devel virtio-fs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest8 patches 17 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8virtio/virtio-pci: Handle extra notification datahw/virtio/virtio-pci.c hw/virtio/virtio.c include/hw/virtio/virtio.h+24 -36 replies
2/8virtio-pci: Lock ioeventfd state with VIRTIO_F_NOTIFICATION_DATAhw/virtio/virtio-pci.c+4 -21 reply
3/8virtio-mmio: Handle extra notification datahw/virtio/virtio-mmio.c+10 -20 replies
4/8virtio-mmio: Lock ioeventfd state with VIRTIO_F_NOTIFICATION_DATAhw/virtio/virtio-mmio.c+4 -20 replies
5/8virtio-ccw: Handle extra notification datahw/s390x/s390-virtio-ccw.c+14 -41 reply
6/8virtio-ccw: Lock ioeventfd state with VIRTIO_F_NOTIFICATION_DATAhw/s390x/virtio-ccw.c+4 -21 reply
7/8vhost/vhost-user: Add VIRTIO_F_NOTIFICATION_DATA to vhost feature bitshw/block/vhost-user-blk.c hw/net/vhost_net.c hw/scsi/vhost-scsi.c +4 more+8 -12 replies
8/8virtio: Add VIRTIO_F_NOTIFICATION_DATA property definitioninclude/hw/virtio/virtio.h+3 -11 reply

Reviews trailers per patch

5 of 8 patches have a Reviewed-by or Acked-by.

PatchEugenio PérezThomas Huth
1/8
2/8R-b
3/8
4/8
5/8A-b
6/8A-b
7/8R-b
8/8R-b

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

Read the v1 thread

Cover letter [RFC 0/8] virtio,vhost: Add VIRTIO_F_NOTIFICATION_DATA support

The goal of these patches are to add support to a variety of virtio and vhost devices for the VIRTIO_F_NOTIFICATION_DATA transport feature. This feature indicates that a driver will pass extra data (instead of just a virtqueue's index) when notifying the corresponding device.

The data passed in by the driver when this feature is enabled varies in format depending on if the device is using a split or packed virtqueue layout:

Split VQ
- Upper 16 bits: last_avail_idx
- Lower 16 bits: virtqueue index

Packed VQ
- Upper 16 bits: 1-bit wrap counter & 15-bit last_avail_idx
- Lower 16 bits: virtqueue index

Also, due to the limitations of ioeventfd not being able to carry the extra provided by the driver, ioeventfd is left disabled for any devices using this feature.

A significant aspect of this effort has been to maintain compatibility across different backends. As such, the feature is offered by backend devices only when supported, with fallback mechanisms where backend support is absent.

Jonah Palmer (8):
virtio/virtio-pci: Handle extra notification data
virtio-pci: Lock ioeventfd state with VIRTIO_F_NOTIFICATION_DATA
virtio-mmio: Handle extra notification data
virtio-mmio: Lock ioeventfd state with VIRTIO_F_NOTIFICATION_DATA
virtio-ccw: Handle extra notification data
virtio-ccw: Lock ioeventfd state with VIRTIO_F_NOTIFICATION_DATA vhost/vhost-user: Add VIRTIO_F_NOTIFICATION_DATA to vhost feature bits
virtio: Add VIRTIO_F_NOTIFICATION_DATA property definition

 hw/block/vhost-user-blk.c    |  1 +
 hw/net/vhost_net.c           |  2 ++
 hw/s390x/s390-virtio-ccw.c   | 18 ++++++++++++++----
 hw/s390x/virtio-ccw.c        |  6 ++++--
 hw/scsi/vhost-scsi.c         |  1 +
 hw/scsi/vhost-user-scsi.c    |  1 +
 hw/virtio/vhost-user-fs.c    |  2 +-
 hw/virtio/vhost-user-vsock.c |  1 +
 hw/virtio/virtio-mmio.c      | 18 ++++++++++++++----
 hw/virtio/virtio-pci.c       | 19 ++++++++++++++-----
 hw/virtio/virtio.c           | 13 +++++++++++++
 include/hw/virtio/virtio.h   |  5 ++++-
 net/vhost-vdpa.c             |  1 +
 13 files changed, 71 insertions(+), 17 deletions(-)
Signature · 1 line
2.39.3