Commit 33c517c5 authored by Tomasz Zawadzki's avatar Tomasz Zawadzki Committed by Jim Harris
Browse files

ioat/perf: handle spdk_mempool_get() failure



Change-Id: I3b3ca9ce1db609bda59e991f84f511747f49eb87
Signed-off-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/433825


Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent ac7821dc
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -321,7 +321,7 @@ submit_single_xfer(struct ioat_chan_entry *ioat_chan_entry, struct ioat_task *io
	ioat_chan_entry->current_queue_depth++;
}

static void
static int
submit_xfers(struct ioat_chan_entry *ioat_chan_entry, uint64_t queue_depth)
{
	while (queue_depth-- > 0) {
@@ -331,9 +331,14 @@ submit_xfers(struct ioat_chan_entry *ioat_chan_entry, uint64_t queue_depth)
		src = spdk_mempool_get(ioat_chan_entry->data_pool);
		dst = spdk_mempool_get(ioat_chan_entry->data_pool);
		ioat_task = spdk_mempool_get(ioat_chan_entry->task_pool);
		if (!ioat_task) {
			fprintf(stderr, "Unable to get ioat_task\n");
			return -1;
		}

		submit_single_xfer(ioat_chan_entry, ioat_task, dst, src);
	}
	return 0;
}

static int
@@ -350,7 +355,9 @@ work_fn(void *arg)
	t = worker->ctx;
	while (t != NULL) {
		/* begin to submit transfers */
		submit_xfers(t, g_user_config.queue_depth);
		if (submit_xfers(t, g_user_config.queue_depth) < 0) {
			return -1;
		}
		t = t->next;
	}