nvmf: Remove cntlid from spdk_nvmf_conn
The cntlid is inside the session, so no need for duplicate data. Change-Id: I5669ee6393807959506dfec36a7583af77386fc4 Signed-off-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
parent
a9c7af9d83
commit
011c0a24df
@ -307,7 +307,6 @@ nvmf_init_conn_properites(struct spdk_nvmf_conn *conn,
|
||||
struct nvmf_session *session,
|
||||
struct spdk_nvmf_fabric_connect_rsp *response)
|
||||
{
|
||||
conn->cntlid = response->status_code_specific.success.cntlid;
|
||||
nvmf_init_session_properties(session, conn->rdma.queue_depth);
|
||||
}
|
||||
|
||||
|
@ -60,7 +60,6 @@ struct spdk_nvmf_conn {
|
||||
struct nvmf_session *sess;
|
||||
|
||||
uint16_t qid;
|
||||
uint16_t cntlid;
|
||||
|
||||
enum conn_type type;
|
||||
volatile enum conn_state state;
|
||||
|
@ -435,7 +435,6 @@ nvmf_process_connect(struct spdk_nvmf_request *req)
|
||||
response = &req->rsp->connect_rsp;
|
||||
|
||||
conn->qid = connect->qid;
|
||||
conn->cntlid = connect_data->cntlid;
|
||||
if (conn->qid > 0) {
|
||||
conn->type = CONN_TYPE_IOQ;
|
||||
} else {
|
||||
|
@ -58,8 +58,7 @@ nvmf_create_session(const char *subnqn)
|
||||
goto exit;
|
||||
|
||||
subsystem->num_sessions++;
|
||||
/* define cntlid that is unique across all subsystems */
|
||||
session->cntlid = (subsystem->num << NVMF_CNTLID_SUBS_SHIFT) + subsystem->num_sessions;
|
||||
session->cntlid = 0; /* Subsystems only have one controller by design, so cntlid is 0 */
|
||||
TAILQ_INSERT_HEAD(&subsystem->sessions, session, entries);
|
||||
|
||||
SPDK_TRACELOG(SPDK_TRACE_NVMF, "nvmf_create_session: allocated session cntlid %d\n",
|
||||
@ -243,8 +242,8 @@ nvmf_connect(struct spdk_nvmf_conn *conn,
|
||||
|
||||
if (conn->type == CONN_TYPE_AQ) {
|
||||
/* For admin connections, establish a new session */
|
||||
SPDK_TRACELOG(SPDK_TRACE_NVMF, "CONNECT Admin Queue for controller id %d\n", conn->cntlid);
|
||||
if (conn->cntlid != 0xFFFF) {
|
||||
SPDK_TRACELOG(SPDK_TRACE_NVMF, "CONNECT Admin Queue for controller id %d\n", connect_data->cntlid);
|
||||
if (connect_data->cntlid != 0xFFFF) {
|
||||
/* This NVMf target only supports dynamic mode. */
|
||||
SPDK_ERRLOG("The NVMf target only supports dynamic mode.\n");
|
||||
response->status.sc = SPDK_NVMF_FABRIC_SC_INVALID_PARAM;
|
||||
@ -257,10 +256,10 @@ nvmf_connect(struct spdk_nvmf_conn *conn,
|
||||
return NULL;
|
||||
}
|
||||
} else {
|
||||
SPDK_TRACELOG(SPDK_TRACE_NVMF, "CONNECT I/O Queue for controller id %d\n", conn->cntlid);
|
||||
SPDK_TRACELOG(SPDK_TRACE_NVMF, "CONNECT I/O Queue for controller id %d\n", connect_data->cntlid);
|
||||
session = nvmf_find_session_by_id(connect_data->subnqn, connect_data->cntlid);
|
||||
if (session == NULL) {
|
||||
SPDK_ERRLOG("Unknown controller id %d\n", conn->cntlid);
|
||||
SPDK_ERRLOG("Unknown controller id %d\n", connect_data->cntlid);
|
||||
response->status.sc = SPDK_NVMF_FABRIC_SC_RESTART_DISCOVERY;
|
||||
return NULL;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user