When testing the async encryption performance of the AEAD algorithm, the same bd_pool may not be processed completely and is sent as a new request in the next loop. As a result, incorrect encrypted data is stored in the dst. When the incorrect encrypted data is stored for decryption, a decryption error occurs.
This problem can be solved by restricting the sending times of the first bd_pool only once and saving the dst data in the first bd_pool to a file for decryption.
Signed-off-by: Qi Tao taoqi10@huawei.com --- uadk_tool/benchmark/sec_uadk_benchmark.c | 6 ++++++ uadk_tool/benchmark/uadk_benchmark.h | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/uadk_tool/benchmark/sec_uadk_benchmark.c b/uadk_tool/benchmark/sec_uadk_benchmark.c index 411d0c4..469ef8b 100644 --- a/uadk_tool/benchmark/sec_uadk_benchmark.c +++ b/uadk_tool/benchmark/sec_uadk_benchmark.c @@ -1356,6 +1356,12 @@ static void *sec_uadk_aead_async(void *arg) break; try_cnt = 0; i = count % MAX_POOL_LENTH; + + if (i == 0 && count > 0) { + count++; + continue; + } + areq.src = uadk_pool->bds[i].src; areq.dst = uadk_pool->bds[i].dst; areq.mac = uadk_pool->bds[i].mac; diff --git a/uadk_tool/benchmark/uadk_benchmark.h b/uadk_tool/benchmark/uadk_benchmark.h index 0def4b9..6d82905 100644 --- a/uadk_tool/benchmark/uadk_benchmark.h +++ b/uadk_tool/benchmark/uadk_benchmark.h @@ -32,7 +32,7 @@ #define MAX_DEVICE_NAME 64
#define MAX_BLOCK_NM 16384 /* BLOCK_NUM must 4 times of POOL_LENTH */ -#define MAX_POOL_LENTH 4096 +#define MAX_POOL_LENTH 8192 #define MAX_TRY_CNT 5000 #define SEND_USLEEP 100 #define SEC_2_USEC 1000000