Turn on the test function of HPRE and ZIP modules.
Signed-off-by: Longfang Liu liulongfang@huawei.com --- uadk_tool/Makefile.am | 18 ++++++++++++++---- uadk_tool/benchmark/uadk_benchmark.c | 22 +++++++++++++++++++--- 2 files changed, 33 insertions(+), 7 deletions(-)
diff --git a/uadk_tool/Makefile.am b/uadk_tool/Makefile.am index f04b2f0..3f451b6 100644 --- a/uadk_tool/Makefile.am +++ b/uadk_tool/Makefile.am @@ -8,25 +8,35 @@ AM_CFLAGS=-Wall -fno-strict-aliasing -I$(top_srcdir) -I$(top_srcdir)/benchmark/i bin_PROGRAMS=uadk_tool
uadk_tool_SOURCES=uadk_tool.c dfx/uadk_dfx.c dfx/uadk_dfx.h \ - benchmark/uadk_benchmark.c benchmark/uadk_benchmark.h \ - benchmark/sec_uadk_benchmark.c benchmark/sec_uadk_benchmark.h \ - benchmark/sec_wd_benchmark.c benchmark/sec_wd_benchmark.h + benchmark/uadk_benchmark.c benchmark/uadk_benchmark.h \ + benchmark/sec_uadk_benchmark.c benchmark/sec_uadk_benchmark.h \ + benchmark/sec_wd_benchmark.c benchmark/sec_wd_benchmark.h \ + benchmark/hpre_uadk_benchmark.c benchmark/hpre_uadk_benchmark.h \ + benchmark/hpre_wd_benchmark.c hpre_wd_benchmark.h \ + benchmark/zip_uadk_benchmark.c benchmark/zip_uadk_benchmark.h \ + benchmark/zip_wd_benchmark.c benchmark/zip_wd_benchmark.h
if WD_STATIC_DRV AM_CFLAGS+=-Bstatic uadk_tool_LDADD=$(libwd_la_OBJECTS) \ $(libwd_crypto_la_OBJECTS) \ + ../.libs/libwd_comp.a \ ../.libs/libhisi_sec.a \ ../.libs/libhisi_hpre.a \ ../.libs/libhisi_zip.a \ -ldl -lnuma else uadk_tool_LDADD=-L../.libs -l:libwd.so.2 -l:libwd_crypto.so.2 \ - -lnuma + -l:libwd_comp.so.2 -lnuma endif
uadk_tool_LDFLAGS=-Wl,-rpath,'/usr/local/lib'
+if WITH_ZLIB_FSE_DIR +AM_CFLAGS += -DZLIB_FSE +uadk_tool_LDADD+= $(with_zlib_fse_dir)/libfse.a +endif + if WITH_OPENSSL_DIR AM_CFLAGS+= -DWITH_OPENSSL_DIR -I$(with_openssl_dir)/include
diff --git a/uadk_tool/benchmark/uadk_benchmark.c b/uadk_tool/benchmark/uadk_benchmark.c index 2904cba..d3b9ef3 100644 --- a/uadk_tool/benchmark/uadk_benchmark.c +++ b/uadk_tool/benchmark/uadk_benchmark.c @@ -8,7 +8,12 @@ #include "sec_wd_benchmark.h" #include "sec_soft_benchmark.h"
-#define BYTES_TO_KB 10 +#include "hpre_uadk_benchmark.h" +#include "hpre_wd_benchmark.h" + +#include "zip_uadk_benchmark.h" +#include "zip_wd_benchmark.h" + #define TABLE_SPACE_SIZE 8
/*----------------------------------------head struct--------------------------------------------------------*/ @@ -424,8 +429,18 @@ static int benchmark_run(struct acc_option *option) #endif break; case HPRE_TYPE: + if (option->modetype & SVA_MODE) { + ret = hpre_uadk_benchmark(option); + } else if (option->modetype & NOSVA_MODE) { + ret = hpre_wd_benchmark(option); + } break; case ZIP_TYPE: + if (option->modetype & SVA_MODE) { + ret = zip_uadk_benchmark(option); + } else if (option->modetype & NOSVA_MODE) { + ret = zip_wd_benchmark(option); + } break; }
@@ -546,8 +561,9 @@ static void print_help(void) ACC_TST_PRT(" The name of the algorithm for benchmarking\n"); ACC_TST_PRT(" [--mode sva/nosva/soft/sva-soft/nosva-soft]: start UADK or Warpdrive or Openssl mode test\n"); ACC_TST_PRT(" [--sync/--async]: start asynchronous/synchronous mode test\n"); - ACC_TST_PRT(" [--optype 0/1]:\n"); - ACC_TST_PRT(" encryption/decryption or compression/decompression\n"); + ACC_TST_PRT(" [--opt 0,1,2,3,4,5]:\n"); + ACC_TST_PRT(" SEC/ZIP: 0/1:encryption/decryption or compression/decompression\n"); + ACC_TST_PRT(" HPRE: 0~5:keygen, key compute, Enc, Dec, Sign, Verify\n"); ACC_TST_PRT(" [--pktlen]:\n"); ACC_TST_PRT(" set the length of BD message in bytes\n"); ACC_TST_PRT(" [--seconds]:\n");