fabrics: add fast_io_fail_tmo option
Sagi Grimberg
maintainerPATCH 1/1 fabrics: add fast_io_fail_tmo option
Option to fail fast I/O when connecting to a controller. It is useful to set a fast-fail timeout for nvme in case upper layer SW wants to detect unresponsive controllers early (e.g. mdraid).
Signed-off-by Sagi Grimberg <[email protected]>
--- fabrics.c | 12 ++++++++++++ fabrics.h | 1 + 2 files changed, 13 insertions(+)
fabrics.c +12 -0
@@ -69,6 +69,7 @@ const char *conarg_host_traddr = "host_traddr";struct fabrics_config fabrics_cfg = { .ctrl_loss_tmo =-1 , + .fast_io_fail_tmo =-1 , .output_format ="normal" , };
@@ -1004,6 +1005,8 @@ int build_options(char *argstr, int max_len, bool discover) (strncmp (fabrics_cfg.transport,"loop" ,4 ) &&add_int_argument (&argstr, &max_len,"ctrl_loss_tmo" , fabrics_cfg.ctrl_loss_tmo, true)) || +add_int_argument (&argstr, &max_len,"fast_io_fail_tmo" , + fabrics_cfg.fast_io_fail_tmo, true) ||add_int_argument (&argstr, &max_len,"tos" , fabrics_cfg.tos, true) || add_bool_argument(&argstr, &max_len, "duplicate_connect",
@@ -1185,6 +1188,13 @@ retry: p += len; } +if (fabrics_cfg.fast_io_fail_tmo) { + len =sprintf (p,",fast_io_fail_tmo=%d" , fabrics_cfg.fast_io_fail_tmo); +if (len <0 ) +return -EINVAL ; + p += len; + } +if (fabrics_cfg.tos !=-1 ) { len =sprintf (p,",tos=%d" , fabrics_cfg.tos);if (len <0 )
@@ -1567,6 +1577,7 @@ int fabrics_discover(const char *desc, int argc, char **argv, bool connect)OPT_INT ("keep-alive-tmo" ,'k' , &fabrics_cfg.keep_alive_tmo,"keep alive timeout period in seconds" ),OPT_INT ("reconnect-delay" ,'c' , &fabrics_cfg.reconnect_delay,"reconnect timeout period in seconds" ),OPT_INT ("ctrl-loss-tmo" ,'l' , &fabrics_cfg.ctrl_loss_tmo,"controller loss timeout period in seconds" ), +OPT_INT ("fast_io_fail_tmo" ,'f' ,&fabrics_cfg.fast_io_fail_tmo,"fast I/O fail timeout (default off)" ),OPT_INT ("tos" ,'T' , &fabrics_cfg.tos,"type of service" ),OPT_FLAG ("hdr_digest" ,'g' , &fabrics_cfg.hdr_digest,"enable transport protocol header digest (TCP transport)" ), OPT_FLAG("data_digest", 'G', &fabrics_cfg.data_digest, "enable transport protocol data digest (TCP transport)"),
@@ -1650,6 +1661,7 @@ int fabrics_connect(const char *desc, int argc, char **argv)OPT_INT ("keep-alive-tmo" ,'k' , &fabrics_cfg.keep_alive_tmo,"keep alive timeout period in seconds" ),OPT_INT ("reconnect-delay" ,'c' , &fabrics_cfg.reconnect_delay,"reconnect timeout period in seconds" ),OPT_INT ("ctrl-loss-tmo" ,'l' , &fabrics_cfg.ctrl_loss_tmo,"controller loss timeout period in seconds" ), +OPT_INT ("fast_io_fail_tmo" ,'f' , &fabrics_cfg.fast_io_fail_tmo,"fast I/O fail timeout (default off)" ),OPT_INT ("tos" ,'T' , &fabrics_cfg.tos,"type of service" ),OPT_FLAG ("duplicate-connect" ,'D' , &fabrics_cfg.duplicate_connect,"allow duplicate connections between same transport host and subsystem port" ), OPT_FLAG("disable-sqflow", 'd', &fabrics_cfg.disable_sqflow, "disable controller sq flow control (default false)"),
fabrics.h +1 -0
@@ -29,6 +29,7 @@ struct fabrics_config {int keep_alive_tmo;int reconnect_delay;int ctrl_loss_tmo; +int fast_io_fail_tmo;int tos;const char *raw;char *device;
Signature · 7 lines
2.27.0 _______________________________________________ Linux-nvme mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-nvme
Quoted 10 lines · Sagi Grimberg
Option to fail fast I/O when connecting to a controller. It is useful to set a fast-fail timeout for nvme in case upper layer SW wants to detect unresponsive controllers early (e.g. mdraid).
Signed-off-by Sagi Grimberg <[email protected]>--- fabrics.c | 12 ++++++++++++ fabrics.h | 1 + 2 files changed, 13 insertions(+)
D'oh.
Of course.
Reviewed-by Hannes Reinecke <[email protected]>
Cheers,
Hannes
Signature · 9 lines
Dr. Hannes Reinecke Kernel Storage Architect [email protected] +49 911 74053 688 SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer _______________________________________________ Linux-nvme mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-nvme
Applied, thank you.
_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme