linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Jens Axboe <axboe@kernel.dk>, Keith Busch <keith.busch@intel.com>,
	Sagi Grimberg <sagi@grimberg.me>
Cc: linux-nvme@lists.infradead.org, linux-block@vger.kernel.org,
	linux-scsi@vger.kernel.org
Subject: [PATCH 1/5] nvme: move ->retries setup to nvme_setup_cmd
Date: Wed,  5 Apr 2017 19:18:08 +0200	[thread overview]
Message-ID: <20170405171812.19911-2-hch@lst.de> (raw)
In-Reply-To: <20170405171812.19911-1-hch@lst.de>

->retries is counting the number of times a command is resubmitted, and
be cleared on the first time we see the command.  We currently don't do
that for non-PCIe command, which is easily fixed by moving the setup
to common code.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 drivers/nvme/host/core.c | 5 +++++
 drivers/nvme/host/pci.c  | 4 ----
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 3c908e1bc903..0437f44d00f9 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -350,6 +350,11 @@ int nvme_setup_cmd(struct nvme_ns *ns, struct request *req,
 {
 	int ret = BLK_MQ_RQ_QUEUE_OK;
 
+	if (!(req->rq_flags & RQF_DONTPREP)) {
+		req->retries = 0;
+		req->rq_flags |= RQF_DONTPREP;
+	}
+
 	switch (req_op(req)) {
 	case REQ_OP_DRV_IN:
 	case REQ_OP_DRV_OUT:
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index 9e686a67d93b..3818ab15a26e 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -326,10 +326,6 @@ static int nvme_init_iod(struct request *rq, struct nvme_dev *dev)
 	iod->nents = 0;
 	iod->length = size;
 
-	if (!(rq->rq_flags & RQF_DONTPREP)) {
-		rq->retries = 0;
-		rq->rq_flags |= RQF_DONTPREP;
-	}
 	return BLK_MQ_RQ_QUEUE_OK;
 }
 
-- 
2.11.0

  reply	other threads:[~2017-04-05 17:18 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-05 17:18 ->retries fixups V2 Christoph Hellwig
2017-04-05 17:18 ` Christoph Hellwig [this message]
2017-04-05 17:32   ` [PATCH 1/5] nvme: move ->retries setup to nvme_setup_cmd Sagi Grimberg
2017-04-06  8:55   ` Johannes Thumshirn
2017-04-05 17:18 ` [PATCH 2/5] nvme: cleanup nvme_req_needs_retry Christoph Hellwig
2017-04-05 17:32   ` Sagi Grimberg
2017-04-05 17:18 ` [PATCH 3/5] nvme: mark nvme_max_retries static Christoph Hellwig
2017-04-05 17:33   ` Sagi Grimberg
2017-04-05 17:18 ` [PATCH 4/5] nvme: move the retries count to struct nvme_request Christoph Hellwig
2017-04-05 17:33   ` Sagi Grimberg
2017-04-05 17:18 ` [PATCH 5/5] block, scsi: move the retries field to struct scsi_request Christoph Hellwig
2017-04-05 17:33   ` Sagi Grimberg
2017-04-05 18:06 ` ->retries fixups V2 Jens Axboe
2017-04-05 18:16   ` Christoph Hellwig
2017-04-05 18:18     ` Jens Axboe
  -- strict thread matches above, loose matches on Subject: below --
2017-04-05 14:18 ->retries fixups Christoph Hellwig
2017-04-05 14:18 ` [PATCH 1/5] nvme: move ->retries setup to nvme_setup_cmd Christoph Hellwig
2017-04-05 14:43   ` Johannes Thumshirn
2017-04-05 14:50     ` Christoph Hellwig

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=20170405171812.19911-2-hch@lst.de \
    --to=hch@lst.de \
    --cc=axboe@kernel.dk \
    --cc=keith.busch@intel.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=sagi@grimberg.me \
    /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).