]> git.ipfire.org Git - thirdparty/qemu.git/commit
virtio-net: Add queues for RSS during migration
authorAkihiko Odaki <akihiko.odaki@daynix.com>
Fri, 30 May 2025 05:18:53 +0000 (14:18 +0900)
committerJason Wang <jasowang@redhat.com>
Mon, 14 Jul 2025 05:26:52 +0000 (13:26 +0800)
commitadda0ad56bd28d5a809051cbd190fda5798ec4e4
treed3090db2cbb9abb71037bcfbd0958f420b2b7cd5
parent110d0fa2d4d1f754242f6775baec43776a9adb35
virtio-net: Add queues for RSS during migration

virtio_net_pre_load_queues() inspects vdev->guest_features to tell if
VIRTIO_NET_F_RSS or VIRTIO_NET_F_MQ is enabled to infer the required
number of queues. This works for VIRTIO_NET_F_MQ but it doesn't for
VIRTIO_NET_F_RSS because only the lowest 32 bits of vdev->guest_features
is set at the point and VIRTIO_NET_F_RSS uses bit 60 while
VIRTIO_NET_F_MQ uses bit 22.

Instead of inferring the required number of queues from
vdev->guest_features, use the number loaded from the vm state. This
change also has a nice side effect to remove a duplicate peer queue
pair change by circumventing virtio_net_set_multiqueue().

Also update the comment in include/hw/virtio/virtio.h to prevent an
implementation of pre_load_queues() from refering to any fields being
loaded during migration by accident in the future.

Fixes: 8c49756825da ("virtio-net: Add only one queue pair when realizing")
Tested-by: Lei Yang <leiyang@redhat.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
hw/net/virtio-net.c
hw/virtio/virtio.c
include/hw/virtio/virtio.h