[PATCH v2 0/4] Guest announce feature emulation using Shadow VirtQueue

Eugenio Pérez posted 4 patches 2 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20221124173314.2123015-1-eperezma@redhat.com
Maintainers: "Michael S. Tsirkin" <mst@redhat.com>, Jason Wang <jasowang@redhat.com>
hw/net/virtio-net.c | 29 ++++++++++++++++-------------
net/vhost-vdpa.c    | 16 ++++++++++++----
2 files changed, 28 insertions(+), 17 deletions(-)
[PATCH v2 0/4] Guest announce feature emulation using Shadow VirtQueue
Posted by Eugenio Pérez 2 weeks ago
A gratuitous ARP is recommended after a live migration to reduce the amount of
time needed by the network links to be aware of the new location. A hypervisor
may not have the knowledge of the guest network configuration, and this is
especially true on passthrough devices, so its simpler to ask the guest to
do it.

However, the device control part of this feature can be totally emulated by
qemu and shadow virtqueue, not needing any special feature from the actual
vdpa device.

The vdpa device must offer VIRTIO_NET_F_STATUS for the guest to access the
status of virtio net config where announcement status bit is set. It is
possible to emulate it as always active in case backend does not support it,
but this is left for the future, as there are not many devices not offering it
anyway.

Patch 1 is less useful now that we don't emulate _F_STATUS anymore but QEMU
coding style seems to prefer early return so leaving it in this version.

v2:
* Actually remove VIRTIO_NET_F_STATUS emulation. Comparing with v1, we offer
  the feature with virtio instead of using virtio/vhost-vdpa.

v1:
* Move code from vhost_net_get_config to virtio_net_get_config.

RFC v2:
* Add VIRTIO_NET_F_STATUS emulation.

Eugenio Pérez (4):
  virtio_net: Modify virtio_net_get_config to early return
  virtio_net: copy VIRTIO_NET_S_ANNOUNCE if device model has it
  vdpa: handle VIRTIO_NET_CTRL_ANNOUNCE in
    vhost_vdpa_net_handle_ctrl_avail
  vdpa: do not handle VIRTIO_NET_F_GUEST_ANNOUNCE in vhost-vdpa

 hw/net/virtio-net.c | 29 ++++++++++++++++-------------
 net/vhost-vdpa.c    | 16 ++++++++++++----
 2 files changed, 28 insertions(+), 17 deletions(-)

-- 
2.31.1