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

examples/nvme_reconnect: add single memory segment parameter support



Add one optional parameter to enable single memory segment, which
can be tested with libvfio-user NVMeoF target.

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


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
parent 3048a49c
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -115,6 +115,7 @@ static bool g_warn;
static uint32_t g_keep_alive_timeout_in_ms = 0;
static uint8_t g_transport_retry_count = 4;
static uint8_t g_transport_ack_timeout = 0; /* disabled */
static bool g_dpdk_mem_single_seg = false;

static const char *g_core_mask;

@@ -684,7 +685,7 @@ parse_args(int argc, char **argv)
	g_core_mask = NULL;
	g_max_completions = 0;

	while ((op = getopt(argc, argv, "c:m:o:q:r:k:s:t:w:A:GM:R:T:")) != -1) {
	while ((op = getopt(argc, argv, "c:gm:o:q:r:k:s:t:w:A:GM:R:T:")) != -1) {
		switch (op) {
		case 'm':
		case 'o':
@@ -734,6 +735,9 @@ parse_args(int argc, char **argv)
		case 'c':
			g_core_mask = optarg;
			break;
		case 'g':
			g_dpdk_mem_single_seg = true;
			break;
		case 'r':
			if (add_trid(optarg)) {
				usage(argv[0]);
@@ -1085,6 +1089,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 (spdk_env_init(&opts) < 0) {
		fprintf(stderr, "Unable to initialize SPDK env\n");
		rc = 1;