From 5bdad0c1afa5575d98461d7b59a170b18ff06758 Mon Sep 17 00:00:00 2001 From: paul luse Date: Mon, 16 Aug 2021 15:27:38 -0400 Subject: [PATCH] examples/accel_perf: fix small bugs with copy + crc Wrong opcode was used when deciding whether a dst buffer is needed or not. Also on freeing we were freeing src instead of the vector parts of the task. Signed-off-by: paul luse Change-Id: I33eb9408ee20eca6c44911b4567d0367528347de Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9189 Community-CI: Broadcom CI Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins Reviewed-by: Monica Kenguva Reviewed-by: Jim Harris Reviewed-by: Aleksey Marchuk Reviewed-by: Ben Walker Reviewed-by: Ziye Yang --- examples/accel/perf/accel_perf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/accel/perf/accel_perf.c b/examples/accel/perf/accel_perf.c index 75c269460..9cae5f2e7 100644 --- a/examples/accel/perf/accel_perf.c +++ b/examples/accel/perf/accel_perf.c @@ -324,7 +324,7 @@ _get_task_data_bufs(struct ap_task *task) } } - if (g_workload_selection != ACCEL_COPY_CRC32C) { + if (g_workload_selection != ACCEL_CRC32C) { task->dst = spdk_dma_zmalloc(dst_buff_len, align, NULL); if (task->dst == NULL) { fprintf(stderr, "Unable to alloc dst buffer\n"); @@ -471,7 +471,7 @@ _free_task_buffers(struct ap_task *task) { uint32_t i; - if (g_workload_selection == ACCEL_CRC32C) { + if (g_workload_selection == ACCEL_CRC32C || g_workload_selection == ACCEL_COPY_CRC32C) { if (task->iovs) { for (i = 0; i < task->iov_cnt; i++) { if (task->iovs[i].iov_base) {