Skip to content

Commit

Permalink
nvme: move ->retries setup to nvme_setup_cmd
Browse files Browse the repository at this point in the history
->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>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Jens Axboe <axboe@fb.com>
  • Loading branch information
Christoph Hellwig authored and Jens Axboe committed Apr 5, 2017
1 parent 8e14be5 commit 987f699
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 5 additions & 0 deletions drivers/nvme/host/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 0 additions & 4 deletions drivers/nvme/host/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 987f699

Please sign in to comment.