Commit 882b790b authored by Ben Walker's avatar Ben Walker
Browse files

nvmf: Make the poll rate for the acceptor configurable.



Change-Id: I6517220ef3f1a76938313c566f4ba642805ba1c5
Signed-off-by: default avatarBen Walker <benjamin.walker@intel.com>
parent d4652fd3
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -55,6 +55,8 @@

#define PORTNUMSTRLEN 32

#define ACCEPT_TIMEOUT_US		1000 /* 1ms */

struct spdk_nvmf_probe_ctx {
	struct spdk_nvmf_subsystem	*subsystem;
	bool				any;
@@ -158,6 +160,7 @@ spdk_nvmf_parse_nvmf_tgt(void)
	int in_capsule_data_size;
	int max_io_size;
	int acceptor_lcore;
	int acceptor_poll_rate;
	int rc;

	sp = spdk_conf_find_section(NULL, "Nvmf");
@@ -206,6 +209,12 @@ spdk_nvmf_parse_nvmf_tgt(void)
	}
	g_spdk_nvmf_tgt_conf.acceptor_lcore = acceptor_lcore;

	acceptor_poll_rate = spdk_conf_section_get_intval(sp, "AcceptorPollRate");
	if (acceptor_poll_rate < 0) {
		acceptor_poll_rate = ACCEPT_TIMEOUT_US;
	}
	g_spdk_nvmf_tgt_conf.acceptor_poll_rate = acceptor_poll_rate;

	rc = nvmf_tgt_init(max_queue_depth, max_queues_per_sess, in_capsule_data_size, max_io_size);
	if (rc != 0) {
		SPDK_ERRLOG("nvmf_tgt_init() failed\n");
+2 −3
Original line number Diff line number Diff line
@@ -58,8 +58,6 @@
#define SPDK_NVMF_BUILD_ETC "/usr/local/etc/nvmf"
#define SPDK_NVMF_DEFAULT_CONFIG SPDK_NVMF_BUILD_ETC "/nvmf.conf"

#define ACCEPT_TIMEOUT_US		10000 /* 10ms */

static struct spdk_poller *g_acceptor_poller = NULL;

static TAILQ_HEAD(, nvmf_tgt_subsystem) g_subsystems = TAILQ_HEAD_INITIALIZER(g_subsystems);
@@ -333,7 +331,8 @@ spdk_nvmf_startup(spdk_event_t event)
	}

	spdk_poller_register(&g_acceptor_poller, acceptor_poll, NULL,
			     g_spdk_nvmf_tgt_conf.acceptor_lcore, NULL, ACCEPT_TIMEOUT_US);
			     g_spdk_nvmf_tgt_conf.acceptor_lcore, NULL,
			     g_spdk_nvmf_tgt_conf.acceptor_poll_rate);

	SPDK_NOTICELOG("Acceptor running on core %u\n", g_spdk_nvmf_tgt_conf.acceptor_lcore);

+1 −0
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ struct rpc_listen_address {

struct spdk_nvmf_tgt_conf {
	uint32_t acceptor_lcore;
	uint32_t acceptor_poll_rate;
};

struct nvmf_tgt_subsystem {
+5 −0
Original line number Diff line number Diff line
@@ -52,6 +52,11 @@
  # Set the global acceptor lcore ID, lcores are numbered starting at 0.
  #AcceptorCore 0

  # Set how often the acceptor polls for incoming connections. The acceptor is also
  # responsible for polling existing connections that have gone idle. 0 means continuously
  # poll. Units in microseconds.
  AcceptorPollRate  1000

# Define an NVMf Subsystem.
# - NQN is required and must be unique.
# - Core may be set or not. If set, the specified subsystem will run on