From 3f2002eaba0bb8bd8f8ff0c322ea96ddb085cb54 Mon Sep 17 00:00:00 2001 From: Jim Harris Date: Tue, 5 Nov 2019 06:08:05 -0700 Subject: [PATCH] nvme/perf: store master core as global variable This will be used in a future patch. Signed-off-by: Jim Harris Change-Id: Ie88daa20842f5f166b4a7a5abccafd6683d6da64 Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/473338 Tested-by: SPDK CI Jenkins Reviewed-by: Changpeng Liu Reviewed-by: Shuhei Matsumoto Reviewed-by: Alexey Marchuk --- examples/nvme/perf/perf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/nvme/perf/perf.c b/examples/nvme/perf/perf.c index 511c834005..4c295f023c 100644 --- a/examples/nvme/perf/perf.c +++ b/examples/nvme/perf/perf.c @@ -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);