nvmf: Remove num from subsystem
It wasn't used for anything. Change-Id: Ifc8c97481490f6389a739a37df03dea6c88ec692 Signed-off-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
parent
ad8f708667
commit
f1017d7769
@ -139,7 +139,7 @@ spdk_add_nvmf_discovery_subsystem(void)
|
||||
{
|
||||
struct nvmf_tgt_subsystem *app_subsys;
|
||||
|
||||
app_subsys = nvmf_tgt_create_subsystem(0, SPDK_NVMF_DISCOVERY_NQN, SPDK_NVMF_SUBTYPE_DISCOVERY,
|
||||
app_subsys = nvmf_tgt_create_subsystem(SPDK_NVMF_DISCOVERY_NQN, SPDK_NVMF_SUBTYPE_DISCOVERY,
|
||||
NVMF_SUBSYSTEM_MODE_DIRECT,
|
||||
rte_get_master_lcore());
|
||||
if (app_subsys == NULL) {
|
||||
@ -471,7 +471,7 @@ spdk_nvmf_parse_subsystem(struct spdk_conf_section *sp)
|
||||
return -1;
|
||||
}
|
||||
|
||||
app_subsys = nvmf_tgt_create_subsystem(sp->num, nqn, SPDK_NVMF_SUBTYPE_NVME, mode, lcore);
|
||||
app_subsys = nvmf_tgt_create_subsystem(nqn, SPDK_NVMF_SUBTYPE_NVME, mode, lcore);
|
||||
if (app_subsys == NULL) {
|
||||
SPDK_ERRLOG("Subsystem createion failed\n");
|
||||
return -1;
|
||||
@ -666,10 +666,9 @@ spdk_nvmf_parse_subsystem_for_rpc(const char *name,
|
||||
enum spdk_nvmf_subsystem_mode mode;
|
||||
int i;
|
||||
uint64_t mask;
|
||||
int num = 0;
|
||||
|
||||
if (name == NULL) {
|
||||
SPDK_ERRLOG("No NQN specified for Subsystem %d\n", num);
|
||||
SPDK_ERRLOG("No NQN specified for subsystem\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -683,21 +682,13 @@ spdk_nvmf_parse_subsystem_for_rpc(const char *name,
|
||||
return -1;
|
||||
}
|
||||
|
||||
app_subsys = nvmf_tgt_subsystem_first();
|
||||
while (app_subsys) {
|
||||
if (num < app_subsys->subsystem->num) {
|
||||
num = app_subsys->subsystem->num + 1;
|
||||
}
|
||||
app_subsys = nvmf_tgt_subsystem_next(app_subsys);
|
||||
}
|
||||
|
||||
/* Determine which core to assign to the subsystem */
|
||||
mask = spdk_app_get_core_mask();
|
||||
lcore = spdk_nvmf_allocate_lcore(mask, lcore);
|
||||
|
||||
/* Determine the mode the subsysem will operate in */
|
||||
if (mode_str == NULL) {
|
||||
SPDK_ERRLOG("No Mode specified for Subsystem %d\n", num);
|
||||
SPDK_ERRLOG("No Mode specified for Subsystem %s\n", name);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -710,7 +701,7 @@ spdk_nvmf_parse_subsystem_for_rpc(const char *name,
|
||||
return -1;
|
||||
}
|
||||
|
||||
app_subsys = nvmf_tgt_create_subsystem(num, name, SPDK_NVMF_SUBTYPE_NVME,
|
||||
app_subsys = nvmf_tgt_create_subsystem(name, SPDK_NVMF_SUBTYPE_NVME,
|
||||
mode, lcore);
|
||||
if (app_subsys == NULL) {
|
||||
SPDK_ERRLOG("Subsystem creation failed\n");
|
||||
@ -740,12 +731,12 @@ spdk_nvmf_parse_subsystem_for_rpc(const char *name,
|
||||
struct spdk_nvmf_probe_ctx ctx = { 0 };
|
||||
|
||||
if (bdf == NULL) {
|
||||
SPDK_ERRLOG("Subsystem %d: missing NVMe directive\n", num);
|
||||
SPDK_ERRLOG("Subsystem %s: missing NVMe directive\n", name);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (num_devs != 0) {
|
||||
SPDK_ERRLOG("Subsystem %d: Namespaces not allowed for Direct mode\n", num);
|
||||
SPDK_ERRLOG("Subsystem %s: Namespaces not allowed for Direct mode\n", name);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -775,7 +766,7 @@ spdk_nvmf_parse_subsystem_for_rpc(const char *name,
|
||||
const char *namespace;
|
||||
|
||||
if (sn == NULL) {
|
||||
SPDK_ERRLOG("Subsystem %d: missing serial number\n", num);
|
||||
SPDK_ERRLOG("Subsystem %s: missing serial number\n", name);
|
||||
return -1;
|
||||
}
|
||||
if (spdk_nvmf_validate_sn(sn) != 0) {
|
||||
|
@ -216,7 +216,7 @@ nvmf_tgt_start_subsystem(struct nvmf_tgt_subsystem *app_subsys)
|
||||
}
|
||||
|
||||
struct nvmf_tgt_subsystem *
|
||||
nvmf_tgt_create_subsystem(int num, const char *name, enum spdk_nvmf_subtype subtype,
|
||||
nvmf_tgt_create_subsystem(const char *name, enum spdk_nvmf_subtype subtype,
|
||||
enum spdk_nvmf_subsystem_mode mode, uint32_t lcore)
|
||||
{
|
||||
struct spdk_nvmf_subsystem *subsystem;
|
||||
@ -228,7 +228,7 @@ nvmf_tgt_create_subsystem(int num, const char *name, enum spdk_nvmf_subtype subt
|
||||
return NULL;
|
||||
}
|
||||
|
||||
subsystem = spdk_nvmf_create_subsystem(num, name, subtype, mode, app_subsys, connect_cb,
|
||||
subsystem = spdk_nvmf_create_subsystem(name, subtype, mode, app_subsys, connect_cb,
|
||||
disconnect_cb);
|
||||
if (subsystem == NULL) {
|
||||
SPDK_ERRLOG("Subsystem creation failed\n");
|
||||
|
@ -71,8 +71,7 @@ int spdk_nvmf_parse_conf(void);
|
||||
|
||||
void nvmf_tgt_start_subsystem(struct nvmf_tgt_subsystem *subsystem);
|
||||
|
||||
struct nvmf_tgt_subsystem *nvmf_tgt_create_subsystem(int num,
|
||||
const char *name,
|
||||
struct nvmf_tgt_subsystem *nvmf_tgt_create_subsystem(const char *name,
|
||||
enum spdk_nvmf_subtype subtype,
|
||||
enum spdk_nvmf_subsystem_mode mode,
|
||||
uint32_t lcore);
|
||||
|
@ -120,7 +120,6 @@ struct spdk_nvmf_ctrlr_ops {
|
||||
* access to all the NVMe device/namespaces maintained by the subsystem.
|
||||
*/
|
||||
struct spdk_nvmf_subsystem {
|
||||
uint16_t num;
|
||||
uint32_t lcore;
|
||||
char subnqn[SPDK_NVMF_NQN_MAX_LEN];
|
||||
enum spdk_nvmf_subsystem_mode mode;
|
||||
@ -159,8 +158,7 @@ struct spdk_nvmf_subsystem {
|
||||
TAILQ_ENTRY(spdk_nvmf_subsystem) entries;
|
||||
};
|
||||
|
||||
struct spdk_nvmf_subsystem *spdk_nvmf_create_subsystem(int num,
|
||||
const char *name,
|
||||
struct spdk_nvmf_subsystem *spdk_nvmf_create_subsystem(const char *name,
|
||||
enum spdk_nvmf_subtype subtype,
|
||||
enum spdk_nvmf_subsystem_mode mode,
|
||||
void *cb_ctx,
|
||||
|
@ -117,7 +117,7 @@ spdk_nvmf_valid_nqn(const char *nqn)
|
||||
}
|
||||
|
||||
struct spdk_nvmf_subsystem *
|
||||
spdk_nvmf_create_subsystem(int num, const char *name,
|
||||
spdk_nvmf_create_subsystem(const char *name,
|
||||
enum spdk_nvmf_subtype subtype,
|
||||
enum spdk_nvmf_subsystem_mode mode,
|
||||
void *cb_ctx,
|
||||
@ -135,7 +135,6 @@ spdk_nvmf_create_subsystem(int num, const char *name,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
subsystem->num = num;
|
||||
subsystem->subtype = subtype;
|
||||
subsystem->mode = mode;
|
||||
subsystem->cb_ctx = cb_ctx;
|
||||
|
@ -75,8 +75,8 @@ static void nvmf_virtual_set_dsm(struct spdk_nvmf_session *session)
|
||||
}
|
||||
}
|
||||
|
||||
SPDK_TRACELOG(SPDK_TRACE_NVMF, "All devices in Subsystem%d support unmap - enabling DSM\n",
|
||||
session->subsys->num);
|
||||
SPDK_TRACELOG(SPDK_TRACE_NVMF, "All devices in Subsystem %s support unmap - enabling DSM\n",
|
||||
session->subsys->subnqn);
|
||||
session->vcdata.oncs.dsm = 1;
|
||||
}
|
||||
|
||||
|
@ -90,10 +90,9 @@ nvmf_test_create_subsystem(void)
|
||||
struct spdk_nvmf_subsystem *subsystem;
|
||||
|
||||
strncpy(nqn, "nqn.2016-06.io.spdk:subsystem1", sizeof(nqn));
|
||||
subsystem = spdk_nvmf_create_subsystem(1, nqn, SPDK_NVMF_SUBTYPE_NVME,
|
||||
subsystem = spdk_nvmf_create_subsystem(nqn, SPDK_NVMF_SUBTYPE_NVME,
|
||||
NVMF_SUBSYSTEM_MODE_DIRECT, NULL, NULL, NULL);
|
||||
SPDK_CU_ASSERT_FATAL(subsystem != NULL);
|
||||
CU_ASSERT_EQUAL(subsystem->num, 1);
|
||||
CU_ASSERT_STRING_EQUAL(subsystem->subnqn, nqn);
|
||||
spdk_nvmf_delete_subsystem(subsystem);
|
||||
|
||||
@ -102,7 +101,7 @@ nvmf_test_create_subsystem(void)
|
||||
memset(nqn + strlen(nqn), 'a', 222 - strlen(nqn));
|
||||
nqn[222] = '\0';
|
||||
CU_ASSERT(strlen(nqn) == 222);
|
||||
subsystem = spdk_nvmf_create_subsystem(2, nqn, SPDK_NVMF_SUBTYPE_NVME,
|
||||
subsystem = spdk_nvmf_create_subsystem(nqn, SPDK_NVMF_SUBTYPE_NVME,
|
||||
NVMF_SUBSYSTEM_MODE_DIRECT, NULL, NULL, NULL);
|
||||
SPDK_CU_ASSERT_FATAL(subsystem != NULL);
|
||||
CU_ASSERT_STRING_EQUAL(subsystem->subnqn, nqn);
|
||||
@ -113,7 +112,7 @@ nvmf_test_create_subsystem(void)
|
||||
memset(nqn + strlen(nqn), 'a', 223 - strlen(nqn));
|
||||
nqn[223] = '\0';
|
||||
CU_ASSERT(strlen(nqn) == 223);
|
||||
subsystem = spdk_nvmf_create_subsystem(2, nqn, SPDK_NVMF_SUBTYPE_NVME,
|
||||
subsystem = spdk_nvmf_create_subsystem(nqn, SPDK_NVMF_SUBTYPE_NVME,
|
||||
NVMF_SUBSYSTEM_MODE_DIRECT, NULL, NULL, NULL);
|
||||
CU_ASSERT(subsystem == NULL);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user