Commit e3f08eef authored by Changpeng Liu's avatar Changpeng Liu Committed by Tomasz Zawadzki
Browse files

examples/nvme: export DPDK single file descriptor memory segments as input parameter



Similar with existing virtio user driver, we need to enable "--single-file-segments"
option in DPDK as the target only support limited number of memory regions, for
coming vfio-user feature, the requirement is same, so here we enable the option
with identify&perf tools in advance.

Change-Id: I83d78b403a8c1ec0c76a5bf21aac6bed109931c3
Signed-off-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4612


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
parent eecc14df
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -91,6 +91,8 @@ static int g_shm_id = -1;

static int g_dpdk_mem = 0;

static bool g_dpdk_mem_single_seg = false;

static int g_master_core = 0;

static char g_core_mask[16] = "0x1";
@@ -1776,6 +1778,7 @@ usage(const char *program_name)
	printf(" -i         shared memory group ID\n");
	printf(" -p         core number in decimal to run this application which started from 0\n");
	printf(" -d         DPDK huge memory size in MB\n");
	printf(" -g         use single file descriptor for DPDK memory segments\n");
	printf(" -x         print hex dump of raw data\n");
	printf(" -v         verbose (enable warnings)\n");
	printf(" -V         enumerate VMD\n");
@@ -1790,7 +1793,7 @@ parse_args(int argc, char **argv)
	spdk_nvme_trid_populate_transport(&g_trid, SPDK_NVME_TRANSPORT_PCIE);
	snprintf(g_trid.subnqn, sizeof(g_trid.subnqn), "%s", SPDK_NVMF_DISCOVERY_NQN);

	while ((op = getopt(argc, argv, "d:i:p:r:xHL:V")) != -1) {
	while ((op = getopt(argc, argv, "d:gi:p:r:xHL:V")) != -1) {
		switch (op) {
		case 'd':
			g_dpdk_mem = spdk_strtol(optarg, 10);
@@ -1799,6 +1802,9 @@ parse_args(int argc, char **argv)
				return g_dpdk_mem;
			}
			break;
		case 'g':
			g_dpdk_mem_single_seg = true;
			break;
		case 'i':
			g_shm_id = spdk_strtol(optarg, 10);
			if (g_shm_id < 0) {
@@ -1883,6 +1889,7 @@ int main(int argc, char **argv)
	opts.mem_channel = 1;
	opts.master_core = g_master_core;
	opts.core_mask = g_core_mask;
	opts.hugepage_single_segments = g_dpdk_mem_single_seg;
	if (g_trid.trtype != SPDK_NVME_TRANSPORT_PCIE) {
		opts.no_pci = true;
	}
+7 −1
Original line number Diff line number Diff line
@@ -241,6 +241,7 @@ static int g_time_in_sec;
static int g_warmup_time_in_sec;
static uint32_t g_max_completions;
static int g_dpdk_mem;
static bool g_dpdk_mem_single_seg = false;
static int g_shm_id = -1;
static uint32_t g_disable_sq_cmb;
static bool g_use_uring;
@@ -1404,6 +1405,7 @@ static void usage(char *program_name)
	printf("\t          -e 'PRACT=1,PRCHK=GUARD'\n");
	printf("\t[-k keep alive timeout period in millisecond]\n");
	printf("\t[-s DPDK huge memory size in MB.]\n");
	printf("\t[-g use single file descriptor for DPDK memory segments]\n");
	printf("\t[-C max completions per poll]\n");
	printf("\t\t(default: 0 - unlimited)\n");
	printf("\t[-i shared memory group ID]\n");
@@ -1807,7 +1809,7 @@ parse_args(int argc, char **argv)
	long int val;
	int rc;

	while ((op = getopt(argc, argv, "a:c:e:i:lo:q:r:k:s:t:w:z:A:C:DGHILM:NP:RS:T:U:VZ:")) != -1) {
	while ((op = getopt(argc, argv, "a:c:e:gi:lo:q:r:k:s:t:w:z:A:C:DGHILM:NP:RS:T:U:VZ:")) != -1) {
		switch (op) {
		case 'a':
		case 'A':
@@ -1882,6 +1884,9 @@ parse_args(int argc, char **argv)
				return 1;
			}
			break;
		case 'g':
			g_dpdk_mem_single_seg = true;
			break;
		case 'l':
			g_latency_ssd_tracking_enable = true;
			break;
@@ -2285,6 +2290,7 @@ int main(int argc, char **argv)
	if (g_dpdk_mem) {
		opts.mem_size = g_dpdk_mem;
	}
	opts.hugepage_single_segments = g_dpdk_mem_single_seg;
	if (g_no_pci) {
		opts.no_pci = g_no_pci;
	}