From befbf7ca0ff2edfbf48fe4829578f3ebcba044ef Mon Sep 17 00:00:00 2001 From: paul luse Date: Tue, 10 May 2022 12:14:15 -0700 Subject: [PATCH] examples/idxd_perf: add copy+crc32C support Someone had it partially in there but never finished it. Likely copy and pasted most, but not all of it, from accel_perf long ago... Signed-off-by: paul luse Change-Id: I4f8bada5cb7c7fd5aea4487eef54f40432dde498 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12610 Community-CI: Broadcom CI Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins Reviewed-by: Ben Walker Reviewed-by: Tomasz Zawadzki --- examples/idxd/perf/perf.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/examples/idxd/perf/perf.c b/examples/idxd/perf/perf.c index 75d73bc70..cf3b6572b 100644 --- a/examples/idxd/perf/perf.c +++ b/examples/idxd/perf/perf.c @@ -459,7 +459,7 @@ _get_task_data_bufs(struct idxd_task *task) } } - if (g_workload_selection != IDXD_COPY_CRC32C) { + if (g_workload_selection != IDXD_CRC32C) { task->dst = spdk_dma_zmalloc(dst_buff_len, align, NULL); if (task->dst == NULL) { fprintf(stderr, "Unable to alloc dst buffer\n"); @@ -574,10 +574,16 @@ _submit_single(struct idxd_chan_entry *t, struct idxd_task *task) rc = spdk_idxd_submit_dualcast(t->ch, task->dst, task->dst2, task->src, g_xfer_size_bytes, flags, idxd_done, task); break; + case IDXD_COPY_CRC32C: + diov.iov_base = task->dst; + diov.iov_len = g_xfer_size_bytes; + rc = spdk_idxd_submit_copy_crc32c(t->ch, &diov, 1, task->iovs, task->iov_cnt, g_crc32c_seed, + &task->crc_dst, + flags, idxd_done, task); + break; default: assert(false); break; - } queue: