Commit 161af0b5 authored by Darek Stojaczyk's avatar Darek Stojaczyk Committed by Jim Harris
Browse files

env/dpdk: always set base-virtaddr

DPDK 18.11 sets the default base-virtaddr to an address
that falls into an area reserved by ASAN. DPDK will try
to remap its memory over and over with the closest
base-virtaddr hint and for ASAN case this would take
a huge amount of time.

This was already raised on DPDK mailing list [1] and
might be eventually fixed or worked around in upstream,
but for now let's just override the default base-virtaddr
to a value that ASAN is known not to occupy.

[1] http://patches.dpdk.org/patch/46130/#88395



Change-Id: Ieada30e82355e8ead458e53795ab98cd12692c1c
Signed-off-by: default avatarDarek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/431257


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
parent 161e2aed
Loading
Loading
Loading
Loading
+11 −11
Original line number Diff line number Diff line
@@ -293,6 +293,17 @@ spdk_build_eal_cmdline(const struct spdk_env_opts *opts)
	}

#ifdef __linux__
	/* Set the base virtual address - it must be an address that is not in the
	 * ASAN shadow region, otherwise ASAN-enabled builds will ignore the
	 * mmap hint.
	 *
	 * Ref: https://github.com/google/sanitizers/wiki/AddressSanitizerAlgorithm
	 */
	args = spdk_push_arg(args, &argcount, _sprintf_alloc("--base-virtaddr=0x200000000000"));
	if (args == NULL) {
		return -1;
	}

	if (opts->shm_id < 0) {
		args = spdk_push_arg(args, &argcount, _sprintf_alloc("--file-prefix=spdk_pid%d",
				     getpid()));
@@ -306,17 +317,6 @@ spdk_build_eal_cmdline(const struct spdk_env_opts *opts)
			return -1;
		}

		/* Set the base virtual address - it must be an address that is not in the
		 * ASAN shadow region, otherwise ASAN-enabled builds will ignore the
		 * mmap hint.
		 *
		 * Ref: https://github.com/google/sanitizers/wiki/AddressSanitizerAlgorithm
		 */
		args = spdk_push_arg(args, &argcount, _sprintf_alloc("--base-virtaddr=0x200000000000"));
		if (args == NULL) {
			return -1;
		}

		/* set the process type */
		args = spdk_push_arg(args, &argcount, _sprintf_alloc("--proc-type=auto"));
		if (args == NULL) {