ioat/perf: handle spdk_mempool_get() failure
Change-Id: I3b3ca9ce1db609bda59e991f84f511747f49eb87 Signed-off-by: Tomasz 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: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
ac7821dc82
commit
33c517c57a
@ -321,7 +321,7 @@ submit_single_xfer(struct ioat_chan_entry *ioat_chan_entry, struct ioat_task *io
|
|||||||
ioat_chan_entry->current_queue_depth++;
|
ioat_chan_entry->current_queue_depth++;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static int
|
||||||
submit_xfers(struct ioat_chan_entry *ioat_chan_entry, uint64_t queue_depth)
|
submit_xfers(struct ioat_chan_entry *ioat_chan_entry, uint64_t queue_depth)
|
||||||
{
|
{
|
||||||
while (queue_depth-- > 0) {
|
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);
|
src = spdk_mempool_get(ioat_chan_entry->data_pool);
|
||||||
dst = 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);
|
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);
|
submit_single_xfer(ioat_chan_entry, ioat_task, dst, src);
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@ -350,7 +355,9 @@ work_fn(void *arg)
|
|||||||
t = worker->ctx;
|
t = worker->ctx;
|
||||||
while (t != NULL) {
|
while (t != NULL) {
|
||||||
/* begin to submit transfers */
|
/* 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;
|
t = t->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user