Skip to content

RFC Dinamycally switch to vhost shadow virtqueues at vdpa net migration

Eugenio Pérez qemu-devel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 RFC Latest13 patches 62 repliesIn review
  2. v1 RFC8 patches 6 repliesSuperseded

Changes in v2 from the cover letter

- Use a migration listener instead of a memory listener to know when the migration starts.
- Add stuff not picked with ASID patches, like enable rings after driver_ok
- Add rewinding on the migration src, not in dst
- v1 at https://lists.gnu.org/archive/html/qemu-devel/2022-08/msg01664.html

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/13vdpa: fix VHOST_BACKEND_F_IOTLB_ASID flag checknet/vhost-vdpa.c+1 -13 replies
2/13vdpa net: move iova tree creation from init to startnet/vhost-vdpa.c+71 -305 replies
3/13vdpa: copy cvq shadow_data from data vqs, not from x-svqnet/vhost-vdpa.c+6 -10 replies
4/13vdpa: rewind at get_base, not set_basehw/virtio/vhost-vdpa.c hw/virtio/vhost.c include/hw/virtio/vhost-backend.h+36 -176 replies
5/13vdpa net: add migration blocker if cannot migrate cvqnet/vhost-vdpa.c+29 -66 replies
6/13vhost: delay set_vring_ready after DRIVER_OKhw/net/vhost_net.c+12 -59 replies
7/13vdpa: delay set_vring_ready after DRIVER_OKhw/net/vhost_net.c hw/virtio/vhost-vdpa.c+12 -40 replies
8/13vdpa: Negotiate _F_SUSPEND featurehw/virtio/vhost-vdpa.c+2 -14 replies
9/13vdpa: add feature_log parameter to vhost_vdpahw/virtio/vhost-vdpa.c include/hw/virtio/vhost-vdpa.h+2 -10 replies
10/13vdpa net: allow VHOST_F_LOG_ALLnet/vhost-vdpa.c+2 -01 reply
11/13vdpa: add vdpa net migration state notifiernet/vhost-vdpa.c+84 -014 replies
12/13vdpa: preemptive kick at enablehw/virtio/vhost-vdpa.c+5 -011 replies
13/13vdpa: Conditionally expose _F_LOG in vhost_net devicesnet/vhost-vdpa.c+19 -30 replies

Reviews trailers per patch

4 of 13 patches have a Reviewed-by or Acked-by.

PatchJason Wang
1/13A-b
2/13A-b
3/13
4/13
5/13
6/13
7/13
8/13A-b
9/13
10/13A-b
11/13
12/13
13/13

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

Read the v2 thread

Cover letter [RFC v2 00/13] Dinamycally switch to vhost shadow virtqueues at vdpa net migration

It's possible to migrate vdpa net devices if they are shadowed from the start. But to always shadow the dataplane is effectively break its host passthrough, so its not convenient in vDPA scenarios.

This series enables dynamically switching to shadow mode only at migration time. This allow full data virtqueues passthrough all the time qemu is not migrating.

Successfully tested with vdpa_sim_net (but it needs some patches, I will send them soon) and qemu emulated device with vp_vdpa with some restrictions:
* No CVQ.
* VIRTIO_RING_F_STATE patches.
* Expose _F_SUSPEND, but ignore it and suspend on ring state fetch like DPDK.

Comments are welcome, especially in the patcheswith RFC in the message.

v2:
- Use a migration listener instead of a memory listener to know when the migration starts.
- Add stuff not picked with ASID patches, like enable rings after driver_ok
- Add rewinding on the migration src, not in dst
- v1 at https://lists.gnu.org/archive/html/qemu-devel/2022-08/msg01664.html

Eugenio Pérez (13):
vdpa: fix VHOST_BACKEND_F_IOTLB_ASID flag check vdpa net: move iova tree creation from init to start
vdpa: copy cvq shadow_data from data vqs, not from x-svq
vdpa: rewind at get_base, not set_base
vdpa net: add migration blocker if cannot migrate cvq
vhost: delay set_vring_ready after DRIVER_OK
vdpa: delay set_vring_ready after DRIVER_OK
vdpa: Negotiate _F_SUSPEND feature
vdpa: add feature_log parameter to vhost_vdpa vdpa net: allow VHOST_F_LOG_ALL
vdpa: add vdpa net migration state notifier
vdpa: preemptive kick at enable
vdpa: Conditionally expose _F_LOG in vhost_net devices

 include/hw/virtio/vhost-backend.h |   4 +
 include/hw/virtio/vhost-vdpa.h    |   1 +
 hw/net/vhost_net.c                |  25 ++-
 hw/virtio/vhost-vdpa.c            |  64 +++++---
 hw/virtio/vhost.c                 |   3 +
 net/vhost-vdpa.c                  | 247 +++++++++++++++++++++++++-----
 6 files changed, 278 insertions(+), 66 deletions(-)
Signature · 1 line
2.31.1