event: replace master_core with main_core in spdk_app_opts
master_core will still be available but deprecated. Signed-off-by: Jim Harris <james.r.harris@intel.com> Change-Id: I6fe9eb7fecb2919795c439a02cb7d9d06a2774d8 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5358 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Community-CI: Mellanox Build Bot Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
parent
0130905aee
commit
3795c1cfd8
@ -102,7 +102,10 @@ struct spdk_app_opts {
|
||||
|
||||
bool enable_coredump;
|
||||
int mem_channel;
|
||||
int master_core;
|
||||
union {
|
||||
int main_core;
|
||||
int master_core __attribute__((deprecated));
|
||||
};
|
||||
int mem_size;
|
||||
bool no_pci;
|
||||
bool hugepage_single_segments;
|
||||
|
@ -49,7 +49,7 @@
|
||||
#define SPDK_APP_DEFAULT_NUM_TRACE_ENTRIES SPDK_DEFAULT_NUM_TRACE_ENTRIES
|
||||
|
||||
#define SPDK_APP_DPDK_DEFAULT_MEM_SIZE -1
|
||||
#define SPDK_APP_DPDK_DEFAULT_MASTER_CORE -1
|
||||
#define SPDK_APP_DPDK_DEFAULT_MAIN_CORE -1
|
||||
#define SPDK_APP_DPDK_DEFAULT_MEM_CHANNEL -1
|
||||
#define SPDK_APP_DPDK_DEFAULT_CORE_MASK "0x1"
|
||||
#define SPDK_APP_DPDK_DEFAULT_BASE_VIRTADDR 0x200000000000
|
||||
@ -97,8 +97,9 @@ static const struct option g_cmdline_options[] = {
|
||||
{"cpumask", required_argument, NULL, CPUMASK_OPT_IDX},
|
||||
#define MEM_CHANNELS_OPT_IDX 'n'
|
||||
{"mem-channels", required_argument, NULL, MEM_CHANNELS_OPT_IDX},
|
||||
#define MASTER_CORE_OPT_IDX 'p'
|
||||
{"master-core", required_argument, NULL, MASTER_CORE_OPT_IDX},
|
||||
#define MAIN_CORE_OPT_IDX 'p'
|
||||
{"main-core", required_argument, NULL, MAIN_CORE_OPT_IDX},
|
||||
{"master-core", required_argument, NULL, MAIN_CORE_OPT_IDX}, /* deprecated */
|
||||
#define RPC_SOCKET_OPT_IDX 'r'
|
||||
{"rpc-socket", required_argument, NULL, RPC_SOCKET_OPT_IDX},
|
||||
#define MEM_SIZE_OPT_IDX 's'
|
||||
@ -196,7 +197,7 @@ spdk_app_opts_init(struct spdk_app_opts *opts)
|
||||
opts->enable_coredump = true;
|
||||
opts->shm_id = -1;
|
||||
opts->mem_size = SPDK_APP_DPDK_DEFAULT_MEM_SIZE;
|
||||
opts->master_core = SPDK_APP_DPDK_DEFAULT_MASTER_CORE;
|
||||
opts->main_core = SPDK_APP_DPDK_DEFAULT_MAIN_CORE;
|
||||
opts->mem_channel = SPDK_APP_DPDK_DEFAULT_MEM_CHANNEL;
|
||||
opts->reactor_mask = SPDK_APP_DPDK_DEFAULT_CORE_MASK;
|
||||
opts->base_virtaddr = SPDK_APP_DPDK_DEFAULT_BASE_VIRTADDR;
|
||||
@ -312,7 +313,7 @@ app_setup_env(struct spdk_app_opts *opts)
|
||||
env_opts.core_mask = opts->reactor_mask;
|
||||
env_opts.shm_id = opts->shm_id;
|
||||
env_opts.mem_channel = opts->mem_channel;
|
||||
env_opts.main_core = opts->master_core;
|
||||
env_opts.main_core = opts->main_core;
|
||||
env_opts.mem_size = opts->mem_size;
|
||||
env_opts.hugepage_single_segments = opts->hugepage_single_segments;
|
||||
env_opts.unlink_hugepage = opts->unlink_hugepage;
|
||||
@ -559,7 +560,7 @@ usage(void (*app_usage)(void))
|
||||
printf(" -i, --shm-id <id> shared memory ID (optional)\n");
|
||||
printf(" -m, --cpumask <mask> core mask for DPDK\n");
|
||||
printf(" -n, --mem-channels <num> channel number of memory channels used for DPDK\n");
|
||||
printf(" -p, --master-core <id> master (primary) core for DPDK\n");
|
||||
printf(" -p, --main-core <id> main (primary) core for DPDK\n");
|
||||
printf(" -r, --rpc-socket <path> RPC listen address (default %s)\n", SPDK_DEFAULT_RPC_ADDR);
|
||||
printf(" -s, --mem-size <size> memory size in MB for DPDK (default: ");
|
||||
#ifndef __linux__
|
||||
@ -694,10 +695,10 @@ spdk_app_parse_args(int argc, char **argv, struct spdk_app_opts *opts,
|
||||
goto out;
|
||||
}
|
||||
break;
|
||||
case MASTER_CORE_OPT_IDX:
|
||||
opts->master_core = spdk_strtol(optarg, 0);
|
||||
if (opts->master_core < 0) {
|
||||
SPDK_ERRLOG("Invalid master core %s\n", optarg);
|
||||
case MAIN_CORE_OPT_IDX:
|
||||
opts->main_core = spdk_strtol(optarg, 0);
|
||||
if (opts->main_core < 0) {
|
||||
SPDK_ERRLOG("Invalid main core %s\n", optarg);
|
||||
goto out;
|
||||
}
|
||||
break;
|
||||
|
@ -824,7 +824,7 @@ spdk_reactors_start(void)
|
||||
spdk_cpuset_set_cpu(&g_reactor_core_mask, i, true);
|
||||
}
|
||||
|
||||
/* Start the master reactor */
|
||||
/* Start the main reactor */
|
||||
reactor = spdk_reactor_get(current_core);
|
||||
assert(reactor != NULL);
|
||||
g_scheduling_reactor = reactor;
|
||||
|
@ -124,7 +124,7 @@ _spdk_opt_to_complete() {
|
||||
COMPREPLY=($(compgen -W '${pcis[*]}' -- "$cur"))
|
||||
compopt -o filenames
|
||||
;;
|
||||
--master-core | -p) # FIXME: Is this meant to be an actual core id or thread id? Assume the latter
|
||||
--main-core | -p) # FIXME: Is this meant to be an actual core id or thread id? Assume the latter
|
||||
local cpus
|
||||
if [[ -e /sys/devices/system/cpu ]]; then
|
||||
cpus=(/sys/devices/system/cpu/cpu+([0-9]))
|
||||
|
@ -73,7 +73,7 @@ usage(char *executable_name)
|
||||
printf(" -i shared memory ID [required]\n");
|
||||
printf(" -m mask core mask for DPDK\n");
|
||||
printf(" -n channel number of memory channels used for DPDK\n");
|
||||
printf(" -p core master (primary) core for DPDK\n");
|
||||
printf(" -p core main (primary) core for DPDK\n");
|
||||
printf(" -s size memory size in MB for DPDK\n");
|
||||
printf(" -H show this usage\n");
|
||||
}
|
||||
@ -175,7 +175,7 @@ main(int argc, char **argv)
|
||||
opts.mem_channel = val;
|
||||
break;
|
||||
case 'p':
|
||||
opts.master_core = val;
|
||||
opts.main_core = val;
|
||||
break;
|
||||
case 's':
|
||||
opts.mem_size = val;
|
||||
|
Loading…
Reference in New Issue
Block a user