All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: jasowang@redhat.com, qemu-devel@nongnu.org
Subject: Re: Inconsistent virtio-net-pci MSI vector count
Date: Wed, 3 Mar 2021 11:08:49 -0500	[thread overview]
Message-ID: <20210303110742-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <YD9qmto5pHys+jEm@stefanha-x1.localdomain>

On Wed, Mar 03, 2021 at 10:53:14AM +0000, Stefan Hajnoczi wrote:
> Hi Jason,
> I stumbled across something strange with virtio-net multi-queue today.
> It doesn't seem to be a bug in practice, just an inconsistency. Here are
> the details in case you think something needs to be changed:
> 
> libvirt uses the vectors = 2 * N + 2 formula from
> https://www.linux-kvm.org/page/Multiqueue to calculate the number of PCI
> MSI vectors, where N is the number of rx/tx queue pairs.
> 
> QEMU's virtio-net-pci device has 3 MSI vectors by default. This is
> inconsistent with the formula that libvirt uses (should be 4 instead of
> 3).
> 
> Luckily, the Linux virtio_net.ko driver does not configure a callback
> function for the control virtqueue. Therefore it can still use MSI with
> only 3 vectors (config, rx, tx) instead of 4 (config, rx, tx, ctrl).
> 
> But other driver implementations might need the ctrl vq vector and would
> not have enough MSI vectors.

At a guess control vq can share a vector with config.
Linux is not clever enough to do it yet but it's possible.

> Perhaps new QEMU machine types should set vectors to 4 by default?
> 
> Stefan




      parent reply	other threads:[~2021-03-03 16:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-03 10:53 Inconsistent virtio-net-pci MSI vector count Stefan Hajnoczi
2021-03-03 13:08 ` Jason Wang
2021-03-03 16:12   ` Michael S. Tsirkin
2021-03-03 17:09     ` Stefan Hajnoczi
2021-03-03 16:08 ` Michael S. Tsirkin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210303110742-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.