diff --git a/lib/nvmf/conn.c b/lib/nvmf/conn.c index 00c867cd88..de34cb49f1 100644 --- a/lib/nvmf/conn.c +++ b/lib/nvmf/conn.c @@ -340,35 +340,8 @@ nvmf_init_conn_properites(struct spdk_nvmf_conn *conn, struct nvmf_session *session, struct spdk_nvmf_fabric_connect_rsp *response) { - - struct spdk_nvmf_extended_identify_ctrlr_data *lcdata; - uint32_t mdts; - conn->cntlid = response->status_code_specific.success.cntlid; - session->max_connections_allowed = g_nvmf_tgt.MaxConnectionsPerSession; nvmf_init_session_properties(session, conn->rdma.queue_depth); - - /* Update the session logical controller data with any - * application fabric side limits - */ - /* reset mdts in vcdata to equal the application default maximum */ - mdts = SPDK_NVMF_MAX_RECV_DATA_TRANSFER_SIZE / - (1 << (12 + session->vcprop.cap.bits.mpsmin)); - if (mdts == 0) { - SPDK_ERRLOG("Min page size exceeds max transfer size!\n"); - SPDK_ERRLOG("Verify setting of SPDK_NVMF_MAX_RECV_DATA_TRANSFER_SIZE and mpsmin\n"); - session->vcdata.mdts = 1; /* Support single page for now */ - } else { - /* set mdts as a power of 2 representing number of mpsmin units */ - session->vcdata.mdts = 0; - while ((1ULL << session->vcdata.mdts) < mdts) { - session->vcdata.mdts++; - } - } - - /* increase the I/O recv capsule size for in_capsule data */ - lcdata = (struct spdk_nvmf_extended_identify_ctrlr_data *)session->vcdata.nvmf_specific; - lcdata->ioccsz += (SPDK_NVMF_MAX_RECV_DATA_TRANSFER_SIZE / 16); } static void diff --git a/lib/nvmf/session.c b/lib/nvmf/session.c index ef3f560b30..b91437ae1d 100644 --- a/lib/nvmf/session.c +++ b/lib/nvmf/session.c @@ -68,6 +68,7 @@ nvmf_create_session(const char *subnqn) session->num_connections = 0; session->is_valid = 1; session->subsys = subsystem; + session->max_connections_allowed = g_nvmf_tgt.MaxConnectionsPerSession; exit: return session; @@ -136,25 +137,22 @@ nvmf_init_nvme_session_properties(struct nvmf_session *session, int aq_depth) /* Init the virtual controller details using actual HW details */ cdata = spdk_nvme_ctrlr_get_data(session->subsys->ctrlr); - memcpy((char *)&session->vcdata, (char *)cdata, sizeof(struct spdk_nvme_ctrlr_data)); + memcpy(&session->vcdata, cdata, sizeof(struct spdk_nvme_ctrlr_data)); - /* indicate support for only a single AER */ session->vcdata.aerl = 0; - - /* reset cntlid in vcdata to match the logical cntlid known to NVMf */ session->vcdata.cntlid = session->cntlid; - - /* initialize the nvmf new and extension details in controller data */ session->vcdata.kas = 10; session->vcdata.maxcmd = SPDK_NVMF_DEFAULT_MAX_QUEUE_DEPTH; + session->vcdata.mdts = SPDK_NVMF_MAX_RECV_DATA_TRANSFER_SIZE / 4096; + session->vcdata.sgls.keyed_sgl = 1; + session->vcdata.sgls.sgl_offset = 1; + nvmfdata = (struct spdk_nvmf_extended_identify_ctrlr_data *)session->vcdata.nvmf_specific; nvmfdata->ioccsz = (NVMF_H2C_MAX_MSG / 16); nvmfdata->iorcsz = (NVMF_C2H_MAX_MSG / 16); nvmfdata->icdoff = 0; /* offset starts directly after SQE */ nvmfdata->ctrattr = 0; /* dynamic controller model */ nvmfdata->msdbd = 1; /* target supports single SGL in capsule */ - session->vcdata.sgls.keyed_sgl = 1; - session->vcdata.sgls.sgl_offset = 1; SPDK_TRACELOG(SPDK_TRACE_NVMF, " nvmf_init_session_properties: ctrlr data: maxcmd %x\n", session->vcdata.maxcmd);