summaryrefslogtreecommitdiff
path: root/drivers/nvme/target/passthru.c
diff options
context:
space:
mode:
authorChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>2020-11-09 16:33:44 -0800
committerChristoph Hellwig <hch@lst.de>2020-12-01 20:36:35 +0100
commit47e9730c26a4a5d4eab2124d6bbeb94693e44b46 (patch)
tree0003d7d371377c7c15887c570202b03350b1cc80 /drivers/nvme/target/passthru.c
parenta2f6a2b8ce43db608357a490e028166f9e4bab0d (diff)
nvmet: add passthru io timeout value attr
NVMeOF controller in the passsthru mode is capable of handling wide set of I/O commands including vender specific passhtru io comands. The vendor specific I/O commands are used to read the large drive logs and can take longer than default NVMe commands, i.e. for passthru requests the timeout value may differ from the passthru controller's default timeout values (nvme-core:io_timeout). Add a configfs attribute so that user can set the io timeout values. In case if this configfs value is not set nvme_alloc_request() will set the NVME_IO_TIMEOUT value when request queuedata is NULL. Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/nvme/target/passthru.c')
-rw-r--r--drivers/nvme/target/passthru.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/nvme/target/passthru.c b/drivers/nvme/target/passthru.c
index b496682ccf85..a062398305a7 100644
--- a/drivers/nvme/target/passthru.c
+++ b/drivers/nvme/target/passthru.c
@@ -227,7 +227,7 @@ static void nvmet_passthru_execute_cmd(struct nvmet_req *req)
struct request_queue *q = ctrl->admin_q;
struct nvme_ns *ns = NULL;
struct request *rq = NULL;
- unsigned int timeout = 0;
+ unsigned int timeout;
u32 effects;
u16 status;
int ret;
@@ -243,6 +243,7 @@ static void nvmet_passthru_execute_cmd(struct nvmet_req *req)
}
q = ns->queue;
+ timeout = req->sq->ctrl->subsys->io_timeout;
} else {
timeout = req->sq->ctrl->subsys->admin_timeout;
}