[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC] hw/nvme: Use irqfd to send interrupts
From: |
Jinhao Fan |
Subject: |
Re: [RFC] hw/nvme: Use irqfd to send interrupts |
Date: |
Mon, 8 Aug 2022 10:23:03 +0800 |
at 12:35 PM, Jinhao Fan <fanjinhao21s@ict.ac.cn> wrote:
> static void nvme_irq_assert(NvmeCtrl *n, NvmeCQueue *cq)
> {
> if (cq->irq_enabled) {
> if (msix_enabled(&(n->parent_obj))) {
> + /* Initialize CQ irqfd */
> + if (!cq->irqfd_enabled && n->params.ioeventfd && cq->cqid != 0) {
> + int ret = nvme_init_cq_irqfd(cq);
> + if (ret == 0) {
> + cq->irqfd_enabled = true;
> + }
> + }
> +
Another question:
In this version I left irqfd initialization to the first assertion of an
irq. But I think it is better to initialize irqfd at cq creation time so we
won’t bother checking it at each irq assertion. However if I put these code
in nvme_init_cq(), irqfd does not work properly. After adding some
tracepoints I found the MSI messages in MSI-X table changed after
nvme_init_cq(). Specifically, the `data` field does not seem correct at the
time when nvme_init_cq() is called.
Keith, you must be familiar with how the nvme driver initializes CQs. Could
you give some information on when I can safely use the contents in the MSI-X
table?