nvmf: Make the poll rate for the acceptor configurable.
Change-Id: I6517220ef3f1a76938313c566f4ba642805ba1c5 Signed-off-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
parent
d4652fd37f
commit
882b790bfa
@ -55,6 +55,8 @@
|
|||||||
|
|
||||||
#define PORTNUMSTRLEN 32
|
#define PORTNUMSTRLEN 32
|
||||||
|
|
||||||
|
#define ACCEPT_TIMEOUT_US 1000 /* 1ms */
|
||||||
|
|
||||||
struct spdk_nvmf_probe_ctx {
|
struct spdk_nvmf_probe_ctx {
|
||||||
struct spdk_nvmf_subsystem *subsystem;
|
struct spdk_nvmf_subsystem *subsystem;
|
||||||
bool any;
|
bool any;
|
||||||
@ -158,6 +160,7 @@ spdk_nvmf_parse_nvmf_tgt(void)
|
|||||||
int in_capsule_data_size;
|
int in_capsule_data_size;
|
||||||
int max_io_size;
|
int max_io_size;
|
||||||
int acceptor_lcore;
|
int acceptor_lcore;
|
||||||
|
int acceptor_poll_rate;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
sp = spdk_conf_find_section(NULL, "Nvmf");
|
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;
|
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);
|
rc = nvmf_tgt_init(max_queue_depth, max_queues_per_sess, in_capsule_data_size, max_io_size);
|
||||||
if (rc != 0) {
|
if (rc != 0) {
|
||||||
SPDK_ERRLOG("nvmf_tgt_init() failed\n");
|
SPDK_ERRLOG("nvmf_tgt_init() failed\n");
|
||||||
|
@ -58,8 +58,6 @@
|
|||||||
#define SPDK_NVMF_BUILD_ETC "/usr/local/etc/nvmf"
|
#define SPDK_NVMF_BUILD_ETC "/usr/local/etc/nvmf"
|
||||||
#define SPDK_NVMF_DEFAULT_CONFIG SPDK_NVMF_BUILD_ETC "/nvmf.conf"
|
#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 struct spdk_poller *g_acceptor_poller = NULL;
|
||||||
|
|
||||||
static TAILQ_HEAD(, nvmf_tgt_subsystem) g_subsystems = TAILQ_HEAD_INITIALIZER(g_subsystems);
|
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,
|
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);
|
SPDK_NOTICELOG("Acceptor running on core %u\n", g_spdk_nvmf_tgt_conf.acceptor_lcore);
|
||||||
|
|
||||||
|
@ -47,6 +47,7 @@ struct rpc_listen_address {
|
|||||||
|
|
||||||
struct spdk_nvmf_tgt_conf {
|
struct spdk_nvmf_tgt_conf {
|
||||||
uint32_t acceptor_lcore;
|
uint32_t acceptor_lcore;
|
||||||
|
uint32_t acceptor_poll_rate;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct nvmf_tgt_subsystem {
|
struct nvmf_tgt_subsystem {
|
||||||
|
@ -52,6 +52,11 @@
|
|||||||
# Set the global acceptor lcore ID, lcores are numbered starting at 0.
|
# Set the global acceptor lcore ID, lcores are numbered starting at 0.
|
||||||
#AcceptorCore 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.
|
# Define an NVMf Subsystem.
|
||||||
# - NQN is required and must be unique.
|
# - NQN is required and must be unique.
|
||||||
# - Core may be set or not. If set, the specified subsystem will run on
|
# - Core may be set or not. If set, the specified subsystem will run on
|
||||||
|
Loading…
Reference in New Issue
Block a user