qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Jason Wang <jasowang@redhat.com>
Cc: qemu-devel@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: Inconsistent virtio-net-pci MSI vector count
Date: Wed, 3 Mar 2021 11:12:51 -0500	[thread overview]
Message-ID: <20210303111216-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <e8c8874f-6b1a-ac0e-5ab6-826611cd3ef3@redhat.com>

On Wed, Mar 03, 2021 at 09:08:27PM +0800, Jason Wang wrote:
> 
> On 2021/3/3 6:53 下午, 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).
> 
> 
> Yes.
> 
> 
> > 
> > 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.
> > 
> > Perhaps new QEMU machine types should set vectors to 4 by default?
> 
> 
> Or it's time to accept this:
> 
> https://lists.gnu.org/archive/html/qemu-devel/2014-03/msg01330.html
> 
> Thanks

okay, please repost. If possible please add code comments
explaining the math.

Thanks!

> 
> > 
> > Stefan



  reply	other threads:[~2021-03-03 16:13 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 [this message]
2021-03-03 17:09     ` Stefan Hajnoczi
2021-03-03 16:08 ` Michael S. Tsirkin

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=20210303111216-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).