Commit a9c7af9d authored by Ben Walker's avatar Ben Walker
Browse files

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: default avatarBen Walker <benjamin.walker@intel.com>
parent 72a7fd3c
Loading
Loading
Loading
Loading
+0 −33
Original line number Diff line number Diff line
@@ -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");