[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stable-7.2.11 35/41] virtio-net: Fix vhost virtqueue notifiers for RSS
From: |
Michael Tokarev |
Subject: |
[Stable-7.2.11 35/41] virtio-net: Fix vhost virtqueue notifiers for RSS |
Date: |
Wed, 10 Apr 2024 08:43:56 +0300 |
From: Akihiko Odaki <akihiko.odaki@daynix.com>
virtio_net_guest_notifier_pending() and virtio_net_guest_notifier_mask()
checked VIRTIO_NET_F_MQ to know there are multiple queues, but
VIRTIO_NET_F_RSS also enables multiple queues. Refer to n->multiqueue,
which is set to true either of VIRTIO_NET_F_MQ or VIRTIO_NET_F_RSS is
enabled.
Fixes: 68b0a6395f36 ("virtio-net: align ctrl_vq index for non-mq guest for
vhost_vdpa")
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
(cherry picked from commit 1c188fc8cbffc5f05cc616cab4e1372fb6e6f11f)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 412cba4927..57d5a377c8 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -3307,7 +3307,7 @@ static bool
virtio_net_guest_notifier_pending(VirtIODevice *vdev, int idx)
VirtIONet *n = VIRTIO_NET(vdev);
NetClientState *nc;
assert(n->vhost_started);
- if (!virtio_vdev_has_feature(vdev, VIRTIO_NET_F_MQ) && idx == 2) {
+ if (!n->multiqueue && idx == 2) {
/* Must guard against invalid features and bogus queue index
* from being set by malicious guest, or penetrated through
* buggy migration stream.
@@ -3330,7 +3330,7 @@ static void virtio_net_guest_notifier_mask(VirtIODevice
*vdev, int idx,
VirtIONet *n = VIRTIO_NET(vdev);
NetClientState *nc;
assert(n->vhost_started);
- if (!virtio_vdev_has_feature(vdev, VIRTIO_NET_F_MQ) && idx == 2) {
+ if (!n->multiqueue && idx == 2) {
/* Must guard against invalid features and bogus queue index
* from being set by malicious guest, or penetrated through
* buggy migration stream.
--
2.39.2
- [Stable-7.2.11 30/41] target/i386: fix direction of "32-bit MMU" test, (continued)
- [Stable-7.2.11 30/41] target/i386: fix direction of "32-bit MMU" test, Michael Tokarev, 2024/04/10
- [Stable-7.2.11 33/41] hw/scsi/scsi-generic: Fix io_timeout property not applying, Michael Tokarev, 2024/04/10
- [Stable-7.2.11 32/41] target/loongarch: Fix qemu-system-loongarch64 assert failed with the option '-d int', Michael Tokarev, 2024/04/10
- [Stable-7.2.11 28/41] target/i386: introduce function to query MMU indices, Michael Tokarev, 2024/04/10
- [Stable-7.2.11 31/41] target/i386: Revert monitor_puts() in do_inject_x86_mce(), Michael Tokarev, 2024/04/10
- [Stable-7.2.11 34/41] monitor/hmp-cmds-target: Append a space in error message in gpa2hva(), Michael Tokarev, 2024/04/10
- [Stable-7.2.11 36/41] tcg/optimize: Fix sign_mask for logical right-shift, Michael Tokarev, 2024/04/10
- [Stable-7.2.11 37/41] target/hppa: Clear psw_n for BE on use_nullify_skip path, Michael Tokarev, 2024/04/10
- [Stable-7.2.11 38/41] gitlab-ci/cirrus: switch from 'master' to 'latest', Michael Tokarev, 2024/04/10
- [Stable-7.2.11 39/41] hw/intc/arm_gicv3: ICC_HPPIR* return SPURIOUS if int group is disabled, Michael Tokarev, 2024/04/10
- [Stable-7.2.11 35/41] virtio-net: Fix vhost virtqueue notifiers for RSS,
Michael Tokarev <=
- [Stable-7.2.11 40/41] hw/net/virtio-net: fix qemu set used ring flag even vhost started, Michael Tokarev, 2024/04/10
- [Stable-7.2.11 41/41] hw/virtio: Fix packed virtqueue flush used_idx, Michael Tokarev, 2024/04/10