Commit 7cbe1ccd authored by Changpeng Liu's avatar Changpeng Liu
Browse files

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: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464489


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarBroadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 62bb6528
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -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.
 */
+4 −10
Original line number Diff line number Diff line
@@ -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) {
+2 −0
Original line number Diff line number Diff line
@@ -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