From: hch@lst.de (Christoph Hellwig)
Subject: [PATCH v2 2/4] nvme-pci: factor out cqe handling into a dedicated routine
Date: Mon, 19 Jun 2017 09:01:52 +0200 [thread overview]
Message-ID: <20170619070152.GD12938@lst.de> (raw)
In-Reply-To: <1497796090-14808-3-git-send-email-sagi@grimberg.me>
On Sun, Jun 18, 2017@05:28:08PM +0300, Sagi Grimberg wrote:
> Makes the code slightly more readable.
>
> Signed-off-by: Sagi Grimberg <sagi at grimberg.me>
> ---
> drivers/nvme/host/pci.c | 53 ++++++++++++++++++++++++++++---------------------
> 1 file changed, 30 insertions(+), 23 deletions(-)
>
> diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
> index 042cfe5ef8e9..26eb1743f8bc 100644
> --- a/drivers/nvme/host/pci.c
> +++ b/drivers/nvme/host/pci.c
> @@ -741,6 +741,35 @@ static inline void nvme_ring_cq_doorbell(struct nvme_queue *nvmeq)
> }
> }
>
> +static inline void nvme_handle_cqe(struct nvme_queue *nvmeq,
> + struct nvme_completion *cqe)
> +{
> + struct request *req;
> +
> + if (unlikely(cqe->command_id >= nvmeq->q_depth)) {
> + dev_warn(nvmeq->dev->ctrl.device,
> + "invalid id %d completed on queue %d\n",
> + cqe->command_id, le16_to_cpu(cqe->sq_id));
> + return;
> + }
> +
> + /*
> + * AEN requests are special as they don't time out and can
> + * survive any kind of queue freeze and often don't respond to
> + * aborts. We don't even bother to allocate a struct request
> + * for them but rather special case them here.
> + */
Lots more space for the comments now, they could be reflowed. Nothing
worth resending for, though.
Reviewed-by: Christoph Hellwig <hch at lst.de>
next prev parent reply other threads:[~2017-06-19 7:01 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-18 14:28 [PATCH v2 0/4] refactor nvme-pci cq processing Sagi Grimberg
2017-06-18 14:28 ` [PATCH v2 1/4] nvme-pci: Introduce nvme_ring_cq_doorbell Sagi Grimberg
2017-06-19 7:01 ` Christoph Hellwig
2017-06-19 16:11 ` Keith Busch
2017-06-18 14:28 ` [PATCH v2 2/4] nvme-pci: factor out cqe handling into a dedicated routine Sagi Grimberg
2017-06-19 7:01 ` Christoph Hellwig [this message]
2017-06-19 16:12 ` Keith Busch
2017-06-18 14:28 ` [PATCH v2 3/4] nvme-pci: factor out the cqe reading mechanics from __nvme_process_cq Sagi Grimberg
2017-06-19 7:04 ` Christoph Hellwig
2017-06-19 16:19 ` Keith Busch
2017-06-19 16:32 ` Sagi Grimberg
2017-06-18 14:28 ` [PATCH v2 4/4] nvme-pci: open-code polling logic in nvme_poll Sagi Grimberg
2017-06-19 7:05 ` Christoph Hellwig
2017-06-19 16:32 ` Keith Busch
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=20170619070152.GD12938@lst.de \
--to=hch@lst.de \
/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