[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 1/5] virtio-net: Fix vhost virtqueue notifiers for RSS
From: |
Jason Wang |
Subject: |
[PULL 1/5] virtio-net: Fix vhost virtqueue notifiers for RSS |
Date: |
Fri, 29 Mar 2024 15:10:56 +0800 |
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>
---
hw/net/virtio-net.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 9959f1932b..a6ff000cd9 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -3426,7 +3426,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.
@@ -3458,7 +3458,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.42.0
- [PULL 0/5] Net patches, Jason Wang, 2024/03/29
- [PULL 1/5] virtio-net: Fix vhost virtqueue notifiers for RSS,
Jason Wang <=
- [PULL 2/5] ebpf: Fix indirections table setting, Jason Wang, 2024/03/29
- [PULL 4/5] tap-win32: Remove unnecessary stubs, Jason Wang, 2024/03/29
- [PULL 3/5] hw/net/net_tx_pkt: Fix virtio header without checksum offloading, Jason Wang, 2024/03/29
- [PULL 5/5] Revert "tap: setting error appropriately when calling net_init_tap_one()", Jason Wang, 2024/03/29
- Re: [PULL 0/5] Net patches, Peter Maydell, 2024/03/31
- Re: [PULL 0/5] Net patches, Michael Tokarev, 2024/03/31