mbox series

[0/7] Guest announce feature emulation using Shadow VirtQueue

Message ID 20221020103429.347525-1-eperezma@redhat.com (mailing list archive)
Headers show
Series Guest announce feature emulation using Shadow VirtQueue | expand

Message

Eugenio Perez Martin Oct. 20, 2022, 10:34 a.m. UTC
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.

VIRTIO_NET_F_STATUS is also needed for the guest to access the status of
virtio net config where announcement status bit is set. Emulating it as
always active in case backend does not support it.

This series need two fixes applied:
* https://lists.nongnu.org/archive/html/qemu-devel/2022-10/msg03242.html
* https://lists.nongnu.org/archive/html/qemu-devel/2022-10/msg03241.html

v1:
* Move code from vhost_net_get_config to virtio_net_get_config.

RFC v2:
* Add VIRTIO_NET_F_STATUS emulation.

Eugenio Pérez (7):
  vdpa: Save emulated features list in vhost_vdpa
  virtio_net: Modify virtio_net_get_config to early return
  virtio_net: Handle _F_STATUS emulation in virtio_net_get_config
  vdpa: Expose VIRTIO_NET_F_STATUS unconditionally
  vdpa: handle VIRTIO_NET_CTRL_ANNOUNCE in
    vhost_vdpa_net_handle_ctrl_avail
  virtio_net: copy VIRTIO_NET_S_ANNOUNCE if device model has it
  vdpa: Offer VIRTIO_NET_F_GUEST_ANNOUNCE feature if SVQ is enabled

 include/hw/virtio/vhost-vdpa.h |  2 ++
 hw/net/virtio-net.c            | 40 +++++++++++++++++++++-------------
 hw/virtio/vhost-vdpa.c         |  8 +++----
 net/vhost-vdpa.c               | 25 ++++++++++++++++++---
 4 files changed, 53 insertions(+), 22 deletions(-)

Comments

Michael S. Tsirkin Oct. 26, 2022, 8:46 p.m. UTC | #1
On Thu, Oct 20, 2022 at 12:34:22PM +0200, Eugenio Pérez wrote:
> 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.
> 
> VIRTIO_NET_F_STATUS is also needed for the guest to access the status of
> virtio net config where announcement status bit is set. Emulating it as
> always active in case backend does not support it.
> 
> This series need two fixes applied:
> * https://lists.nongnu.org/archive/html/qemu-devel/2022-10/msg03242.html
> * https://lists.nongnu.org/archive/html/qemu-devel/2022-10/msg03241.html


Jason you seem to have queued these so you will have to take
this patchset too.

Reviewed-by: Michael S. Tsirkin <mst@redhat.com>



> v1:
> * Move code from vhost_net_get_config to virtio_net_get_config.
> 
> RFC v2:
> * Add VIRTIO_NET_F_STATUS emulation.
> 
> Eugenio Pérez (7):
>   vdpa: Save emulated features list in vhost_vdpa
>   virtio_net: Modify virtio_net_get_config to early return
>   virtio_net: Handle _F_STATUS emulation in virtio_net_get_config
>   vdpa: Expose VIRTIO_NET_F_STATUS unconditionally
>   vdpa: handle VIRTIO_NET_CTRL_ANNOUNCE in
>     vhost_vdpa_net_handle_ctrl_avail
>   virtio_net: copy VIRTIO_NET_S_ANNOUNCE if device model has it
>   vdpa: Offer VIRTIO_NET_F_GUEST_ANNOUNCE feature if SVQ is enabled
> 
>  include/hw/virtio/vhost-vdpa.h |  2 ++
>  hw/net/virtio-net.c            | 40 +++++++++++++++++++++-------------
>  hw/virtio/vhost-vdpa.c         |  8 +++----
>  net/vhost-vdpa.c               | 25 ++++++++++++++++++---
>  4 files changed, 53 insertions(+), 22 deletions(-)
> 
> -- 
> 2.31.1
>