On Mon, 6 Jul 2020 14:56:46 +0100 Stefan Hajnoczi <stefa...@redhat.com> wrote:
> Multi-queue devices achieve the best performance when each vCPU has a > dedicated queue. This ensures that virtqueue used notifications are > handled on the same vCPU that submitted virtqueue buffers. When another > vCPU handles the the notification an IPI will be necessary to wake the > submission vCPU and this incurs a performance overhead. > > Provide a helper function that virtio-pci devices will use in later > patches to automatically select the optimal number of queues. > > The function handles guests with large numbers of CPUs by limiting the > number of queues to fit within the following constraints: > 1. The maximum number of MSI-X vectors. > 2. The maximum number of virtqueues. > > Signed-off-by: Stefan Hajnoczi <stefa...@redhat.com> > --- > hw/virtio/virtio-pci.h | 9 +++++++++ > hw/virtio/virtio-pci.c | 32 ++++++++++++++++++++++++++++++++ > 2 files changed, 41 insertions(+) I guess this should honour all relevant limits now. Reviewed-by: Cornelia Huck <coh...@redhat.com>