nvmf: remove MaxSessionsPerSubsystem config option

There can be only one session per subsystem.

Change-Id: I8ba85a5ebd11dd71fda2a4bafa97a0935609379f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
Daniel Verkamp 2016-07-11 15:51:26 -07:00
parent 6e415c4411
commit 6d49820adc
3 changed files with 2 additions and 25 deletions

View File

@ -48,7 +48,6 @@ spdk_nvmf_parse_nvmf_tgt(void)
{ {
struct spdk_conf_section *sp; struct spdk_conf_section *sp;
char *nodebase; char *nodebase;
int max_sessions_per_subsystem;
int max_queue_depth; int max_queue_depth;
int max_conn_per_sess; int max_conn_per_sess;
int rc; int rc;
@ -64,11 +63,6 @@ spdk_nvmf_parse_nvmf_tgt(void)
nodebase = SPDK_NVMF_DEFAULT_NODEBASE; nodebase = SPDK_NVMF_DEFAULT_NODEBASE;
} }
max_sessions_per_subsystem = spdk_conf_section_get_intval(sp, "MaxSessionsPerSubsystem");
if (max_sessions_per_subsystem < 0) {
max_sessions_per_subsystem = SPDK_NVMF_DEFAULT_MAX_SESSIONS_PER_SUBSYSTEM;
}
max_queue_depth = spdk_conf_section_get_intval(sp, "MaxQueueDepth"); max_queue_depth = spdk_conf_section_get_intval(sp, "MaxQueueDepth");
if (max_queue_depth < 0) { if (max_queue_depth < 0) {
max_queue_depth = SPDK_NVMF_DEFAULT_MAX_QUEUE_DEPTH; max_queue_depth = SPDK_NVMF_DEFAULT_MAX_QUEUE_DEPTH;
@ -79,8 +73,7 @@ spdk_nvmf_parse_nvmf_tgt(void)
max_conn_per_sess = SPDK_NVMF_DEFAULT_MAX_CONNECTIONS_PER_SESSION; max_conn_per_sess = SPDK_NVMF_DEFAULT_MAX_CONNECTIONS_PER_SESSION;
} }
rc = nvmf_tgt_init(nodebase, max_sessions_per_subsystem, rc = nvmf_tgt_init(nodebase, max_queue_depth, max_conn_per_sess);
max_queue_depth, max_conn_per_sess);
return rc; return rc;
} }

View File

@ -66,11 +66,9 @@ SPDK_LOG_REGISTER_TRACE_FLAG("nvmf", SPDK_TRACE_NVMF)
* needed for all possible admin and I/O queue requests. * needed for all possible admin and I/O queue requests.
*/ */
#define SPDK_NVMF_ADMINQ_POOL_SIZE(spdk) (MAX_SUBSYSTEMS * \ #define SPDK_NVMF_ADMINQ_POOL_SIZE(spdk) (MAX_SUBSYSTEMS * \
(spdk->MaxSessionsPerSubsystem) * \
spdk->MaxQueueDepth) spdk->MaxQueueDepth)
#define SPDK_NVMF_IOQ_POOL_SIZE(spdk) (MAX_SUBSYSTEMS * \ #define SPDK_NVMF_IOQ_POOL_SIZE(spdk) (MAX_SUBSYSTEMS * \
(spdk->MaxSessionsPerSubsystem) * \
(spdk->MaxConnectionsPerSession - 1) * \ (spdk->MaxConnectionsPerSession - 1) * \
spdk->MaxQueueDepth) spdk->MaxQueueDepth)
@ -133,7 +131,6 @@ spdk_nvmf_check_pools(void)
int int
nvmf_tgt_init(char *nodebase, nvmf_tgt_init(char *nodebase,
int max_sessions_per_subsystem,
int max_queue_depth, int max_conn_per_sess) int max_queue_depth, int max_conn_per_sess)
{ {
int rc; int rc;
@ -145,16 +142,6 @@ nvmf_tgt_init(char *nodebase,
} }
SPDK_TRACELOG(SPDK_TRACE_DEBUG, "NodeBase: %s\n", g_nvmf_tgt.nodebase); SPDK_TRACELOG(SPDK_TRACE_DEBUG, "NodeBase: %s\n", g_nvmf_tgt.nodebase);
if (max_sessions_per_subsystem >= 1 &&
max_sessions_per_subsystem <= SPDK_NVMF_DEFAULT_MAX_SESSIONS_PER_SUBSYSTEM) {
g_nvmf_tgt.MaxSessionsPerSubsystem = max_sessions_per_subsystem;
SPDK_TRACELOG(SPDK_TRACE_DEBUG, "MaxSessionsPerSubsystem: %d\n",
g_nvmf_tgt.MaxSessionsPerSubsystem);
} else {
SPDK_ERRLOG("Invalid MaxSessionsPerSubsystem: %d\n", max_sessions_per_subsystem);
return -EINVAL;
}
if (max_queue_depth >= 1 && if (max_queue_depth >= 1 &&
max_queue_depth <= SPDK_NVMF_DEFAULT_MAX_QUEUE_DEPTH) { max_queue_depth <= SPDK_NVMF_DEFAULT_MAX_QUEUE_DEPTH) {
g_nvmf_tgt.MaxQueueDepth = max_queue_depth; g_nvmf_tgt.MaxQueueDepth = max_queue_depth;

View File

@ -56,7 +56,6 @@
#define SPDK_NVMF_DEFAULT_NUM_SESSIONS_PER_LCORE 1 #define SPDK_NVMF_DEFAULT_NUM_SESSIONS_PER_LCORE 1
#define SPDK_NVMF_DEFAULT_NODEBASE "nqn.2016-06.io.spdk" #define SPDK_NVMF_DEFAULT_NODEBASE "nqn.2016-06.io.spdk"
#define SPDK_NVMF_DEFAULT_MAX_SESSIONS_PER_SUBSYSTEM 1
#define SPDK_NVMF_DEFAULT_MAX_QUEUE_DEPTH 128 #define SPDK_NVMF_DEFAULT_MAX_QUEUE_DEPTH 128
#define SPDK_NVMF_DEFAULT_MAX_CONNECTIONS_PER_SESSION 4 #define SPDK_NVMF_DEFAULT_MAX_CONNECTIONS_PER_SESSION 4
#define SPDK_NVMF_DEFAULT_SIN_PORT ((uint16_t)4420) #define SPDK_NVMF_DEFAULT_SIN_PORT ((uint16_t)4420)
@ -103,7 +102,6 @@ struct spdk_nvmf_globals {
pthread_mutex_t mutex; pthread_mutex_t mutex;
int MaxSessionsPerSubsystem;
int MaxQueueDepth; int MaxQueueDepth;
int MaxConnectionsPerSession; int MaxConnectionsPerSession;
@ -114,8 +112,7 @@ void
nvmf_complete_cmd(void *rsp, const struct spdk_nvme_cpl *cmp); nvmf_complete_cmd(void *rsp, const struct spdk_nvme_cpl *cmp);
int nvmf_tgt_init(char *nodebase, int max_sessions, int max_queue_depth, int nvmf_tgt_init(char *nodebase, int max_queue_depth, int max_conn_per_sess);
int max_conn_per_sess);
int nvmf_initialize(void); int nvmf_initialize(void);
void nvmf_shutdown(void); void nvmf_shutdown(void);