Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-15-SP2:Update
nvme-cli
0009-fabrics-ensure-zero-kato-for-non-persisten...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0009-fabrics-ensure-zero-kato-for-non-persistent-controllers.patch of Package nvme-cli
From: Martin George <marting@netapp.com> Date: Wed, 3 Mar 2021 11:49:19 +0530 Subject: [PATCH] fabrics: ensure zero kato for non-persistent controllers References: bsc#1182591 Git-commit: a67d001330ae1c407aa4f8491436bb2d0128d47f Add a helper function that sets the default kato value for the discovery controllers. Along with ensuring a non-zero kato value (i.e. NVMF_DEF_DISC_TMO) is passed to a persistent discovery controller, it also ensures a zero kato value is passed to a non-persistent discovery controller, as mandated by the NVMe spec. Signed-off-by: Martin George <marting@netapp.com> --- fabrics.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) --- a/fabrics.c +++ b/fabrics.c @@ -855,6 +855,16 @@ static int build_options(char *argstr, i return 0; } +static void set_discovery_kato(struct config *cfg) +{ + /* Set kato to NVMF_DEF_DISC_TMO for persistent controllers */ + if (cfg->persistent && !cfg->keep_alive_tmo) + cfg->keep_alive_tmo = NVMF_DEF_DISC_TMO; + /* Set kato to zero for non-persistent controllers */ + else if (!cfg->persistent && (cfg->keep_alive_tmo > 0)) + cfg->keep_alive_tmo = 0; +} + static int connect_ctrl(struct nvmf_disc_rsp_page_entry *e) { char argstr[BUF_SIZE], *p; @@ -1220,8 +1230,7 @@ static int discover_from_conf_file(const if (err) continue; - if (cfg.persistent && !cfg.keep_alive_tmo) - cfg.keep_alive_tmo = NVMF_DEF_DISC_TMO; + set_discovery_kato(&cfg); err = build_options(argstr, BUF_SIZE, true); if (err) { @@ -1286,8 +1295,8 @@ int discover(const char *desc, int argc, if (!cfg.transport && !cfg.traddr) { ret = discover_from_conf_file(desc, argstr, opts, connect); } else { - if (cfg.persistent && !cfg.keep_alive_tmo) - cfg.keep_alive_tmo = NVMF_DEF_DISC_TMO; + set_discovery_kato(&cfg); + ret = build_options(argstr, BUF_SIZE, true); if (ret) goto out;
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor