From 1e660daa8d9ee905e1ada2f43e265dc8daaefb86 Mon Sep 17 00:00:00 2001 From: Ziye Yang Date: Wed, 9 Jun 2021 23:56:34 +0800 Subject: [PATCH] accel_engine: fix the vector crc32c computing for hw path. We face the checksum error when using idxd hardware in vector mode because we put fields of internal function in wrong union. When use vector crc32c operation, seed and chained functions and cb's will be used in the same time, so we should not put them in the same union. With this patch, we can fix the crc32c computing while using the vector mode with iov_count > 1. Signed-off-by: Ziye Yang Change-Id: I7097b47294ffd5dcac7d7a83d583321a73dc50d2 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8213 Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins Reviewed-by: Paul Luse Reviewed-by: Shuhei Matsumoto Reviewed-by: Aleksey Marchuk Reviewed-by: Jim Harris --- include/spdk_internal/accel_engine.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/spdk_internal/accel_engine.h b/include/spdk_internal/accel_engine.h index ebbc65e13..a3cb56306 100644 --- a/include/spdk_internal/accel_engine.h +++ b/include/spdk_internal/accel_engine.h @@ -81,6 +81,10 @@ struct spdk_accel_task { struct spdk_accel_batch *batch; spdk_accel_completion_cb cb_fn; void *cb_arg; + struct { + spdk_accel_completion_cb cb_fn; + void *cb_arg; + } chained; union { struct { struct iovec *iovs; /* iovs passed by the caller */ @@ -93,10 +97,6 @@ struct spdk_accel_task { void *src2; }; union { - struct { - spdk_accel_completion_cb cb_fn; - void *cb_arg; - } chained; void *dst2; uint32_t seed; uint64_t fill_pattern;