Skip to content

RFC Prefer to use SVQ to stall dataplane at NIC state restore through CVQ

Eugenio Pérez qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest12 patches 12 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/12vhost: add vhost_reset_queue_opinclude/hw/virtio/vhost-backend.h+3 -00 replies
2/12vhost: add vhost_restart_queue_opinclude/hw/virtio/vhost-backend.h+3 -00 replies
3/12vhost_net: Use ops->vhost_restart_queue in vhost_net_virtqueue_restarthw/net/vhost_net.c+7 -51 reply
4/12vhost_net: Use ops->vhost_reset_queue in vhost_net_virtqueue_resethw/net/vhost_net.c+3 -11 reply
5/12vdpa: add vhost_vdpa_set_vring_ready_internalhw/virtio/trace-events hw/virtio/vhost-vdpa.c+10 -40 replies
6/12vdpa: add vhost_vdpa_svq_stophw/virtio/vhost-vdpa.c+13 -70 replies
7/12vdpa: add vhost_vdpa_reset_queuehw/virtio/vhost-vdpa.c+16 -02 replies
8/12vdpa: add vhost_vdpa_svq_starthw/virtio/vhost-vdpa.c+41 -260 replies
9/12vdpa: add vhost_vdpa_restart_queuehw/virtio/vhost-vdpa.c+24 -00 replies
10/12vdpa: enable all vqs if the device support RING_RESET featurenet/vhost-vdpa.c+6 -00 replies
11/12vdpa: use SVQ to stall dataplane while NIC state is being restorednet/vhost-vdpa.c+44 -53 replies
12/12vhost: Allow _F_RING_RESET with shadow virtqueuehw/virtio/vhost-shadow-virtqueue.c+1 -00 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [RFC PATCH 00/12] Prefer to use SVQ to stall dataplane at NIC state restore through CVQ

At this moment the migration of net features that depends on CVQ is not possible, as there is no reliable way to restore the device state like mac address, number of enabled queues, etc to the destination. This is mainly caused because the device must only read CVQ, and process all the commands before resuming the dataplane.

This series uses the VirtIO feature _F_RING_RESET to achieve it, adding an alternative method to late vq enabling proposed in [1][2]. It expose SVQ to the device until it process all the CVQ messages, and then replaces the vring for the guest's one.

As an advantage, it uses a feature well deviced in the VirtIO standard. As a disadvantage, current HW already support the late enabling and it does not support RING_RESET.

This patch must be applied on top of the series ("Enable vdpa net migration with features depending on CVQ") [1][2].

The patch has been tested with vp_vdpa, but using high IOVA instead of a sepparated ID for shadow CVQ and shadow temporal vrings.

[1] Message-id: <[email protected]>
[2] https://lists.nongnu.org/archive/html/qemu-devel/2023-07/msg01325.html

Eugenio Pérez (12):
vhost: add vhost_reset_queue_op
vhost: add vhost_restart_queue_op
vhost_net: Use ops->vhost_restart_queue in vhost_net_virtqueue_restart
vhost_net: Use ops->vhost_reset_queue in vhost_net_virtqueue_reset
vdpa: add vhost_vdpa_set_vring_ready_internal
vdpa: add vhost_vdpa_svq_stop
vdpa: add vhost_vdpa_reset_queue
vdpa: add vhost_vdpa_svq_start
vdpa: add vhost_vdpa_restart_queue
vdpa: enable all vqs if the device support RING_RESET feature
vdpa: use SVQ to stall dataplane while NIC state is being restored
vhost: Allow _F_RING_RESET with shadow virtqueue

 include/hw/virtio/vhost-backend.h  |   6 ++
 hw/net/vhost_net.c                 |  16 ++--
 hw/virtio/vhost-shadow-virtqueue.c |   1 +
 hw/virtio/vhost-vdpa.c             | 139 +++++++++++++++++++++--------
 net/vhost-vdpa.c                   |  55 ++++++++++--
 hw/virtio/trace-events             |   2 +-
 6 files changed, 171 insertions(+), 48 deletions(-)
Signature · 1 line
2.39.3