Commit 01b6bd8a authored by Changpeng Liu's avatar Changpeng Liu Committed by Tomasz Zawadzki
Browse files

nvmf: fix the associate timeout value



SPDK poller uses microsecond as the input parameter, so we need to
change the correct value when opts.association_timeout is expressed
by millisecond.

Change-Id: Ia674f0115ea176b998e4c0c70b8ce75b28984701
Signed-off-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3861


Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 5d5a9077
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -86,6 +86,7 @@ struct spdk_nvmf_transport_opts {
	uint32_t	sock_priority;
	int		acceptor_backlog;
	uint32_t	abort_timeout_sec;
	/* ms */
	uint32_t	association_timeout;
};

+2 −2
Original line number Diff line number Diff line
@@ -788,7 +788,7 @@ nvmf_ctrlr_cc_shn_done(struct spdk_io_channel_iter *i, int status)
	/* After CC.EN transitions to 0 (due to shutdown or reset), the association
	 * between the host and controller shall be preserved for at least 2 minutes */
	ctrlr->association_timer = SPDK_POLLER_REGISTER(nvmf_ctrlr_association_remove, ctrlr,
				   ctrlr->admin_qpair->transport->opts.association_timeout);
				   ctrlr->admin_qpair->transport->opts.association_timeout * 1000);
}

static void
@@ -808,7 +808,7 @@ nvmf_ctrlr_cc_reset_done(struct spdk_io_channel_iter *i, int status)
	/* After CC.EN transitions to 0 (due to shutdown or reset), the association
	 * between the host and controller shall be preserved for at least 2 minutes */
	ctrlr->association_timer = SPDK_POLLER_REGISTER(nvmf_ctrlr_association_remove, ctrlr,
				   ctrlr->admin_qpair->transport->opts.association_timeout);
				   ctrlr->admin_qpair->transport->opts.association_timeout * 1000);
}

const struct spdk_nvmf_registers *
+2 −2
Original line number Diff line number Diff line
@@ -44,7 +44,7 @@
#include "spdk/util.h"

#define MAX_MEMPOOL_NAME_LENGTH 40
#define NVMF_TRANSPORT_DEFAULT_ASSOCIATION_TIMEOUT 120000 /* ms */
#define NVMF_TRANSPORT_DEFAULT_ASSOCIATION_TIMEOUT_IN_MS 120000

struct nvmf_transport_ops_list_element {
	struct spdk_nvmf_transport_ops			ops;
@@ -500,7 +500,7 @@ spdk_nvmf_transport_opts_init(const char *transport_name,
		return false;
	}

	opts->association_timeout = NVMF_TRANSPORT_DEFAULT_ASSOCIATION_TIMEOUT;
	opts->association_timeout = NVMF_TRANSPORT_DEFAULT_ASSOCIATION_TIMEOUT_IN_MS;
	ops->opts_init(opts);
	return true;
}