Commit 2dd64cf9 authored by paul luse's avatar paul luse Committed by Jim Harris
Browse files

examples/accel_perf: fail correctly when we can't get a channel



By design there is a limit to how many channels the idxd driver
can suport based on how many DSA instances are available.  When we
reach the limit we won't be able to get a channel.  This fixes that
error path to fail gracefully instead of seg faulting.

Signed-off-by: default avatarpaul luse <paul.e.luse@intel.com>
Change-Id: I226f59913cb830eae0707623ae251ba19bce9aaf
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12218


Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 81d3cc1b
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -701,6 +701,10 @@ _init_thread(void *arg1)
	g_workers = worker;
	pthread_mutex_unlock(&g_workers_lock);
	worker->ch = spdk_accel_engine_get_io_channel();
	if (worker->ch == NULL) {
		fprintf(stderr, "Unable to get an accel channel\n");
		goto error;
	}

	TAILQ_INIT(&worker->tasks_pool);

@@ -757,7 +761,6 @@ error:
	free(worker->rnd_data);
	_free_task_buffers_in_pool(worker);
	free(worker->task_base);
	free(worker);
	spdk_app_stop(-1);
}