Commit fb6c541d authored by Ziye Yang's avatar Ziye Yang Committed by Jim Harris
Browse files

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: default avatarZiye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/365361


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent dcb7abc7
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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;
+15 −0
Original line number Diff line number Diff line
@@ -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();
+1 −0
Original line number Diff line number Diff line
@@ -59,6 +59,7 @@ struct spdk_env_opts {
	int	 		dpdk_mem_channel;
	int	 		dpdk_master_core;
	int			dpdk_mem_size;
	bool			no_pci;
};

/**
+1 −0
Original line number Diff line number Diff line
@@ -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
+8 −0
Original line number Diff line number Diff line
@@ -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",
Loading