Commit d62f985e authored by Krzysztof Goreczny's avatar Krzysztof Goreczny Committed by Tomasz Zawadzki
Browse files

test/nvme: add no-huge option to the aer binary



This way tests that use aer could run in env where hugepages are not
available.
For now only NVMf tests are prepared to work without huge pages so
extend that to all ear binary calls.

Change-Id: I312ddbec59641fe1137e7e550ec46266e515bb03
Signed-off-by: default avatarKrzysztof Goreczny <krzysztof.goreczny@dell.com>
Reviewed-on: https://review.spdk.io/c/spdk/spdk/+/26327


Reviewed-by: default avatarMichal Berger <michal.berger@nutanix.com>
Reviewed-by: default avatarBoris Glimcher <Boris.Glimcher@emc.com>
Reviewed-by: default avatarJim Harris <jim.harris@nvidia.com>
Tested-by: default avatarSPDK Automated Test System <spdkbot@gmail.com>
Reviewed-by: default avatarKonrad Sztyber <ksztyber@nvidia.com>
parent 91bc6c92
Loading
Loading
Loading
Loading
+22 −2
Original line number Diff line number Diff line
@@ -261,19 +261,28 @@ usage(const char *program_name)
	spdk_log_usage(stdout, "-L");
	AER_PRINTF("\t-i <id>    shared memory group ID\n");
	AER_PRINTF("\t-m         Multi-Process AER Test (only with Temp Test)\n");
	AER_PRINTF("\t-s         memory size in MB for DPDK\n");
	AER_PRINTF("\t--no-huge  SPDK is run without hugepages\n");
	AER_PRINTF("\t-H         show this usage\n");
}

#define AER_GETOPT_STRING "gi:mn:r:t:HL:Ts:"
static const struct option g_aer_cmdline_opts[] = {
#define AER_NO_HUGE        257
	{"no-huge", no_argument, NULL, AER_NO_HUGE},
	{0, 0, 0, 0}
};
static int
parse_args(int argc, char **argv, struct spdk_env_opts *env_opts)
{
	int op, rc;
	int op, rc, opt_index;
	long int val;

	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, "gi:mn:r:t:HL:T")) != -1) {
	while ((op = getopt_long(argc, argv, AER_GETOPT_STRING, g_aer_cmdline_opts,
				 &opt_index)) != -1) {
		switch (op) {
		case 'n':
			val = spdk_strtol(optarg, 10);
@@ -322,6 +331,17 @@ parse_args(int argc, char **argv, struct spdk_env_opts *env_opts)
		case 'm':
			g_multi_process_test = 1;
			break;
		case 's':
			val = spdk_strtol(optarg, 10);
			if (val < 0) {
				fprintf(stderr, "converting a string to integer failed\n");
				return -EINVAL;
			}
			env_opts->mem_size = val;
			break;
		case AER_NO_HUGE:
			env_opts->no_huge = true;
			break;
		default:
			usage(argv[0]);
			return 1;
+2 −1
Original line number Diff line number Diff line
@@ -29,7 +29,8 @@ $rootdir/test/nvme/aer/aer -r "\
        adrfam:IPv4 \
        traddr:$NVMF_FIRST_TARGET_IP \
        trsvcid:$NVMF_PORT \
        subnqn:nqn.2016-06.io.spdk:cnode1" -n 2 -t $AER_TOUCH_FILE &
        subnqn:nqn.2016-06.io.spdk:cnode1" -n 2 -t $AER_TOUCH_FILE \
	"${NO_HUGE[@]}" &
aerpid=$!

# Waiting for aer start to work
+1 −1
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@ function aer_vfio_user() {
	$rootdir/test/nvme/aer/aer -r "\
		trtype:$TEST_TRANSPORT \
		traddr:$traddr \
		subnqn:$subnqn" -n $NUM_DEVICES -g -t $AER_TOUCH_FILE &
		subnqn:$subnqn" -n $NUM_DEVICES -g -t $AER_TOUCH_FILE "${NO_HUGE[@]}" &
	aerpid=$!

	# Waiting for aer start to work