From 9103bca73bc7561e64336a49c58988950ae525a3 Mon Sep 17 00:00:00 2001 From: Tomasz Zawadzki Date: Mon, 12 Oct 2020 05:55:53 -0400 Subject: [PATCH] lib/event: remove deprecated ReactorMask from legacy config Legacy INI configuration is being removed this release. This patch removes one of its options and always uses the SPDK_APP_DPDK_DEFAULT_CORE_MASK as default core mask. That can only be overwriten by -m/--cpumask arguments in app. In bdevperf there was no reason to set reactor_mask to NULL, as that was then still using the defaults. Meanwhile bdev_svc will now check if user provided different string via command line args to know if it should unaffinitize its thread. Signed-off-by: Tomasz Zawadzki Change-Id: Id882f8d7dbdd07b7743bd5981c37daa888b7872a Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4619 Tested-by: SPDK CI Jenkins Reviewed-by: Ben Walker Reviewed-by: Jim Harris --- lib/event/app.c | 17 +---------------- test/app/bdev_svc/bdev_svc.c | 4 +++- test/bdev/bdevperf/bdevperf.c | 1 - 3 files changed, 4 insertions(+), 18 deletions(-) diff --git a/lib/event/app.c b/lib/event/app.c index 35cfe6c11..7dc45aa46 100644 --- a/lib/event/app.c +++ b/lib/event/app.c @@ -290,7 +290,7 @@ spdk_app_opts_init(struct spdk_app_opts *opts) opts->mem_size = SPDK_APP_DPDK_DEFAULT_MEM_SIZE; opts->master_core = SPDK_APP_DPDK_DEFAULT_MASTER_CORE; opts->mem_channel = SPDK_APP_DPDK_DEFAULT_MEM_CHANNEL; - opts->reactor_mask = NULL; + opts->reactor_mask = SPDK_APP_DPDK_DEFAULT_CORE_MASK; opts->base_virtaddr = SPDK_APP_DPDK_DEFAULT_BASE_VIRTADDR; opts->print_level = SPDK_APP_DEFAULT_LOG_PRINT_LEVEL; opts->rpc_addr = SPDK_DEFAULT_RPC_ADDR; @@ -435,16 +435,6 @@ app_read_config_file_global_params(struct spdk_app_opts *opts) } } - if (opts->reactor_mask == NULL) { - if (sp && spdk_conf_section_get_val(sp, "ReactorMask")) { - SPDK_ERRLOG("ReactorMask config option is deprecated. Use -m/--cpumask\n" - "command line parameter instead.\n"); - opts->reactor_mask = spdk_conf_section_get_val(sp, "ReactorMask"); - } else { - opts->reactor_mask = SPDK_APP_DPDK_DEFAULT_CORE_MASK; - } - } - if (!opts->no_pci && sp) { opts->no_pci = spdk_conf_section_get_boolval(sp, "NoPci", false); } @@ -666,11 +656,6 @@ spdk_app_start(struct spdk_app_opts *opts, spdk_msg_fn start_fn, spdk_log_open(opts->log); SPDK_NOTICELOG("Total cores available: %d\n", spdk_env_get_core_count()); - /* - * If mask not specified on command line or in configuration file, - * reactor_mask will be 0x1 which will enable core 0 to run one - * reactor. - */ if ((rc = spdk_reactors_init()) != 0) { SPDK_ERRLOG("Reactor Initilization failed: rc = %d\n", rc); return 1; diff --git a/test/app/bdev_svc/bdev_svc.c b/test/app/bdev_svc/bdev_svc.c index 84580d3f6..228ea5c5f 100644 --- a/test/app/bdev_svc/bdev_svc.c +++ b/test/app/bdev_svc/bdev_svc.c @@ -81,11 +81,13 @@ main(int argc, char **argv) { int rc; struct spdk_app_opts opts = {}; + const char *reactor_mask = "0x1"; /* default value in opts structure */ spdk_app_opts_init(&opts); opts.name = "bdev_svc"; + opts.reactor_mask = reactor_mask; opts.shutdown_cb = bdev_svc_shutdown; if ((rc = spdk_app_parse_args(argc, argv, &opts, "", NULL, @@ -100,7 +102,7 @@ main(int argc, char **argv) * in the bdev_svc_start routine, which will allow the scheduler to move this * thread so it doesn't conflict with pinned threads in the secondary processes. */ - if (opts.reactor_mask == NULL) { + if (opts.reactor_mask == reactor_mask) { g_unaffinitize_thread = true; } diff --git a/test/bdev/bdevperf/bdevperf.c b/test/bdev/bdevperf/bdevperf.c index ba59dfd94..70f4d73ff 100644 --- a/test/bdev/bdevperf/bdevperf.c +++ b/test/bdev/bdevperf/bdevperf.c @@ -2110,7 +2110,6 @@ main(int argc, char **argv) spdk_app_opts_init(&opts); opts.name = "bdevperf"; opts.rpc_addr = NULL; - opts.reactor_mask = NULL; opts.shutdown_cb = spdk_bdevperf_shutdown_cb; if ((rc = spdk_app_parse_args(argc, argv, &opts, "xzfq:o:t:w:k:ACM:P:S:T:j:", NULL,