From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>, Fam Zheng <fam@euphon.net>,
qemu-block@nongnu.org, Cornelia Huck <cohuck@redhat.com>,
qemu-devel@nongnu.org, Maxim Levitsky <mlevitsk@redhat.com>,
Eric Auger <eric.auger@redhat.com>,
Alex Williamson <alex.williamson@redhat.com>,
Max Reitz <mreitz@redhat.com>
Subject: Re: [PATCH v3 16/16] block/nvme: Use per-queuepair IRQ notifier and AIO context
Date: Mon, 6 Jul 2020 14:30:09 +0200 [thread overview]
Message-ID: <f7804215-f9dd-39ba-1708-94373aa3f72c@redhat.com> (raw)
In-Reply-To: <20200706120453.GE342708@stefanha-x1.localdomain>
On 7/6/20 2:04 PM, Stefan Hajnoczi wrote:
> On Sat, Jul 04, 2020 at 11:30:51PM +0200, Philippe Mathieu-Daudé wrote:
>> @@ -683,6 +676,17 @@ static bool nvme_add_io_queue(BlockDriverState *bs, Error **errp)
>> s->queues = g_renew(NVMeQueuePair *, s->queues, n + 1);
>> s->queues[n] = q;
>> s->nr_queues++;
>> +
>> + ret = qemu_vfio_pci_init_irq(s->vfio,
>> + &s->queues[n]->irq_notifier,
>> + VFIO_PCI_MSIX_IRQ_INDEX, errp);
>> + if (ret) {
>> + goto out_error;
>> + }
>> + aio_set_event_notifier(aio_context,
>> + &s->queues[n]->irq_notifier,
>> + false, nvme_handle_event, nvme_poll_cb);
>
> s->queues[n] can be replaced with q to make the code easier to read.
Indeed.
>
>> @@ -784,12 +782,14 @@ static int nvme_init(BlockDriverState *bs, const char *device, int namespace,
>> }
>> }
>>
>> - ret = qemu_vfio_pci_init_irq(s->vfio, &s->irq_notifier,
>> + ret = qemu_vfio_pci_init_irq(s->vfio,
>> + &s->queues[QUEUE_INDEX_ADMIN]->irq_notifier,
>> VFIO_PCI_MSIX_IRQ_INDEX, errp);
>
> QEMU is setting up only 1 MSI-X vector that is shared by the admin and
> all io queues?
>
> I'm not very familiar with the VFIO ioctls but I guess this call
> replaces the admin queue's irq_notifier registration with VFIO. So now
> the queue's irq_notifier is signalled on admin cq events. The admin
> irq_notifier is no longer signalled. This seems broken.
I'll look into that. Cc'ing VFIO experts meanwhile...
>
> If there are multiple irq_notifiers then multiple MSI-X vectors are
> needed.
>
> Stefan
>
prev parent reply other threads:[~2020-07-06 12:31 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-04 21:30 [PATCH v3 00/16] block/nvme: Various cleanups required to use multiple queues Philippe Mathieu-Daudé
2020-07-04 21:30 ` [PATCH v3 01/16] block/nvme: Replace magic value by SCALE_MS definition Philippe Mathieu-Daudé
2020-07-04 21:30 ` [PATCH v3 02/16] block/nvme: Avoid further processing if trace event not enabled Philippe Mathieu-Daudé
2020-07-04 21:30 ` [PATCH v3 03/16] block/nvme: Let nvme_create_queue_pair() fail gracefully Philippe Mathieu-Daudé
2020-07-04 21:30 ` [PATCH v3 04/16] block/nvme: Define QUEUE_INDEX macros to ease code review Philippe Mathieu-Daudé
2020-07-04 21:30 ` [PATCH v3 05/16] block/nvme: Improve error message when IO queue creation failed Philippe Mathieu-Daudé
2020-07-06 10:32 ` Stefan Hajnoczi
2020-07-04 21:30 ` [PATCH v3 06/16] block/nvme: Use common error path in nvme_add_io_queue() Philippe Mathieu-Daudé
2020-07-06 11:38 ` Stefan Hajnoczi
2020-07-04 21:30 ` [PATCH v3 07/16] block/nvme: Rename local variable Philippe Mathieu-Daudé
2020-07-04 21:30 ` [PATCH v3 08/16] block/nvme: Use union of NvmeIdCtrl / NvmeIdNs structures Philippe Mathieu-Daudé
2020-07-04 21:30 ` [PATCH v3 09/16] block/nvme: Replace qemu_try_blockalign0 by qemu_try_blockalign/memset Philippe Mathieu-Daudé
2020-07-04 21:30 ` [PATCH v3 10/16] block/nvme: Replace qemu_try_blockalign(bs) by qemu_try_memalign(pg_sz) Philippe Mathieu-Daudé
2020-07-04 21:30 ` [PATCH v3 11/16] block/nvme: Simplify nvme_init_queue() arguments Philippe Mathieu-Daudé
2020-07-04 21:30 ` [PATCH v3 12/16] block/nvme: Replace BDRV_POLL_WHILE by AIO_WAIT_WHILE Philippe Mathieu-Daudé
2020-07-04 21:30 ` [PATCH v3 13/16] block/nvme: Simplify nvme_create_queue_pair() arguments Philippe Mathieu-Daudé
2020-07-04 21:30 ` [PATCH v3 14/16] block/nvme: Extract nvme_poll_queue() Philippe Mathieu-Daudé
2020-07-06 11:40 ` Stefan Hajnoczi
2020-07-04 21:30 ` [PATCH v3 15/16] block/nvme: Move nvme_poll_cb() earlier Philippe Mathieu-Daudé
2020-07-06 11:41 ` Stefan Hajnoczi
2020-07-04 21:30 ` [PATCH v3 16/16] block/nvme: Use per-queuepair IRQ notifier and AIO context Philippe Mathieu-Daudé
2020-07-06 9:45 ` Philippe Mathieu-Daudé
2020-07-06 12:04 ` Stefan Hajnoczi
2020-07-06 12:30 ` Philippe Mathieu-Daudé [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=f7804215-f9dd-39ba-1708-94373aa3f72c@redhat.com \
--to=philmd@redhat.com \
--cc=alex.williamson@redhat.com \
--cc=cohuck@redhat.com \
--cc=eric.auger@redhat.com \
--cc=fam@euphon.net \
--cc=kwolf@redhat.com \
--cc=mlevitsk@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--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).