app, opts: add a new dpdk configuration: no-pci

In this patch, we also update perf and identify
examples. If there is no local nvme device info
parsing, we will set dpdk initialization with no-pci
choice.

Change-Id: I58b2d291b7b53894aeb194a16798ff1c72cf25b4
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/365361
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Ziye Yang 2017-06-14 15:31:55 +08:00 committed by Jim Harris
parent dcb7abc717
commit fb6c541d37
6 changed files with 29 additions and 0 deletions

View File

@ -1077,6 +1077,9 @@ int main(int argc, char **argv)
opts.dpdk_mem_channel = 1;
opts.dpdk_master_core = g_master_core;
opts.core_mask = g_core_mask;
if (g_trid.trtype != SPDK_NVME_TRANSPORT_PCIE) {
opts.no_pci = true;
}
spdk_env_init(&opts);
rc = 0;

View File

@ -166,6 +166,7 @@ static uint32_t g_max_completions;
static int g_dpdk_mem;
static int g_shm_id = -1;
static uint32_t g_disable_sq_cmb;
static bool g_no_pci;
static const char *g_core_mask;
@ -1090,6 +1091,17 @@ parse_args(int argc, char **argv)
if (TAILQ_EMPTY(&g_trid_list)) {
/* If no transport IDs specified, default to enumerating all local PCIe devices */
add_trid("trtype:PCIe");
} else {
struct trid_entry *trid_entry, *trid_entry_tmp;
g_no_pci = true;
/* check whether there is local PCIe type */
TAILQ_FOREACH_SAFE(trid_entry, &g_trid_list, tailq, trid_entry_tmp) {
if (trid_entry->trid.trtype == SPDK_NVME_TRANSPORT_PCIE) {
g_no_pci = false;
break;
}
}
}
g_aio_optind = optind;
@ -1332,6 +1344,9 @@ int main(int argc, char **argv)
if (g_dpdk_mem) {
opts.dpdk_mem_size = g_dpdk_mem;
}
if (g_no_pci) {
opts.no_pci = g_no_pci;
}
spdk_env_init(&opts);
g_tsc_rate = spdk_get_ticks_hz();

View File

@ -59,6 +59,7 @@ struct spdk_env_opts {
int dpdk_mem_channel;
int dpdk_master_core;
int dpdk_mem_size;
bool no_pci;
};
/**

View File

@ -81,6 +81,7 @@ struct spdk_app_opts {
int dpdk_mem_channel;
int dpdk_master_core;
int dpdk_mem_size;
bool no_pci;
/* The maximum latency allowed when passing an event
* from one core to another. A value of 0

View File

@ -198,6 +198,14 @@ spdk_build_eal_cmdline(const struct spdk_env_opts *opts, char **out[])
}
}
/* set no pci if enabled */
if (opts->no_pci) {
args = spdk_push_arg(args, &argcount, _sprintf_alloc("--no-pci"));
if (args == NULL) {
return -1;
}
}
#ifdef __linux__
if (opts->shm_id < 0) {
args = spdk_push_arg(args, &argcount, _sprintf_alloc("--file-prefix=spdk_pid%d",

View File

@ -310,6 +310,7 @@ spdk_app_init(struct spdk_app_opts *opts)
env_opts.dpdk_mem_channel = opts->dpdk_mem_channel;
env_opts.dpdk_master_core = opts->dpdk_master_core;
env_opts.dpdk_mem_size = opts->dpdk_mem_size;
env_opts.no_pci = opts->no_pci;
spdk_env_init(&env_opts);