All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shimi Gersner <gersner@gmail.com>
To: qemu-block@nongnu.org, qemu-devel@nongnu.org
Cc: Keith Busch <keith.busch@intel.com>,
	Kevin Wolf <kwolf@redhat.com>, Max Reitz <mreitz@redhat.com>,
	David Sariel <davidsa@openu.ac.il>,
	Shimi Gersner <gersner@gmail.com>
Subject: [Qemu-devel] [PATCH 5/5] nvme: Missing MSI message upon partial CQ read
Date: Fri, 22 Jun 2018 11:22:37 +0000	[thread overview]
Message-ID: <20180622112237.2131-5-gersner@gmail.com> (raw)
In-Reply-To: <20180622112237.2131-1-gersner@gmail.com>

When MSIx interrupts are enabled, each CQ is associated with
a vector which is expected to be called upon ready data
in the CQ buffer. After guest reads from the buffer, it updates
the processed buffer position using a CQ dedicated DB.

Upon reading only partial data from the CQ buffer, device
fails to re-send a new MSI message stating buffer still has
unread data. The fix ensures a new message will be sent.

Change-Id: I10190be127b8dcbd89732cfb95ea37faf8c5779b
Signed-off-by: Shimi Gersner <gersner@gmail.com>
---
 hw/block/nvme.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/hw/block/nvme.c b/hw/block/nvme.c
index f639d7ae73..e2dca6e57f 100644
--- a/hw/block/nvme.c
+++ b/hw/block/nvme.c
@@ -1152,8 +1152,12 @@ static void nvme_process_db(NvmeCtrl *n, hwaddr addr, int val)
             }
         }
 
+        // When we have more messages, we should make sure irq is asserted. When MSIx is used
+        // this will make sure another notification is sent to the guest.
         if (cq->tail == cq->head) {
             nvme_irq_deassert(n, cq);
+        } else {
+            nvme_irq_assert(n, cq);
         }
     } else {
         /* Submission queue doorbell write */
-- 
2.17.1

  parent reply	other threads:[~2018-06-22 11:23 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-22 11:22 [Qemu-devel] [PATCH 1/5] nvme: PCI/e configuration from specification Shimi Gersner
2018-06-22 11:22 ` [Qemu-devel] [PATCH 2/5] nvme: CQ/SQ proper validation & status code Shimi Gersner
2018-06-22 11:22 ` [Qemu-devel] [PATCH 3/5] nvme: Proper state handling on enable/disable Shimi Gersner
2018-06-22 11:22 ` [Qemu-devel] [PATCH 4/5] nvme: Fix phantom irq raise Shimi Gersner
2018-06-22 11:22 ` Shimi Gersner [this message]
2018-07-12 11:47 ` [Qemu-devel] [PATCH 1/5] nvme: PCI/e configuration from specification Kevin Wolf
2018-07-13  7:40   ` David Sariel
2018-07-15  6:20 ` Daniel Verkamp
2018-08-26 21:49   ` Gersner
2018-08-30 15:45     ` Daniel Verkamp
2018-09-12 19:53       ` Gersner
2018-09-12 21:21         ` Eric Blake

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=20180622112237.2131-5-gersner@gmail.com \
    --to=gersner@gmail.com \
    --cc=davidsa@openu.ac.il \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.