module/accel/ioat: add support for batching IOAT accelerated ops

Also remove the batching check in accel_perf as all 3 engines
now support it.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: Ib4cf4b148b50df50a4fc7be9e861cc83f355623a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3155
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
paul luse 2020-07-01 15:24:49 -04:00 committed by Jim Harris
parent be34c31e16
commit f295f5b31a
2 changed files with 21 additions and 7 deletions

View File

@ -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);

View File

@ -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))) {