examples/accel/perf: check engine ret values and don't stop on fail

A subsequent patch brought me to realize that I was not checking the
return values from operational calls to the engine. Also, noticed
that on any failure we'd stop submitting IO but still wait until the
timer expired to exist. To match what other perf tools do, now
continue to submit even after an error and run until the clock is
out giving an accurate count of transient failures and successes.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I5e6a0f382f9090e428ee67fbdfb60926e9c85917
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2879
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
paul luse 2020-06-12 13:58:31 -04:00 committed by Tomasz Zawadzki
parent f2f1060ed2
commit 40ec8e97fe

View File

@ -190,6 +190,7 @@ _submit_single(void *arg1, void *arg2)
struct worker_thread *worker = arg1;
struct ap_task *task = arg2;
int random_num;
int rc = 0;
assert(worker);
@ -197,20 +198,20 @@ _submit_single(void *arg1, void *arg2)
task->worker->current_queue_depth++;
switch (g_workload_selection) {
case ACCEL_COPY:
spdk_accel_submit_copy(__accel_task_from_ap_task(task),
worker->ch, task->dst,
task->src, g_xfer_size_bytes, accel_done);
rc = spdk_accel_submit_copy(__accel_task_from_ap_task(task),
worker->ch, task->dst,
task->src, g_xfer_size_bytes, accel_done);
break;
case ACCEL_FILL:
/* For fill use the first byte of the task->dst buffer */
spdk_accel_submit_fill(__accel_task_from_ap_task(task),
worker->ch, task->dst, *(uint8_t *)task->src,
g_xfer_size_bytes, accel_done);
rc = spdk_accel_submit_fill(__accel_task_from_ap_task(task),
worker->ch, task->dst, *(uint8_t *)task->src,
g_xfer_size_bytes, accel_done);
break;
case ACCEL_CRC32C:
spdk_accel_submit_crc32c(__accel_task_from_ap_task(task),
worker->ch, (uint32_t *)task->dst, task->src, g_crc32c_seed,
g_xfer_size_bytes, accel_done);
rc = spdk_accel_submit_crc32c(__accel_task_from_ap_task(task),
worker->ch, (uint32_t *)task->dst, task->src, g_crc32c_seed,
g_xfer_size_bytes, accel_done);
break;
case ACCEL_COMPARE:
random_num = rand() % 100;
@ -221,15 +222,19 @@ _submit_single(void *arg1, void *arg2)
task->expected_status = 0;
*(uint8_t *)task->dst = DATA_PATTERN;
}
spdk_accel_submit_compare(__accel_task_from_ap_task(task),
worker->ch, task->dst, task->src,
g_xfer_size_bytes, accel_done);
rc = spdk_accel_submit_compare(__accel_task_from_ap_task(task),
worker->ch, task->dst, task->src,
g_xfer_size_bytes, accel_done);
break;
default:
assert(false);
break;
}
if (rc) {
accel_done(__accel_task_from_ap_task(task), rc);
}
}
static void
@ -275,7 +280,7 @@ _accel_done(void *arg1)
worker->xfer_completed++;
worker->current_queue_depth--;
if (!worker->is_draining && worker->xfer_failed == 0) {
if (!worker->is_draining) {
_submit_single(worker, task);
} else {
spdk_free(task->src);