bdevperf: add force completions mode.

When we are using bdevperf for some sort of reset test, we need to make
sure that it doesn't cause failed requests to stop the test. We already
have the g_reset flag, but we can't use that for tests where we only
want to simulate a target disconnect event.

Change-Id: I0cbf495708a1e6680682b099e8c17862ec6ff3e2
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/473761
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Seth Howell 2019-11-08 16:30:48 -07:00 committed by Tomasz Zawadzki
parent 6d62ef1e81
commit bdeb41a3cd

View File

@ -64,6 +64,7 @@ static int g_rw_percentage = -1;
static int g_is_random;
static bool g_verify = false;
static bool g_reset = false;
static bool g_continue_on_failure = false;
static bool g_unmap = false;
static bool g_write_zeroes = false;
static bool g_flush = false;
@ -493,7 +494,7 @@ bdevperf_complete(struct spdk_bdev_io *bdev_io, bool success, void *cb_arg)
md_check = spdk_bdev_get_dif_type(target->bdev) == SPDK_DIF_DISABLE;
if (!success) {
if (!g_reset) {
if (!g_reset && !g_continue_on_failure) {
target->is_draining = true;
g_run_failed = true;
printf("task offset: %lu on target bdev=%s fails\n",
@ -961,6 +962,7 @@ bdevperf_usage(void)
printf("\t\t(only valid with -S)\n");
printf(" -S <period> show performance result in real time every <period> seconds\n");
printf(" -T <target> target bdev\n");
printf(" -f continue processing I/O even after failures\n");
printf(" -z start bdevperf, but wait for RPC to start tests\n");
printf(" -C enable every core to send I/Os to each bdev\n");
}
@ -1387,6 +1389,8 @@ bdevperf_parse_arg(int ch, char *arg)
g_wait_for_tests = true;
} else if (ch == 'C') {
g_every_core_for_each_bdev = true;
} else if (ch == 'f') {
g_continue_on_failure = true;
} else {
tmp = spdk_strtoll(optarg, 10);
if (tmp < 0) {
@ -1504,7 +1508,7 @@ main(int argc, char **argv)
g_time_in_sec = 0;
g_mix_specified = false;
if ((rc = spdk_app_parse_args(argc, argv, &opts, "zq:o:t:w:CM:P:S:T:", NULL,
if ((rc = spdk_app_parse_args(argc, argv, &opts, "zfq:o:t:w:CM:P:S:T:", NULL,
bdevperf_parse_arg, bdevperf_usage)) !=
SPDK_APP_PARSE_ARGS_SUCCESS) {
return rc;