qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [PATCH] nvme: Fix spurious interrupts


From: Guenter Roeck
Subject: Re: [Qemu-block] [PATCH] nvme: Fix spurious interrupts
Date: Mon, 26 Nov 2018 09:28:26 -0800
User-agent: Mutt/1.5.24 (2015-08-30)

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 <address@hidden>
> Signed-off-by: Keith Busch <address@hidden>

Tested-by: Guenter Roeck <address@hidden>

> ---
>  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
> 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]