nvme: move SPDK_NVME_DEFAULT_RETRY_COUNT out from nvme.h

SPDK_NVME_DEFAULT_RETRY_COUNT is the default value for each controller, so
we can move it out from public header file, and change the value if users
provide a new one.

"NvmeRetryCount" was deprecated for a long time, so we removed the support
for this configuration option as well.

Change-Id: I187251cc1e5342abb4fce96727d06631b7c16a01
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464489
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Changpeng Liu 2019-08-08 00:31:28 -04:00
parent 62bb65289d
commit 7cbe1ccd56
3 changed files with 6 additions and 12 deletions

View File

@ -48,8 +48,6 @@ extern "C" {
#include "spdk/nvme_spec.h"
#include "spdk/nvmf_spec.h"
#define SPDK_NVME_DEFAULT_RETRY_COUNT (4)
/**
* Opaque handle to a controller. Returned by spdk_nvme_probe()'s attach_cb.
*/

View File

@ -104,7 +104,7 @@ static TAILQ_HEAD(, nvme_probe_skip_entry) g_skipped_nvme_ctrlrs = TAILQ_HEAD_IN
static struct spdk_bdev_nvme_opts g_opts = {
.action_on_timeout = SPDK_BDEV_NVME_TIMEOUT_ACTION_NONE,
.timeout_us = 0,
.retry_count = SPDK_NVME_DEFAULT_RETRY_COUNT,
.retry_count = 4,
.nvme_adminq_poll_period_us = 1000000ULL,
.nvme_ioq_poll_period_us = 0,
.io_queue_requests = 0,
@ -1379,16 +1379,10 @@ bdev_nvme_library_init(void)
goto end;
}
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\n");
}
}
retry_count = spdk_conf_section_get_intval(sp, "RetryCount");
if (retry_count >= 0) {
g_opts.retry_count = retry_count;
}
val = spdk_conf_section_get_val(sp, "TimeoutUsec");
if (val != NULL) {

View File

@ -141,6 +141,8 @@ extern pid_t g_spdk_nvme_pid;
#define DEFAULT_ADMIN_QUEUE_REQUESTS (32)
#define DEFAULT_IO_QUEUE_REQUESTS (512)
#define SPDK_NVME_DEFAULT_RETRY_COUNT (4)
#define MIN_KEEP_ALIVE_TIMEOUT_IN_MS (10000)
/* We want to fit submission and completion rings each in a single 2MB