accel_perf: update program exit code to reflect non-fatal errors

For use by test scripts to know when there was a non-fatal error.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I1c5e37edb13570aec1e186fe534ed6780a6de0c5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6324
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Community-CI: Mellanox Build Bot
This commit is contained in:
paul luse 2021-02-08 12:19:29 -05:00 committed by Tomasz Zawadzki
parent 445fe74ef5
commit 9b18966796

View File

@ -47,6 +47,7 @@
static uint64_t g_tsc_rate;
static uint64_t g_tsc_us_rate;
static uint64_t g_tsc_end;
static int g_rc;
static int g_xfer_size_bytes = 4096;
static int g_queue_depth = 32;
static int g_ops_per_batch = 0;
@ -218,7 +219,7 @@ unregister_worker(void *arg1)
assert(g_num_workers >= 1);
if (--g_num_workers == 0) {
pthread_mutex_unlock(&g_workers_lock);
dump_result();
g_rc = dump_result();
spdk_app_stop(0);
}
pthread_mutex_unlock(&g_workers_lock);
@ -904,14 +905,13 @@ main(int argc, char **argv)
{
struct spdk_app_opts opts = {};
struct worker_thread *worker, *tmp;
int rc = 0;
pthread_mutex_init(&g_workers_lock, NULL);
spdk_app_opts_init(&opts, sizeof(opts));
opts.reactor_mask = "0x1";
if (spdk_app_parse_args(argc, argv, &opts, "o:q:t:yw:P:f:b:T:", NULL, parse_args,
usage) != SPDK_APP_PARSE_ARGS_SUCCESS) {
rc = -1;
g_rc = -1;
goto cleanup;
}
@ -921,20 +921,20 @@ main(int argc, char **argv)
(g_workload_selection != ACCEL_COMPARE) &&
(g_workload_selection != ACCEL_DUALCAST)) {
usage();
rc = -1;
g_rc = -1;
goto cleanup;
}
if (g_ops_per_batch > 0 && (g_queue_depth % g_ops_per_batch > 0)) {
fprintf(stdout, "batch size must be a multiple of queue depth\n");
usage();
rc = -1;
g_rc = -1;
goto cleanup;
}
dump_user_config(&opts);
rc = spdk_app_start(&opts, accel_perf_start, NULL);
if (rc) {
g_rc = spdk_app_start(&opts, accel_perf_start, NULL);
if (g_rc) {
SPDK_ERRLOG("ERROR starting application\n");
}
@ -948,5 +948,5 @@ main(int argc, char **argv)
}
cleanup:
spdk_app_fini();
return rc;
return g_rc;
}