From: Guenter Roeck <linux@roeck-us.net>
To: Keith Busch <keith.busch@intel.com>
Cc: qemu-block@nongnu.org, qemu-devel@nongnu.org,
Kevin Wolf <kwolf@redhat.com>, Max Reitz <mreitz@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] nvme: Fix spurious interrupts
Date: Mon, 26 Nov 2018 09:28:26 -0800 [thread overview]
Message-ID: <20181126172826.GB13784@roeck-us.net> (raw)
In-Reply-To: <20181126171745.4673-1-keith.busch@intel.com>
On Mon, Nov 26, 2018 at 10:17:45AM -0700, Keith Busch wrote:
> The code had asserted an interrupt every time it was requested to check
> for new completion queue entries.This can result in spurious interrupts
> seen by the guest OS.
>
> Fix this by asserting an interrupt only if there are un-acknowledged
> completion queue entries available.
>
> Reported-by: Guenter Roeck <linux@roeck-us.net>
> Signed-off-by: Keith Busch <keith.busch@intel.com>
Tested-by: Guenter Roeck <linux@roeck-us.net>
> ---
> hw/block/nvme.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/hw/block/nvme.c b/hw/block/nvme.c
> index 9fbe5673cb..7c8c63e8f5 100644
> --- a/hw/block/nvme.c
> +++ b/hw/block/nvme.c
> @@ -272,7 +272,9 @@ static void nvme_post_cqes(void *opaque)
> sizeof(req->cqe));
> QTAILQ_INSERT_TAIL(&sq->req_list, req, entry);
> }
> - nvme_irq_assert(n, cq);
> + if (cq->tail != cq->head) {
> + nvme_irq_assert(n, cq);
> + }
> }
>
> static void nvme_enqueue_req_completion(NvmeCQueue *cq, NvmeRequest *req)
> --
> 2.14.4
>
next prev parent reply other threads:[~2018-11-26 17:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-26 17:17 [Qemu-devel] [PATCH] nvme: Fix spurious interrupts Keith Busch
2018-11-26 17:28 ` Guenter Roeck [this message]
2018-11-26 17:38 ` Kevin Wolf
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=20181126172826.GB13784@roeck-us.net \
--to=linux@roeck-us.net \
--cc=keith.busch@intel.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/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).