Commit 82466708 authored by Jim Harris's avatar Jim Harris
Browse files

env_dpdk: omit huge-related options when --no-huge specified



If user passes --no-huge as part of env_context, do
not add other huge-related options to the EAL command
line.  Instead emit an error message and return failure, if
any of them were specified explicitly.

Fixes c833f6aa ("env_dpdk: unlink hugepages if shm_id is not specified")
Fixes issue #2973.

Signed-off-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17483

 (master)

(cherry picked from commit db6297b5)
Change-Id: I7aa49e4af5f3c333fa1e7dec4e3f5b4b92e7d414
Signed-off-by: default avatarKrzysztof Karas <krzysztof.karas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17705


Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
parent 504143d1
Loading
Loading
Loading
Loading
+30 −22
Original line number Diff line number Diff line
@@ -291,6 +291,13 @@ build_eal_cmdline(const struct spdk_env_opts *opts)
		}
	}

	if (opts->env_context && strstr(opts->env_context, "--no-huge") != NULL) {
		if (opts->hugepage_single_segments || opts->unlink_hugepage || opts->hugedir) {
			fprintf(stderr, "--no-huge invalid with other hugepage options\n");
			free_args(args, argcount);
			return -1;
		}
	} else {
		/* create just one hugetlbfs file */
		if (opts->hugepage_single_segments) {
			args = push_arg(args, &argcount, _sprintf_alloc("--single-file-segments"));
@@ -320,6 +327,7 @@ build_eal_cmdline(const struct spdk_env_opts *opts)
				return -1;
			}
		}
	}

	if (opts->num_pci_addr) {
		size_t i;