From: Nitzan Carmi Date: Sun, 13 Aug 2017 15:45:04 +0000 (+0300) Subject: nvme-cli/fabrics: Add ctrl-loss-tmo param to connect cmd X-Git-Tag: v1.4~14 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=82bbba31ec7c146411057372cac9ff46f5766829;p=users%2Fsagi%2Fnvme-cli.git nvme-cli/fabrics: Add ctrl-loss-tmo param to connect cmd Added 'ctrl-loss-tmo' to 'connect' command so users can specify the controller lost timeout period. usage examples: nvme connect --ctrl-loss-tmo=0 --transport=rdma --traddr=10.0.1.1 --nqn=test-nvme nvme connect -l 0 -t rdma -a 10.0.1.1 -n test_nvme Signed-off-by: Nitzan Carmi Reviewed-by: Max Gurtovoy Signed-off-by: Keith Busch --- diff --git a/fabrics.c b/fabrics.c index 9ed11274..4871e175 100644 --- a/fabrics.c +++ b/fabrics.c @@ -58,6 +58,7 @@ static struct config { char *queue_size; char *keep_alive_tmo; char *reconnect_delay; + char *ctrl_loss_tmo; char *raw; char *device; } cfg = { NULL }; @@ -585,6 +586,14 @@ static int build_options(char *argstr, int max_len) max_len -= len; } + if (cfg.ctrl_loss_tmo) { + len = snprintf(argstr, max_len, ",ctrl_loss_tmo=%s", cfg.ctrl_loss_tmo); + if (len < 0) + return -EINVAL; + argstr += len; + max_len -= len; + } + return 0; } @@ -863,6 +872,7 @@ int connect(const char *desc, int argc, char **argv) {"queue-size", 'Q', "LIST", CFG_STRING, &cfg.queue_size, required_argument, "number of io queue elements to use (default 128)" }, {"keep-alive-tmo", 'k', "LIST", CFG_STRING, &cfg.keep_alive_tmo, required_argument, "keep alive timeout period in seconds" }, {"reconnect-delay", 'c', "LIST", CFG_STRING, &cfg.reconnect_delay, required_argument, "reconnect timeout period in seconds" }, + {"ctrl-loss-tmo", 'l', "LIST", CFG_STRING, &cfg.ctrl_loss_tmo, required_argument, "controller loss timeout period in seconds" }, {NULL}, };