
From: Chenghai Huang <huangchenghai2@huawei.com> Add lz77_only for zip benchmark in v2. We could use "numactl -N 1 -m 1 uadk_tool benchmark --alg lz77_only --mode sva --prefetch --async --pktlen 32768 --seconds 30 --opt 0 --thread 32 --ctxnum 32 --winsize 1 --complevel 8" to test the perf of lz77_only. Signed-off-by: Chenghai Huang <huangchenghai2@huawei.com> Signed-off-by: Qi Tao <taoqi10@huawei.com> --- uadk_tool/benchmark/uadk_benchmark.c | 6 ++++++ uadk_tool/benchmark/uadk_benchmark.h | 1 + uadk_tool/benchmark/zip_uadk_benchmark.c | 16 +++++++++++----- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/uadk_tool/benchmark/uadk_benchmark.c b/uadk_tool/benchmark/uadk_benchmark.c index 16980616..90656a6d 100644 --- a/uadk_tool/benchmark/uadk_benchmark.c +++ b/uadk_tool/benchmark/uadk_benchmark.c @@ -70,6 +70,7 @@ static struct acc_alg_item alg_options[] = { {"gzip", "gzip", GZIP}, {"deflate", "deflate", DEFLATE}, {"lz77_zstd", "lz77_zstd", LZ77_ZSTD}, + {"lz77_only", "lz77_only", LZ77_ONLY}, {"rsa", "rsa-1024", RSA_1024}, {"rsa", "rsa-2048", RSA_2048}, {"rsa", "rsa-3072", RSA_3072}, @@ -370,6 +371,11 @@ static void parse_alg_param(struct acc_option *option) option->acctype = ZIP_TYPE; option->subtype = DEFAULT_TYPE; break; + case LZ77_ONLY: + snprintf(option->algclass, MAX_ALG_NAME, "%s", "lz77_only"); + option->acctype = ZIP_TYPE; + option->subtype = DEFAULT_TYPE; + break; case SM2_ALG: snprintf(option->algclass, MAX_ALG_NAME, "%s", "sm2"); option->acctype = HPRE_TYPE; diff --git a/uadk_tool/benchmark/uadk_benchmark.h b/uadk_tool/benchmark/uadk_benchmark.h index 2739a0ef..cac25fd1 100644 --- a/uadk_tool/benchmark/uadk_benchmark.h +++ b/uadk_tool/benchmark/uadk_benchmark.h @@ -121,6 +121,7 @@ enum test_alg { GZIP, // gzip DEFLATE, // deflate LZ77_ZSTD, // lz77_zstd + LZ77_ONLY, RSA_1024, // rsa RSA_2048, RSA_3072, diff --git a/uadk_tool/benchmark/zip_uadk_benchmark.c b/uadk_tool/benchmark/zip_uadk_benchmark.c index c09df071..3d45e619 100644 --- a/uadk_tool/benchmark/zip_uadk_benchmark.c +++ b/uadk_tool/benchmark/zip_uadk_benchmark.c @@ -277,6 +277,12 @@ static int zip_uadk_param_parse(thread_data *tddata, struct acc_option *options) ZIP_TST_PRT("Zip LZ77_ZSTD just support compress!\n"); optype = WD_DIR_COMPRESS; break; + case LZ77_ONLY: + alg = WD_LZ77_ONLY; + if (optype == WD_DIR_DECOMPRESS) + ZIP_TST_PRT("Zip LZ77_ONLY just support compress!\n"); + optype = WD_DIR_COMPRESS; + break; default: ZIP_TST_PRT("failed to set zip alg\n"); return -EINVAL; @@ -1186,12 +1192,12 @@ static int zip_uadk_sync_threads(struct acc_option *options) threads_option.optype = options->optype; if (threads_option.mode == 1) {// stream mode - if (threads_option.alg == LZ77_ZSTD) + if (threads_option.alg == WD_LZ77_ZSTD || threads_option.alg == WD_LZ77_ONLY) uadk_zip_sync_run = zip_uadk_stm_lz77_sync_run; else uadk_zip_sync_run = zip_uadk_stm_sync_run; } else { - if (threads_option.alg == LZ77_ZSTD) + if (threads_option.alg == WD_LZ77_ZSTD || threads_option.alg == WD_LZ77_ONLY) uadk_zip_sync_run = zip_uadk_blk_lz77_sync_run; else uadk_zip_sync_run = zip_uadk_blk_sync_run; @@ -1243,7 +1249,7 @@ static int zip_uadk_async_threads(struct acc_option *options) return 0; } - if (threads_option.alg == LZ77_ZSTD) + if (threads_option.alg == WD_LZ77_ZSTD || threads_option.alg == WD_LZ77_ONLY) uadk_zip_async_run = zip_uadk_blk_lz77_async_run; else uadk_zip_async_run = zip_uadk_blk_async_run; @@ -1268,7 +1274,7 @@ static int zip_uadk_async_threads(struct acc_option *options) threads_args[i].win_sz = threads_option.win_sz; threads_args[i].comp_lv = threads_option.comp_lv; threads_args[i].td_id = i; - if (threads_option.alg == LZ77_ZSTD) { + if (threads_option.alg == WD_LZ77_ZSTD || threads_option.alg == WD_LZ77_ONLY) { struct bd_pool *uadk_pool = &g_zip_pool.pool[i]; u32 out_len = uadk_pool->bds[0].dst_len; @@ -1331,7 +1337,7 @@ tag_free: free(threads_args[i].tag); } lz77_free: - if (threads_option.alg == LZ77_ZSTD) { + if (threads_option.alg == WD_LZ77_ZSTD || threads_option.alg == WD_LZ77_ONLY) { for (i = 0; i < g_thread_num; i++) { if (threads_args[i].ftuple) free(threads_args[i].ftuple); -- 2.33.0