qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: qemu-devel@nongnu.org, "Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: Inconsistent virtio-net-pci MSI vector count
Date: Wed, 3 Mar 2021 21:08:27 +0800	[thread overview]
Message-ID: <e8c8874f-6b1a-ac0e-5ab6-826611cd3ef3@redhat.com> (raw)
In-Reply-To: <YD9qmto5pHys+jEm@stefanha-x1.localdomain>


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


>
> Stefan



  reply	other threads:[~2021-03-03 13:10 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 [this message]
2021-03-03 16:12   ` Michael S. Tsirkin
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=e8c8874f-6b1a-ac0e-5ab6-826611cd3ef3@redhat.com \
    --to=jasowang@redhat.com \
    --cc=mst@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).