app: add NoPci field to config file

Allow disabling entire PCI access via config file.

Change-Id: Ib571529fdcdfe0e8f43e0d69b32efa633c364f8f
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/381203
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Dariusz Stojaczyk 2017-10-03 21:35:53 +02:00 committed by Daniel Verkamp
parent ae19c072e8
commit dbad65c383
3 changed files with 17 additions and 7 deletions

View File

@ -19,6 +19,11 @@
# on core 0.
#ReactorMask 0xFFFF
# Disable PCI access. PCI is enabled by default. Setting this
# option will hide any PCI device from all SPDK modules, making
# SPDK act as if they don't exist.
#NoPci Yes
# Tracepoint group mask for spdk trace buffers
# Default: 0x0 (all tracepoint groups disabled)
# Set to 0xFFFFFFFFFFFFFFFF to enable all tracepoint groups.

View File

@ -19,6 +19,11 @@
# on core 0.
#ReactorMask 0xFFFF
# Disable PCI access. PCI is enabled by default. Setting this
# option will hide any PCI device from all SPDK modules, making
# SPDK act as if they don't exist.
#NoPci Yes
# Tracepoint group mask for spdk trace buffers
# Default: 0x0 (all tracepoint groups disabled)
# Set to 0xFFFFFFFFFFFFFFFF to enable all tracepoint groups.

View File

@ -302,17 +302,17 @@ spdk_app_start(struct spdk_app_opts *opts, spdk_event_fn start_fn,
spdk_log_set_level(SPDK_APP_DEFAULT_LOG_PRIORITY);
spdk_log_open();
if (opts->reactor_mask == NULL) {
sp = spdk_conf_find_section(g_spdk_app.config, "Global");
if (sp != NULL) {
if (spdk_conf_section_get_val(sp, "ReactorMask")) {
if (opts->reactor_mask == NULL) {
if (sp && spdk_conf_section_get_val(sp, "ReactorMask")) {
opts->reactor_mask = spdk_conf_section_get_val(sp, "ReactorMask");
} else {
opts->reactor_mask = SPDK_APP_DPDK_DEFAULT_CORE_MASK;
}
} 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);
}
spdk_env_opts_init(&env_opts);