From a35de42e5ddfd938095f9a1222daae4060182878 Mon Sep 17 00:00:00 2001 From: Ben Walker Date: Thu, 7 Jul 2016 16:22:15 -0700 Subject: [PATCH] nvmf: Remove max io queue tracking from session This was intended to track the number of NVMe device queues per session, but there is only one hardware queue per session. It was conflated with the number of RDMA queues in several places as well. Change-Id: I74a1c56a5d395dea8bee4778882821e904cebcf9 Signed-off-by: Ben Walker --- lib/nvmf/request.c | 8 +++++--- lib/nvmf/session.c | 5 ----- lib/nvmf/session.h | 2 -- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/lib/nvmf/request.c b/lib/nvmf/request.c index e1974dd69..b29c8e88e 100644 --- a/lib/nvmf/request.c +++ b/lib/nvmf/request.c @@ -202,7 +202,8 @@ nvmf_process_admin_cmd(struct spdk_nvmf_request *req) switch (feature) { case SPDK_NVME_FEAT_NUMBER_OF_QUEUES: SPDK_TRACELOG(SPDK_TRACE_NVMF, "Get Features - Number of Queues\n"); - response->cdw0 = ((session->max_io_queues - 1) << 16) | (session->max_io_queues - 1); + response->cdw0 = ((session->max_connections_allowed - 1) << 16) | (session->max_connections_allowed + - 1); return true; default: goto passthrough; @@ -215,11 +216,12 @@ nvmf_process_admin_cmd(struct spdk_nvmf_request *req) SPDK_TRACELOG(SPDK_TRACE_NVMF, "Set Features - Number of Queues, cdw11 0x%x\n", cmd->cdw11); /* verify that the contoller is ready to process commands */ - if (session->active_queues != 0) { + if (session->num_connections > 1) { SPDK_TRACELOG(SPDK_TRACE_NVMF, "Queue pairs already active!\n"); response->status.sc = SPDK_NVME_SC_COMMAND_SEQUENCE_ERROR; } else { - response->cdw0 = ((session->max_io_queues - 1) << 16) | (session->max_io_queues - 1); + response->cdw0 = ((session->max_connections_allowed - 1) << 16) | (session->max_connections_allowed + - 1); } return true; default: diff --git a/lib/nvmf/session.c b/lib/nvmf/session.c index 6dd0b5727..450472944 100644 --- a/lib/nvmf/session.c +++ b/lib/nvmf/session.c @@ -126,9 +126,6 @@ nvmf_init_nvme_session_properties(struct nvmf_session *session) SPDK_TRACELOG(SPDK_TRACE_NVMF, " nvmf_init_session_properties: sgls data: 0x%x\n", *(uint32_t *)&session->vcdata.sgls); - /* feature: Number Of Queues. */ - session->max_io_queues = MAX_SESSION_IO_QUEUES; - session->vcprop.cap.raw = 0; session->vcprop.cap.bits.cqr = 0; /* queues not contiguous */ session->vcprop.cap.bits.mqes = (session->vcdata.maxcmd - 1); /* max queue depth */ @@ -150,8 +147,6 @@ nvmf_init_nvme_session_properties(struct nvmf_session *session) session->vcprop.csts.raw = 0; session->vcprop.csts.bits.rdy = 0; /* Init controller as not ready */ - SPDK_TRACELOG(SPDK_TRACE_NVMF, " nvmf_init_session_properties: max io queues %x\n", - session->max_io_queues); SPDK_TRACELOG(SPDK_TRACE_NVMF, " nvmf_init_session_properties: cap %" PRIx64 "\n", session->vcprop.cap.raw); SPDK_TRACELOG(SPDK_TRACE_NVMF, " nvmf_init_session_properties: vs %x\n", session->vcprop.vs.raw); diff --git a/lib/nvmf/session.h b/lib/nvmf/session.h index 254d3a3f2..8e3ab961c 100644 --- a/lib/nvmf/session.h +++ b/lib/nvmf/session.h @@ -54,8 +54,6 @@ struct nvmf_session { struct spdk_nvmf_subsystem *subsys; uint16_t cntlid; - uint32_t max_io_queues; /* maximum supported by backend NVMe library */ - int active_queues; struct { union spdk_nvme_cap_register cap; union spdk_nvme_vs_register vs;