diff --git a/etc/spdk/iscsi.conf.in b/etc/spdk/iscsi.conf.in index 93aaa1ea5..4953e5c6e 100644 --- a/etc/spdk/iscsi.conf.in +++ b/etc/spdk/iscsi.conf.in @@ -99,9 +99,9 @@ # The number of attempts per I/O when an I/O fails. Do not include # this key to get the default behavior. - NvmeRetryCount 4 + RetryCount 4 # Timeout for each command, in seconds. If 0, don't track timeouts. - NvmeTimeoutValue 0 + Timeout 0 # Action to take on command time out. Only valid when Timeout is greater # than 0. This may be 'Reset' to reset the controller, 'Abort' to abort # the command, or 'None' to just print a message but do nothing. diff --git a/etc/spdk/nvmf.conf.in b/etc/spdk/nvmf.conf.in index 1bc527f3d..3903eb309 100644 --- a/etc/spdk/nvmf.conf.in +++ b/etc/spdk/nvmf.conf.in @@ -90,9 +90,9 @@ # The number of attempts per I/O when an I/O fails. Do not include # this key to get the default behavior. - NvmeRetryCount 4 + RetryCount 4 # Timeout for each command, in seconds. If 0, don't track timeouts. - NvmeTimeoutValue 0 + Timeout 0 # Action to take on command time out. Only valid when Timeout is greater # than 0. This may be 'Reset' to reset the controller, 'Abort' to abort # the command, or 'None' to just print a message but do nothing. diff --git a/etc/spdk/vhost.conf.in b/etc/spdk/vhost.conf.in index bf7838069..ec42f6309 100644 --- a/etc/spdk/vhost.conf.in +++ b/etc/spdk/vhost.conf.in @@ -78,9 +78,9 @@ # The number of attempts per I/O when an I/O fails. Do not include # this key to get the default behavior. - NvmeRetryCount 4 + RetryCount 4 # Timeout for each command, in seconds. If 0, don't track timeouts. - NvmeTimeoutValue 0 + Timeout 0 # Action to take on command time out. Only valid when Timeout is greater # than 0. This may be 'Reset' to reset the controller, 'Abort' to abort # the command, or 'None' to just print a message but do nothing. diff --git a/lib/bdev/nvme/blockdev_nvme.c b/lib/bdev/nvme/blockdev_nvme.c index 0dd841032..eccc74bbe 100644 --- a/lib/bdev/nvme/blockdev_nvme.c +++ b/lib/bdev/nvme/blockdev_nvme.c @@ -768,17 +768,24 @@ bdev_nvme_library_init(void) int rc; size_t i; struct nvme_probe_ctx probe_ctx = {}; + int retry_count; sp = spdk_conf_find_section(NULL, "Nvme"); if (sp == NULL) { return 0; } - spdk_nvme_retry_count = spdk_conf_section_get_intval(sp, "NvmeRetryCount"); - if (spdk_nvme_retry_count < 0) { - spdk_nvme_retry_count = SPDK_NVME_DEFAULT_RETRY_COUNT; + if ((retry_count = spdk_conf_section_get_intval(sp, "RetryCount")) < 0) { + if ((retry_count = spdk_conf_section_get_intval(sp, "NvmeRetryCount")) < 0) { + retry_count = SPDK_NVME_DEFAULT_RETRY_COUNT; + } else { + SPDK_WARNLOG("NvmeRetryCount was renamed to RetryCount\n"); + SPDK_WARNLOG("Please update your configuration file"); + } } + spdk_nvme_retry_count = retry_count; + for (i = 0; i < NVME_MAX_CONTROLLERS; i++) { val = spdk_conf_section_get_nmval(sp, "TransportID", i, 0); if (val == NULL) { @@ -802,8 +809,14 @@ bdev_nvme_library_init(void) probe_ctx.count++; } - if ((g_timeout = spdk_conf_section_get_intval(sp, "NvmeTimeoutValue")) < 0) { - g_timeout = 0; + if ((g_timeout = spdk_conf_section_get_intval(sp, "Timeout")) < 0) { + /* Check old name for backward compatibility */ + if ((g_timeout = spdk_conf_section_get_intval(sp, "NvmeTimeoutValue")) < 0) { + g_timeout = 0; + } else { + SPDK_WARNLOG("NvmeTimeoutValue was renamed to Timeout\n"); + SPDK_WARNLOG("Please update your configuration file\n"); + } } if (g_timeout > 0) {