Commit 3f2002ea authored by Jim Harris's avatar Jim Harris Committed by Tomasz Zawadzki
Browse files

nvme/perf: store master core as global variable



This will be used in a future patch.

Signed-off-by: default avatarJim Harris <james.r.harris@intel.com>
Change-Id: Ie88daa20842f5f166b4a7a5abccafd6683d6da64

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/473338


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarAlexey Marchuk <alexeymar@mellanox.com>
parent 437dce1a
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -194,6 +194,7 @@ static struct ns_entry *g_namespaces = NULL;
static int g_num_namespaces = 0;
static struct worker_thread *g_workers = NULL;
static int g_num_workers = 0;
static uint32_t g_master_core;

static uint64_t g_tsc_rate;

@@ -1993,7 +1994,6 @@ int main(int argc, char **argv)
{
	int rc;
	struct worker_thread *worker, *master_worker;
	unsigned master_core;
	struct spdk_env_opts opts;
	pthread_t thread_id = 0;

@@ -2063,11 +2063,11 @@ int main(int argc, char **argv)
	printf("Initialization complete. Launching workers.\n");

	/* Launch all of the slave workers */
	master_core = spdk_env_get_current_core();
	g_master_core = spdk_env_get_current_core();
	master_worker = NULL;
	worker = g_workers;
	while (worker != NULL) {
		if (worker->lcore != master_core) {
		if (worker->lcore != g_master_core) {
			spdk_env_thread_launch_pinned(worker->lcore, work_fn, worker);
		} else {
			assert(master_worker == NULL);