From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Kevin Wolf" <kwolf@redhat.com>, "Fam Zheng" <fam@euphon.net>,
qemu-block@nongnu.org, "Max Reitz" <mreitz@redhat.com>,
"Alex Williamson" <alex.williamson@redhat.com>,
"Stefan Hajnoczi" <stefanha@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@redhat.com>
Subject: [RFC PATCH v5 4/4] block/nvme: Use qemu_vfio_pci_init_msix_irqs() to initialize our IRQ
Date: Tue, 8 Sep 2020 20:03:42 +0200 [thread overview]
Message-ID: <20200908180342.280749-5-philmd@redhat.com> (raw)
In-Reply-To: <20200908180342.280749-1-philmd@redhat.com>
Instead of initializing one MSIX IRQ with the generic
qemu_vfio_pci_init_irq() function, use the MSIX specific one which
ill allow us to use multiple IRQs. For now we provide an array of
a single IRQ.
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
block/nvme.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/block/nvme.c b/block/nvme.c
index f4f27b6da7d..e6dac027f72 100644
--- a/block/nvme.c
+++ b/block/nvme.c
@@ -694,6 +694,7 @@ static int nvme_init(BlockDriverState *bs, const char *device, int namespace,
uint64_t timeout_ms;
uint64_t deadline, now;
Error *local_err = NULL;
+ unsigned irq_count = MSIX_IRQ_COUNT;
qemu_co_mutex_init(&s->dma_map_lock);
qemu_co_queue_init(&s->dma_flush_queue);
@@ -779,9 +780,13 @@ static int nvme_init(BlockDriverState *bs, const char *device, int namespace,
}
}
- ret = qemu_vfio_pci_init_irq(s->vfio, s->irq_notifier,
- VFIO_PCI_MSIX_IRQ_INDEX, errp);
+ ret = qemu_vfio_pci_init_msix_irqs(s->vfio, s->irq_notifier,
+ &irq_count, errp);
if (ret) {
+ if (ret == -EOVERFLOW) {
+ error_append_hint(errp, "%u IRQs requested but only %u available\n",
+ MSIX_IRQ_COUNT, irq_count);
+ }
goto out;
}
aio_set_event_notifier(bdrv_get_aio_context(bs),
--
2.26.2
next prev parent reply other threads:[~2020-09-08 18:07 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-08 18:03 [RFC PATCH v5 0/4] util/vfio-helpers: Add support for multiple IRQs Philippe Mathieu-Daudé
2020-09-08 18:03 ` [RFC PATCH v5 1/4] util/vfio-helpers: Improve reporting unsupported IOMMU type Philippe Mathieu-Daudé
2020-09-08 18:03 ` [RFC PATCH v5 2/4] util/vfio-helpers: Report error when IOMMU page size is not supported Philippe Mathieu-Daudé
2020-09-09 8:38 ` Fam Zheng
2020-09-09 14:10 ` Philippe Mathieu-Daudé
2020-09-08 18:03 ` [RFC PATCH v5 3/4] util/vfio-helpers: Introduce qemu_vfio_pci_init_msix_irqs() Philippe Mathieu-Daudé
2020-09-08 18:03 ` Philippe Mathieu-Daudé [this message]
2020-09-09 8:42 ` [RFC PATCH v5 4/4] block/nvme: Use qemu_vfio_pci_init_msix_irqs() to initialize our IRQ Fam Zheng
2020-09-09 8:43 ` [RFC PATCH v5 0/4] util/vfio-helpers: Add support for multiple IRQs Fam Zheng
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=20200908180342.280749-5-philmd@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).