diff options
author | Keith Busch <keith.busch@intel.com> | 2016-07-13 01:20:31 +0200 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2016-07-13 01:20:31 +0200 |
commit | f80ec966c19b78af4360e26e32e1ab775253105f (patch) | |
tree | d8aacd28080c9c48ee7afef3753fa9f4c1840a19 /drivers/nvme/host/core.c | |
parent | loop: Make user notify for adding loop device failed (diff) | |
download | linux-f80ec966c19b78af4360e26e32e1ab775253105f.tar.xz linux-f80ec966c19b78af4360e26e32e1ab775253105f.zip |
nvme: Limit command retries
Many controller implementations will return errors to commands that will
not succeed, but without the DNR bit set. The driver previously retried
these commands an unlimited number of times until the command timeout
has exceeded, which takes an unnecessarilly long period of time.
This patch limits the number of retries a command can have, defaulting
to 5, but is user tunable at load or runtime.
The struct request's 'retries' field is used to track the number of
retries attempted. This is in contrast with scsi's use of this field,
which indicates how many retries are allowed.
Signed-off-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/nvme/host/core.c')
-rw-r--r-- | drivers/nvme/host/core.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index a51946a35dcf..86a0c661e74c 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -48,6 +48,11 @@ unsigned char shutdown_timeout = 5; module_param(shutdown_timeout, byte, 0644); MODULE_PARM_DESC(shutdown_timeout, "timeout in seconds for controller shutdown"); +unsigned int nvme_max_retries = 5; +module_param_named(max_retries, nvme_max_retries, uint, 0644); +MODULE_PARM_DESC(max_retries, "max number of retries a command may have"); +EXPORT_SYMBOL_GPL(nvme_max_retries); + static int nvme_major; module_param(nvme_major, int, 0); |