[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH v3 1/5] block/nvme: Use an array of EventNotifier
From: |
Stefan Hajnoczi |
Subject: |
Re: [RFC PATCH v3 1/5] block/nvme: Use an array of EventNotifier |
Date: |
Wed, 19 Aug 2020 09:08:52 +0100 |
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.
signature.asc
Description: PGP signature
- [RFC PATCH v3 0/5] util/vfio-helpers: Add support for multiple IRQs, Philippe Mathieu-Daudé, 2020/08/18
- [RFC PATCH v3 1/5] block/nvme: Use an array of EventNotifier, Philippe Mathieu-Daudé, 2020/08/18
- Re: [RFC PATCH v3 1/5] block/nvme: Use an array of EventNotifier,
Stefan Hajnoczi <=
- [RFC PATCH v3 2/5] util/vfio-helpers: Report error on unsupported host architectures, Philippe Mathieu-Daudé, 2020/08/18
- [RFC PATCH v3 3/5] util/vfio-helpers: Store eventfd using int32_t type, Philippe Mathieu-Daudé, 2020/08/18
- [RFC PATCH v3 4/5] util/vfio-helpers: Introduce qemu_vfio_pci_init_msix_irqs(), Philippe Mathieu-Daudé, 2020/08/18
- [RFC PATCH v3 5/5] block/nvme: Use qemu_vfio_pci_init_msix_irqs() to initialize our IRQ, Philippe Mathieu-Daudé, 2020/08/18