From a9c7af9d83fdfac87ff2a6617bd9db636f4beb94 Mon Sep 17 00:00:00 2001 From: Ben Walker Date: Thu, 7 Jul 2016 15:52:36 -0700 Subject: [PATCH] nvmf: Simplify conn lcore allocation Since we only allocate workers to the master lcore, remove the logic that places I/O conns on the same lcore as the admin conn. The "right" logic would be to place the I/O conn on the same lcore as the whole session, and this patch builds toward that. Change-Id: I8983b56de41062ec834b0a169ba0fa61326c466d Signed-off-by: Ben Walker --- lib/nvmf/conn.c | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/lib/nvmf/conn.c b/lib/nvmf/conn.c index 7c88e8a77..9f3b18c84 100644 --- a/lib/nvmf/conn.c +++ b/lib/nvmf/conn.c @@ -101,22 +101,6 @@ free_conn(struct spdk_nvmf_conn *conn) conn->is_valid = 0; } -static struct spdk_nvmf_conn * -spdk_find_nvmf_conn_by_cntlid(int cntlid) -{ - int i; - - for (i = 0; i < g_max_conns; i++) { - if ((g_conns_array[i].is_valid == 1) && - (g_conns_array[i].cntlid == cntlid) && - (g_conns_array[i].qid == 0)) { - return &g_conns_array[i]; - } - } - - return NULL; -} - int spdk_initialize_nvmf_conns(int max_connections) { size_t conns_size; @@ -200,25 +184,8 @@ int spdk_nvmf_startup_conn(struct spdk_nvmf_conn *conn) { int lcore; - struct spdk_nvmf_conn *admin_conn; uint64_t nvmf_session_core = spdk_app_get_core_mask(); - /* - * if starting IO connection then determine core - * allocated to admin queue to request core mask. - * Can not assume nvmf session yet created at time - * of fabric connection setup. Rely on fabric - * function to locate matching controller session. - */ - if (conn->type == CONN_TYPE_IOQ && conn->cntlid != 0) { - admin_conn = spdk_find_nvmf_conn_by_cntlid(conn->cntlid); - if (admin_conn != NULL) { - SPDK_TRACELOG(SPDK_TRACE_DEBUG, "Located admin conn session core %d\n", - admin_conn->poller.lcore); - nvmf_session_core = 1ULL << admin_conn->poller.lcore; - } - } - lcore = nvmf_allocate_reactor(nvmf_session_core); if (lcore < 0) { SPDK_ERRLOG("Unable to find core to launch connection.\n");