diff options
author | Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com> | 2020-11-09 16:33:43 -0800 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2020-12-01 20:36:35 +0100 |
commit | a2f6a2b8ce43db608357a490e028166f9e4bab0d (patch) | |
tree | a22c954f0819f305bd0c232301f87ad6727d5c68 /drivers/nvme/target/passthru.c | |
parent | dc96f93874c63e126087e1adf1973c9fecfdaa0c (diff) |
nvmet: add passthru admin timeout value attr
NVMeOF controller in the passsthru mode is capable of handling wide set
of admin commands including vender specific passhtru admin comands.
The vendor specific admin 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:admin_timeout).
Add a configfs attribute so that user can set the admin timeout values.
In case if this configfs value is not set nvme_alloc_request() will set
the ADMIN_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.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/nvme/target/passthru.c b/drivers/nvme/target/passthru.c index 8ee94f056898..b496682ccf85 100644 --- a/drivers/nvme/target/passthru.c +++ b/drivers/nvme/target/passthru.c @@ -227,6 +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; u32 effects; u16 status; int ret; @@ -242,6 +243,8 @@ static void nvmet_passthru_execute_cmd(struct nvmet_req *req) } q = ns->queue; + } else { + timeout = req->sq->ctrl->subsys->admin_timeout; } rq = nvme_alloc_request(q, req->cmd, 0, NVME_QID_ANY); @@ -250,6 +253,9 @@ static void nvmet_passthru_execute_cmd(struct nvmet_req *req) goto out_put_ns; } + if (timeout) + rq->timeout = timeout; + if (req->sg_cnt) { ret = nvmet_passthru_map_sg(req, rq); if (unlikely(ret)) { |