yeahuh / rpms / qemu-kvm

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