Commit 687da749 authored by Jim Harris's avatar Jim Harris Committed by Tomasz Zawadzki
Browse files

lib/env_dpdk: put env_context last on DPDK command line



This gives user most flexibility to override default options specified
earlier in the command line by SPDK.

Signed-off-by: default avatarJim Harris <jim.harris@samsung.com>
Change-Id: I04e2a636cb659df265482db7415557d28cd854ce
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/22475


Community-CI: Mellanox Build Bot
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <smatsumoto@nvidia.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent 90b54d76
Loading
Loading
Loading
Loading
+16 −16
Original line number Original line Diff line number Diff line
@@ -421,22 +421,6 @@ build_eal_cmdline(const struct spdk_env_opts *opts)
		return -1;
		return -1;
	}
	}


	if (opts->env_context) {
		char *ptr = strdup(opts->env_context);
		char *tok = strtok(ptr, " \t");

		/* DPDK expects each argument as a separate string in the argv
		 * array, so we need to tokenize here in case the caller
		 * passed multiple arguments in the env_context string.
		 */
		while (tok != NULL) {
			args = push_arg(args, &argcount, strdup(tok));
			tok = strtok(NULL, " \t");
		}

		free(ptr);
	}

#ifdef __linux__
#ifdef __linux__


	if (opts->iova_mode) {
	if (opts->iova_mode) {
@@ -537,6 +521,22 @@ build_eal_cmdline(const struct spdk_env_opts *opts)
	}
	}
#endif
#endif


	if (opts->env_context) {
		char *ptr = strdup(opts->env_context);
		char *tok = strtok(ptr, " \t");

		/* DPDK expects each argument as a separate string in the argv
		 * array, so we need to tokenize here in case the caller
		 * passed multiple arguments in the env_context string.
		 */
		while (tok != NULL) {
			args = push_arg(args, &argcount, strdup(tok));
			tok = strtok(NULL, " \t");
		}

		free(ptr);
	}

	g_eal_cmdline = args;
	g_eal_cmdline = args;
	g_eal_cmdline_argcount = argcount;
	g_eal_cmdline_argcount = argcount;
	return argcount;
	return argcount;