linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/2] nvme-cli/fabrics: Add reconnect-delay param to connect cmd
@ 2016-09-20 15:02 Steve Wise
  2016-09-20 21:57 ` J Freyensee
  0 siblings, 1 reply; 2+ messages in thread
From: Steve Wise @ 2016-09-20 15:02 UTC (permalink / raw)


Added 'reconnect-delay' to 'connect' command so users can specify the
delay time, in seconds, before reconnecting due to a keep alive timeout.

usage examples:

nvme connect --reconnect-delay=30 --transport=rdma --traddr=10.0.1.14 --nqn=test-nvme
nvme connect -r 30 -t rdma -a 10.0.1.14 -n test-nvme


Signed-off-by: Steve Wise <swise at opengridcomputing.com>
---
 fabrics.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/fabrics.c b/fabrics.c
index bb144bf..f80ae80 100644
--- a/fabrics.c
+++ b/fabrics.c
@@ -52,6 +52,7 @@ struct config {
 	char *hostnqn;
 	char *nr_io_queues;
 	char *keep_alive_tmo;
+	char *reconnect_delay;
 	char *raw;
 	char *device;
 } cfg = { 0 };
@@ -499,6 +500,14 @@ static int build_options(char *argstr, int max_len)
 		max_len -= len;
 	}
 
+	if (cfg.reconnect_delay) {
+		len = snprintf(argstr, max_len, ",reconnect_delay=%s", cfg.reconnect_delay);
+		if (len < 0)
+			return -EINVAL;
+		argstr += len;
+		max_len -= len;
+	}
+
 	return 0;
 }
 
@@ -735,6 +744,8 @@ int connect(const char *desc, int argc, char **argv)
 			"number of io queues to use (default is core count)" },
 		{"keep-alive-tmo", 'k', "LIST", CFG_STRING, &cfg.keep_alive_tmo, required_argument,
 			"keep alive timeout period in seconds" },
+		{"reconnect-delay", 'r', "LIST", CFG_STRING, &cfg.reconnect_delay, required_argument,
+			"reconnect timeout period in seconds" },
 		{0},
 	};
 
-- 
2.7.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH 2/2] nvme-cli/fabrics: Add reconnect-delay param to connect cmd
  2016-09-20 15:02 [PATCH 2/2] nvme-cli/fabrics: Add reconnect-delay param to connect cmd Steve Wise
@ 2016-09-20 21:57 ` J Freyensee
  0 siblings, 0 replies; 2+ messages in thread
From: J Freyensee @ 2016-09-20 21:57 UTC (permalink / raw)


On Tue, 2016-09-20@08:02 -0700, Steve Wise wrote:
> Added 'reconnect-delay' to 'connect' command so users can specify the
> delay time, in seconds, before reconnecting due to a keep alive
> timeout.
> 
> usage examples:
> 
> nvme connect --reconnect-delay=30 --transport=rdma --traddr=10.0.1.14 
> --nqn=test-nvme
> nvme connect -r 30 -t rdma -a 10.0.1.14 -n test-nvme
> 
> 
> Signed-off-by: Steve Wise <swise at opengridcomputing.com>

Also looks good,

Reviewed-by: Jay Freyensee <james_p_freyensee at linux.intel.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-09-20 21:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-20 15:02 [PATCH 2/2] nvme-cli/fabrics: Add reconnect-delay param to connect cmd Steve Wise
2016-09-20 21:57 ` J Freyensee

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).