Commit 0de6ed9d authored by Jim Harris's avatar Jim Harris Committed by Konrad Sztyber
Browse files

examples/nvme/hotplug: allow -t 0 to disable timeout



Also change the in-tree test scripts to just revert to
-t 0 to disable the timeout.  This avoids trying to
figure out exactly how much time is needed, since it
depends on number of SSDs and other factors.

If the test hangs for some reason, CI still has the
global timeout which will kill the test.

Fixes issue #2774.

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


Community-CI: Mellanox Build Bot
Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent 7ed18ac6
Loading
Loading
Loading
Loading
+11 −7
Original line number Diff line number Diff line
@@ -320,7 +320,16 @@ io_loop(void)
	uint64_t next_stats_tsc;
	int rc;

	if (g_time_in_sec > 0) {
		tsc_end = spdk_get_ticks() + g_time_in_sec * g_tsc_rate;
	} else {
		/* User specified 0 seconds for timeout, which means no timeout.
		 * So just set tsc_end to UINT64_MAX which ensures the loop
		 * will never time out.
		 */
		tsc_end = UINT64_MAX;
	}

	next_stats_tsc = spdk_get_ticks();

	while (1) {
@@ -404,7 +413,7 @@ usage(char *program_name)
	printf("\t[-i shm id (optional)]\n");
	printf("\t[-n expected hot insert times]\n");
	printf("\t[-r expected hot removal times]\n");
	printf("\t[-t time in seconds]\n");
	printf("\t[-t time in seconds to wait for all events (default: forever)]\n");
	printf("\t[-m iova mode: pa or va (optional)\n");
	printf("\t[-l log level]\n");
	printf("\t Available log levels:\n");
@@ -492,11 +501,6 @@ parse_args(int argc, char **argv)
		}
	}

	if (!g_time_in_sec) {
		usage(argv[0]);
		return 1;
	}

	return 0;
}

+1 −1
Original line number Diff line number Diff line
@@ -76,7 +76,7 @@ if [ "$driver" = "uio_pci_generic" ]; then
	mode="-m pa"
fi

"$SPDK_EXAMPLE_DIR/hotplug" -i 0 -t 100 -n $((2 * nvme_count)) -r $((2 * nvme_count)) \
"$SPDK_EXAMPLE_DIR/hotplug" -i 0 -t 0 -n $((2 * nvme_count)) -r $((2 * nvme_count)) \
	$mode --wait-for-rpc &
hotplug_pid=$!

+1 −1
Original line number Diff line number Diff line
@@ -74,7 +74,7 @@ run_hotplug() {

	"$SPDK_EXAMPLE_DIR/hotplug" \
		-i 0 \
		-t $((hotplug_events * hotplug_wait + hotplug_wait * 3)) \
		-t 0 \
		-n $((hotplug_events * nvme_count)) \
		-r $((hotplug_events * nvme_count)) \
		-l warning &