peterdelevoryas / rpms / qemu

Forked from rpms/qemu 2 years ago
Clone

Blame 0007-virtio-fs-fix-MSI-X-nvectors-calculation.patch

1d442b
From: Stefan Hajnoczi <stefanha@redhat.com>
1d442b
Date: Mon, 27 Jan 2020 19:00:36 +0000
1d442b
Subject: [PATCH] virtio-fs: fix MSI-X nvectors calculation
1d442b
1d442b
The following MSI-X vectors are required:
1d442b
 * VIRTIO Configuration Change
1d442b
 * hiprio virtqueue
1d442b
 * requests virtqueues
1d442b
1d442b
Fix the calculation to reserve enough MSI-X vectors.  Otherwise guest
1d442b
drivers fall back to a sub-optional configuration where all virtqueues
1d442b
share a single vector.
1d442b
1d442b
This change does not break live migration compatibility since
1d442b
vhost-user-fs-pci devices are not migratable yet.
1d442b
1d442b
Reported-by: Vivek Goyal <vgoyal@redhat.com>
1d442b
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
1d442b
Message-Id: <20191209110759.35227-1-stefanha@redhat.com>
1d442b
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
1d442b
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
1d442b
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
1d442b
(cherry picked from commit 366844f3d1329c6423dd752891a28ccb3ee8fddd)
1d442b
---
1d442b
 hw/virtio/vhost-user-fs-pci.c | 3 ++-
1d442b
 1 file changed, 2 insertions(+), 1 deletion(-)
1d442b
1d442b
diff --git a/hw/virtio/vhost-user-fs-pci.c b/hw/virtio/vhost-user-fs-pci.c
1d442b
index 933a3f265b..e3a649d4a6 100644
1d442b
--- a/hw/virtio/vhost-user-fs-pci.c
1d442b
+++ b/hw/virtio/vhost-user-fs-pci.c
1d442b
@@ -40,7 +40,8 @@ static void vhost_user_fs_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
1d442b
     DeviceState *vdev = DEVICE(&dev->vdev);
1d442b
 
1d442b
     if (vpci_dev->nvectors == DEV_NVECTORS_UNSPECIFIED) {
1d442b
-        vpci_dev->nvectors = dev->vdev.conf.num_request_queues + 1;
1d442b
+        /* Also reserve config change and hiprio queue vectors */
1d442b
+        vpci_dev->nvectors = dev->vdev.conf.num_request_queues + 2;
1d442b
     }
1d442b
 
1d442b
     qdev_set_parent_bus(vdev, BUS(&vpci_dev->bus));