Commit 40ec8e97 authored by paul luse's avatar paul luse Committed by Tomasz Zawadzki
Browse files

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: default avatarpaul luse <paul.e.luse@intel.com>
Change-Id: I5e6a0f382f9090e428ee67fbdfb60926e9c85917
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2879


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
parent f2f1060e
Loading
Loading
Loading
Loading
+18 −13
Original line number Diff line number Diff line
@@ -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,18 +198,18 @@ _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),
		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),
		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),
		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;
@@ -221,7 +222,7 @@ _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),
		rc = spdk_accel_submit_compare(__accel_task_from_ap_task(task),
					       worker->ch, task->dst, task->src,
					       g_xfer_size_bytes, accel_done);
		break;
@@ -230,6 +231,10 @@ _submit_single(void *arg1, void *arg2)
		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);