Commit 15f910ec authored by Ben Walker's avatar Ben Walker
Browse files

bdev/nvme: Improve names of fields in config file



Remove the "Nvme" from several field names. The parser
will still accept the old name for backward compatibility.

Change-Id: I6fa86ec359b23fb63960d0aa479a845b36a0977a
Signed-off-by: default avatarBen Walker <benjamin.walker@intel.com>
parent acd0b457
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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.
+2 −2
Original line number Diff line number Diff line
@@ -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.
+2 −2
Original line number Diff line number Diff line
@@ -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.
+18 −5
Original line number Diff line number Diff line
@@ -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, "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) {