Skip to contentSkip to conversation

nvme-cli/fabrics: Add keep-alive-tmo param to connect cmd

PATCH New Steve Wise 3 participants 3 messages Sep 20, 2016 – Sep 22, 2016 NVMe

lore
Share & tools
lore

Steve Wise

author
#0 lore raw

PATCH 1/2 nvme-cli/fabrics: Add keep-alive-tmo param to connect cmd

Added 'keep-alive-tmo' to 'connect' command so users can specify the keep alive timeout period.

usage examples:

nvme connect --keep-alive-tmo=30 --transport=rdma --traddr=10.0.1.14 --nqn=test-nvme nvme connect -k 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(+)
fabrics.c +11 -0
index 18e961c..bb144bf 100644
@@ -51,6 +51,7 @@ struct config {
 	char *trsvcid;
 	char *hostnqn;
 	char *nr_io_queues;
+	char *keep_alive_tmo;
 	char *raw;
 	char *device;
 } cfg = { 0 };
@@ -490,6 +491,14 @@ static int build_options(char *argstr, int max_len)
 		max_len -= len;
 	}
 
+	if (cfg.keep_alive_tmo) {
+		len = snprintf(argstr, max_len, ",keep_alive_tmo=%s", cfg.keep_alive_tmo);
+		if (len < 0)
+			return -EINVAL;
+		argstr += len;
+		max_len -= len;
+	}
+
 	return 0;
 }
 
@@ -724,6 +733,8 @@ int connect(const char *desc, int argc, char **argv)
 			"user-defined hostnqn" },
 		{"nr-io-queues", 'i', "LIST", CFG_STRING, &cfg.nr_io_queues, required_argument,
 			"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" },
 		{0},
 	};
 
Signature · 1 line
2.7.0
#1 lore raw

PATCH 1/2 nvme-cli/fabrics: Add keep-alive-tmo param to connect cmd

Quoted 11 lines · Steve Wise

Added 'keep-alive-tmo' to 'connect' command so users can specify the keep alive timeout period.

usage examples:

nvme connect --keep-alive-tmo=30 --transport=rdma --traddr=10.0.1.14 --nqn=test-nvme
nvme connect -k 30 -t rdma -a 10.0.1.14 -n test-nvme

Signed-off-by: Steve Wise <swise at opengridcomputing.com> ?

Looks good to me,
Reviewed-by: Jay Freyensee <james_p_freyensee at linux.intel.com>

#2 lore raw

PATCH 1/2 nvme-cli/fabrics: Add keep-alive-tmo param to connect cmd

Quoted 10 lines · J Freyensee
Quoted 9 lines · Steve Wise

Added 'keep-alive-tmo' to 'connect' command so users can specify the keep alive timeout period.

usage examples:

nvme connect --keep-alive-tmo=30 --transport=rdma --traddr=10.0.1.14 --nqn=test-nvme
nvme connect -k 30 -t rdma -a 10.0.1.14 -n test-nvme

Quoted 5 lines
Quoted 2 lines

Signed-off-by: Steve Wise <swise at opengridcomputing.com> ?

Looks good to me,
Reviewed-by: Jay Freyensee <james_p_freyensee at linux.intel.com>

Thanks, I've applied both patches in this series. I had to slightly modify the patches to apply on the master branch due to some code formatting changes.

Now that I look at it, I actually think the code format was nicer before the cleanups, but that's okay. :)