nvmf: move discovery subsystem creation to conf.c
It is not currently configurable, but this will allow us to make the discovery subsystem have config options (e.g. which lcore to run on). Change-Id: I788a64ba4462b023453191e509ce8de59fd90ae4 Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
parent
35bc1e93e1
commit
89031c3e27
@ -68,6 +68,30 @@ struct spdk_nvmf_probe_ctx {
|
|||||||
#define SPDK_NVMF_CONFIG_QUEUE_DEPTH_MIN 16
|
#define SPDK_NVMF_CONFIG_QUEUE_DEPTH_MIN 16
|
||||||
#define SPDK_NVMF_CONFIG_QUEUE_DEPTH_MAX 1024
|
#define SPDK_NVMF_CONFIG_QUEUE_DEPTH_MAX 1024
|
||||||
|
|
||||||
|
static int
|
||||||
|
spdk_add_nvmf_discovery_subsystem(void)
|
||||||
|
{
|
||||||
|
struct spdk_nvmf_subsystem *subsystem;
|
||||||
|
char *name;
|
||||||
|
|
||||||
|
name = strdup(SPDK_NVMF_DISCOVERY_NQN);
|
||||||
|
if (name == NULL) {
|
||||||
|
SPDK_ERRLOG("strdup ss_group->name error\n");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
subsystem = nvmf_create_subsystem(0, name, SPDK_NVMF_SUBTYPE_DISCOVERY, rte_get_master_lcore());
|
||||||
|
if (subsystem == NULL) {
|
||||||
|
SPDK_ERRLOG("Failed creating discovery nvmf library subsystem\n");
|
||||||
|
free(name);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
free(name);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
spdk_nvmf_parse_nvmf_tgt(void)
|
spdk_nvmf_parse_nvmf_tgt(void)
|
||||||
{
|
{
|
||||||
@ -97,7 +121,18 @@ spdk_nvmf_parse_nvmf_tgt(void)
|
|||||||
max_queues_per_sess = nvmf_min(max_queues_per_sess, SPDK_NVMF_CONFIG_QUEUES_PER_SESSION_MAX);
|
max_queues_per_sess = nvmf_min(max_queues_per_sess, SPDK_NVMF_CONFIG_QUEUES_PER_SESSION_MAX);
|
||||||
|
|
||||||
rc = nvmf_tgt_init(max_queue_depth, max_queues_per_sess);
|
rc = nvmf_tgt_init(max_queue_depth, max_queues_per_sess);
|
||||||
|
if (rc != 0) {
|
||||||
|
SPDK_ERRLOG("nvmf_tgt_init() failed\n");
|
||||||
return rc;
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
rc = spdk_add_nvmf_discovery_subsystem();
|
||||||
|
if (rc != 0) {
|
||||||
|
SPDK_ERRLOG("spdk_add_nvmf_discovery_subsystem failed\n");
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -162,13 +162,7 @@ nvmf_tgt_subsystem_initialize(void)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = spdk_add_nvmf_discovery_subsystem();
|
return 0;
|
||||||
if (rc < 0) {
|
|
||||||
SPDK_ERRLOG("spdk_add_nvmf_discovery_subsystem failed\n");
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
|
|
||||||
return rc;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -211,30 +211,6 @@ nvmf_subsystem_add_ctrlr(struct spdk_nvmf_subsystem *subsystem,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
|
||||||
spdk_add_nvmf_discovery_subsystem(void)
|
|
||||||
{
|
|
||||||
struct spdk_nvmf_subsystem *subsystem;
|
|
||||||
char *name;
|
|
||||||
|
|
||||||
name = strdup(SPDK_NVMF_DISCOVERY_NQN);
|
|
||||||
if (name == NULL) {
|
|
||||||
SPDK_ERRLOG("strdup ss_group->name error\n");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
subsystem = nvmf_create_subsystem(0, name, SPDK_NVMF_SUBTYPE_DISCOVERY, rte_get_master_lcore());
|
|
||||||
if (subsystem == NULL) {
|
|
||||||
SPDK_ERRLOG("Failed creating discovery nvmf library subsystem\n");
|
|
||||||
free(name);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
free(name);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
spdk_format_discovery_log(struct spdk_nvmf_discovery_log_page *disc_log, uint32_t length)
|
spdk_format_discovery_log(struct spdk_nvmf_discovery_log_page *disc_log, uint32_t length)
|
||||||
{
|
{
|
||||||
|
@ -113,9 +113,6 @@ nvmf_subsystem_add_ctrlr(struct spdk_nvmf_subsystem *subsystem,
|
|||||||
int
|
int
|
||||||
spdk_shutdown_nvmf_subsystems(void);
|
spdk_shutdown_nvmf_subsystems(void);
|
||||||
|
|
||||||
int
|
|
||||||
spdk_add_nvmf_discovery_subsystem(void);
|
|
||||||
|
|
||||||
void
|
void
|
||||||
spdk_format_discovery_log(struct spdk_nvmf_discovery_log_page *disc_log, uint32_t length);
|
spdk_format_discovery_log(struct spdk_nvmf_discovery_log_page *disc_log, uint32_t length);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user