diff --git a/examples/accel/perf/accel_perf.c b/examples/accel/perf/accel_perf.c index 9d8acb703..5144c78df 100644 --- a/examples/accel/perf/accel_perf.c +++ b/examples/accel/perf/accel_perf.c @@ -544,8 +544,8 @@ _init_thread(void *arg1) g_num_workers++; pthread_mutex_unlock(&g_workers_lock); - /* TODO: remove batch check once implemented for IOAT */ - if ((g_capabilites & ACCEL_BATCH) == ACCEL_BATCH && g_queue_depth > 1) { + /* Batching is only possible if there is at least 2 operations. */ + if (g_queue_depth > 1) { /* Selected engine supports batching and we have enough, so do it. */ max_per_batch = spdk_accel_batch_get_max(worker->ch); diff --git a/module/accel/ioat/accel_engine_ioat.c b/module/accel/ioat/accel_engine_ioat.c index d4c7cbccd..2ecfad5e6 100644 --- a/module/accel/ioat/accel_engine_ioat.c +++ b/module/accel/ioat/accel_engine_ioat.c @@ -288,8 +288,14 @@ static int ioat_batch_prep_copy(void *cb_arg, struct spdk_io_channel *ch, struct spdk_accel_batch *batch, void *dst, void *src, uint64_t nbytes, spdk_accel_completion_cb cb) { - /* TODO - HW ACCELERATED */ - return 0;; + struct ioat_io_channel *ioat_ch = spdk_io_channel_get_ctx(ch); + struct ioat_task *ioat_task = (struct ioat_task *)cb_arg; + + ioat_task->cb = cb; + ioat_ch->hw_batch = true; + + /* Call the IOAT library prep function. */ + return spdk_ioat_build_copy(ioat_ch->ioat_ch, ioat_task, ioat_done, dst, src, nbytes); } static int @@ -297,8 +303,14 @@ ioat_batch_prep_fill(void *cb_arg, struct spdk_io_channel *ch, struct spdk_accel_batch *batch, void *dst, uint8_t fill, uint64_t nbytes, spdk_accel_completion_cb cb) { - /* TODO - HW ACCELERATED */ - return 0; + struct ioat_io_channel *ioat_ch = spdk_io_channel_get_ctx(ch); + struct ioat_task *ioat_task = (struct ioat_task *)cb_arg; + + ioat_task->cb = cb; + ioat_ch->hw_batch = true; + + /* Call the IOAT library prep function. */ + return spdk_ioat_build_fill(ioat_ch->ioat_ch, ioat_task, ioat_done, dst, fill, nbytes); } static int @@ -391,7 +403,9 @@ ioat_batch_submit(void *cb_arg, struct spdk_io_channel *ch, struct spdk_accel_ba return -EINVAL; } - /* TODO submit the batched HW items first. */ + /* Flush the batched HW items first. */ + spdk_ioat_flush(ioat_ch->ioat_ch); + ioat_ch->hw_batch = false; /* Complete the batched software items. */ while ((op = TAILQ_FIRST(&ioat_ch->sw_batch))) {