qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: Fam Zheng <fam@euphon.net>, Kevin Wolf <kwolf@redhat.com>,
	qemu-block@nongnu.org, qemu-devel@nongnu.org,
	Max Reitz <mreitz@redhat.com>,
	Alex Williamson <alex.williamson@redhat.com>
Subject: Re: [RFC PATCH v3 1/5] block/nvme: Use an array of EventNotifier
Date: Wed, 19 Aug 2020 17:55:35 +0200	[thread overview]
Message-ID: <93bef7bd-98fa-4f54-4615-1aae0c534257@redhat.com> (raw)
In-Reply-To: <20200819080852.GA339340@stefanha-x1.localdomain>

On 8/19/20 10:08 AM, Stefan Hajnoczi wrote:
> On Tue, Aug 18, 2020 at 06:45:05PM +0200, Philippe Mathieu-Daudé wrote:
>> In preparation of using multiple IRQ (thus multiple eventfds)
>> make BDRVNVMeState::irq_notifier an array (for now of a single
>> element, the admin queue notifier).
>>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>> ---
>>  block/nvme.c | 28 ++++++++++++++++++----------
>>  1 file changed, 18 insertions(+), 10 deletions(-)
> 
> This looks like an intermediate step before using multiple irqs. I think
> it makes the code confusing because on one hand INDEX_ADMIN gives the
> impression that INDEX_IO() should be used for io queues, while on the
> other hand only a single EventNotifier is allocated and we actually
> can't use INDEX_IO() yet.
> 
> If this intermediate patch is really necessary, please don't use
> INDEX_ADMIN. Define a new constant instead:
> 
>   /* This driver shares a single MSIX IRQ for the admin and I/O queues */
>   #define MSIX_SHARED_IRQ_IDX 0
> 
> In the future the array index can be changed to INDEX_ADMIN and
> INDEX_IO(n) when there are multiple EventNotifiers.
> 
> I think that would make the code clearer.

Very good idea, thanks!



  reply	other threads:[~2020-08-19 15:56 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-18 16:45 [RFC PATCH v3 0/5] util/vfio-helpers: Add support for multiple IRQs Philippe Mathieu-Daudé
2020-08-18 16:45 ` [RFC PATCH v3 1/5] block/nvme: Use an array of EventNotifier Philippe Mathieu-Daudé
2020-08-19  8:08   ` Stefan Hajnoczi
2020-08-19 15:55     ` Philippe Mathieu-Daudé [this message]
2020-08-18 16:45 ` [RFC PATCH v3 2/5] util/vfio-helpers: Report error on unsupported host architectures Philippe Mathieu-Daudé
2020-08-18 17:12   ` Alex Williamson
2020-08-18 17:26     ` Philippe Mathieu-Daudé
2020-08-18 16:45 ` [RFC PATCH v3 3/5] util/vfio-helpers: Store eventfd using int32_t type Philippe Mathieu-Daudé
2020-08-18 16:45 ` [RFC PATCH v3 4/5] util/vfio-helpers: Introduce qemu_vfio_pci_init_msix_irqs() Philippe Mathieu-Daudé
2020-08-18 17:25   ` Alex Williamson
2020-08-18 16:45 ` [RFC PATCH v3 5/5] block/nvme: Use qemu_vfio_pci_init_msix_irqs() to initialize our IRQ Philippe Mathieu-Daudé

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=93bef7bd-98fa-4f54-4615-1aae0c534257@redhat.com \
    --to=philmd@redhat.com \
    --cc=alex.williamson@redhat.com \
    --cc=fam@euphon.net \
    --cc=kwolf@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).