
From: Chenghai Huang <huangchenghai2@huawei.com> Add lz4 for zip benchmark in v2. We could use "numactl -N 1 -m 1 uadk_tool benchmark --alg lz4 --mode sva --prefetch --async --pktlen 32768 --seconds 30 --opt 0 --thread 32 --ctxnum 32 --winsize 1" to test the perf of lz4. Note that lz4 only supports block mode. 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 | 6 ++++++ 3 files changed, 13 insertions(+) diff --git a/uadk_tool/benchmark/uadk_benchmark.c b/uadk_tool/benchmark/uadk_benchmark.c index 90656a6d..ce9a1f2d 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}, + {"lz4", "lz4", LZ4}, {"lz77_only", "lz77_only", LZ77_ONLY}, {"rsa", "rsa-1024", RSA_1024}, {"rsa", "rsa-2048", RSA_2048}, @@ -371,6 +372,11 @@ static void parse_alg_param(struct acc_option *option) option->acctype = ZIP_TYPE; option->subtype = DEFAULT_TYPE; break; + case LZ4: + snprintf(option->algclass, MAX_ALG_NAME, "%s", "lz4"); + 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; diff --git a/uadk_tool/benchmark/uadk_benchmark.h b/uadk_tool/benchmark/uadk_benchmark.h index cac25fd1..90df2ead 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 + LZ4, LZ77_ONLY, RSA_1024, // rsa RSA_2048, diff --git a/uadk_tool/benchmark/zip_uadk_benchmark.c b/uadk_tool/benchmark/zip_uadk_benchmark.c index 3d45e619..7a42d9ea 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 LZ4: + alg = WD_LZ4; + if (optype == WD_DIR_DECOMPRESS) + ZIP_TST_PRT("Zip LZ4 just support compress!\n"); + optype = WD_DIR_COMPRESS; + break; case LZ77_ONLY: alg = WD_LZ77_ONLY; if (optype == WD_DIR_DECOMPRESS) -- 2.33.0