diff options
author | Sagi Grimberg <sagi@grimberg.me> | 2016-06-13 16:45:28 +0200 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2016-07-05 11:28:20 -0600 |
commit | 038bd4cb6766c69b5b9c77507f389cc718a36842 (patch) | |
tree | f551977e651401dadf30bb47bc9756df5f922901 /drivers/nvme/host/fabrics.h | |
parent | 7b89eae29eec4dd9259acd82ed57bec8d9e430ca (diff) | |
download | lwn-038bd4cb6766c69b5b9c77507f389cc718a36842.tar.gz lwn-038bd4cb6766c69b5b9c77507f389cc718a36842.zip |
nvme: add keep-alive support
Periodic keep-alive is a mandatory feature in NVMe over Fabrics, and
optional in NVMe 1.2.1 for PCIe. This patch adds periodic keep-alive
sent from the host to verify that the controller is still responsive
and vice-versa. The keep-alive timeout is user-defined (with
keep_alive_tmo connection parameter) and defaults to 5 seconds.
In order to avoid a race condition where the host sends a keep-alive
competing with the target side keep-alive timeout expiration, the host
adds a grace period of 10 seconds when publishing the keep-alive timeout
to the target.
In case a keep-alive failed (or timed out), a transport specific error
recovery kicks in.
For now only NVMe over Fabrics is wired up to support keep alive, but
we can add PCIe support easily once controllers actually supporting it
become available.
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Steve Wise <swise@chelsio.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/nvme/host/fabrics.h')
-rw-r--r-- | drivers/nvme/host/fabrics.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/nvme/host/fabrics.h b/drivers/nvme/host/fabrics.h index 120383088bc1..b54067404963 100644 --- a/drivers/nvme/host/fabrics.h +++ b/drivers/nvme/host/fabrics.h @@ -49,6 +49,7 @@ enum { NVMF_OPT_QUEUE_SIZE = 1 << 4, NVMF_OPT_NR_IO_QUEUES = 1 << 5, NVMF_OPT_TL_RETRY_COUNT = 1 << 6, + NVMF_OPT_KATO = 1 << 7, NVMF_OPT_HOSTNQN = 1 << 8, NVMF_OPT_RECONNECT_DELAY = 1 << 9, }; @@ -72,6 +73,7 @@ enum { * kicking upper layer(s) error recovery. * @reconnect_delay: Time between two consecutive reconnect attempts. * @discovery_nqn: indicates if the subsysnqn is the well-known discovery NQN. + * @kato: Keep-alive timeout. * @host: Virtual NVMe host, contains the NQN and Host ID. */ struct nvmf_ctrl_options { @@ -85,6 +87,7 @@ struct nvmf_ctrl_options { unsigned short tl_retry_count; unsigned int reconnect_delay; bool discovery_nqn; + unsigned int kato; struct nvmf_host *host; }; |