902636
From c0cf6d8a1d3b9bf3928f37fcfd5aa8ae6f1338ca Mon Sep 17 00:00:00 2001
902636
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
902636
Date: Mon, 27 Jan 2020 19:00:36 +0100
902636
Subject: [PATCH 005/116] virtio-fs: fix MSI-X nvectors calculation
902636
MIME-Version: 1.0
902636
Content-Type: text/plain; charset=UTF-8
902636
Content-Transfer-Encoding: 8bit
902636
902636
RH-Author: Dr. David Alan Gilbert <dgilbert@redhat.com>
902636
Message-id: <20200127190227.40942-2-dgilbert@redhat.com>
902636
Patchwork-id: 93455
902636
O-Subject: [RHEL-AV-8.2 qemu-kvm PATCH 001/112] virtio-fs: fix MSI-X nvectors calculation
902636
Bugzilla: 1694164
902636
RH-Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
902636
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
902636
RH-Acked-by: Sergio Lopez Pascual <slp@redhat.com>
902636
902636
From: Stefan Hajnoczi <stefanha@redhat.com>
902636
902636
The following MSI-X vectors are required:
902636
 * VIRTIO Configuration Change
902636
 * hiprio virtqueue
902636
 * requests virtqueues
902636
902636
Fix the calculation to reserve enough MSI-X vectors.  Otherwise guest
902636
drivers fall back to a sub-optional configuration where all virtqueues
902636
share a single vector.
902636
902636
This change does not break live migration compatibility since
902636
vhost-user-fs-pci devices are not migratable yet.
902636
902636
Reported-by: Vivek Goyal <vgoyal@redhat.com>
902636
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
902636
Message-Id: <20191209110759.35227-1-stefanha@redhat.com>
902636
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
902636
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
902636
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
902636
(cherry picked from commit 366844f3d1329c6423dd752891a28ccb3ee8fddd)
902636
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
902636
---
902636
 hw/virtio/vhost-user-fs-pci.c | 3 ++-
902636
 1 file changed, 2 insertions(+), 1 deletion(-)
902636
902636
diff --git a/hw/virtio/vhost-user-fs-pci.c b/hw/virtio/vhost-user-fs-pci.c
902636
index 933a3f2..e3a649d 100644
902636
--- a/hw/virtio/vhost-user-fs-pci.c
902636
+++ b/hw/virtio/vhost-user-fs-pci.c
902636
@@ -40,7 +40,8 @@ static void vhost_user_fs_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
902636
     DeviceState *vdev = DEVICE(&dev->vdev);
902636
 
902636
     if (vpci_dev->nvectors == DEV_NVECTORS_UNSPECIFIED) {
902636
-        vpci_dev->nvectors = dev->vdev.conf.num_request_queues + 1;
902636
+        /* Also reserve config change and hiprio queue vectors */
902636
+        vpci_dev->nvectors = dev->vdev.conf.num_request_queues + 2;
902636
     }
902636
 
902636
     qdev_set_parent_bus(vdev, BUS(&vpci_dev->bus));
902636
-- 
902636
1.8.3.1
902636