From: Chenghai Huang huangchenghai2@huawei.com
Add the description of device parameters. The input should use the device name from '/sys/class/uacce/<name>'. Only full matching device names are supported.
Signed-off-by: Chenghai Huang huangchenghai2@huawei.com --- uadk_tool/benchmark/hpre_wd_benchmark.c | 8 ++++++++ uadk_tool/benchmark/sec_wd_benchmark.c | 8 ++++++++ uadk_tool/benchmark/trng_wd_benchmark.c | 8 ++++++++ uadk_tool/benchmark/uadk_benchmark.c | 3 +++ uadk_tool/benchmark/zip_wd_benchmark.c | 8 ++++++++ 5 files changed, 35 insertions(+)
diff --git a/uadk_tool/benchmark/hpre_wd_benchmark.c b/uadk_tool/benchmark/hpre_wd_benchmark.c index 2873ffd..4f87e06 100644 --- a/uadk_tool/benchmark/hpre_wd_benchmark.c +++ b/uadk_tool/benchmark/hpre_wd_benchmark.c @@ -431,6 +431,14 @@ static int init_hpre_wd_queue(struct acc_option *options) /* nodemask need to be clean */ g_thread_queue.bd_res[i].queue->node_mask = 0x0; memset(g_thread_queue.bd_res[i].queue->dev_path, 0x0, PATH_STR_SIZE); + if (strlen(options->device) != 0) { + ret = snprintf(g_thread_queue.bd_res[i].queue->dev_path, + PATH_STR_SIZE, options->device); + if (ret < 0) { + WD_ERR("failed to copy dev file path!\n"); + return -WD_EINVAL; + } + }
ret = wd_request_queue(g_thread_queue.bd_res[i].queue); if (ret) { diff --git a/uadk_tool/benchmark/sec_wd_benchmark.c b/uadk_tool/benchmark/sec_wd_benchmark.c index aa03db8..62efe9a 100644 --- a/uadk_tool/benchmark/sec_wd_benchmark.c +++ b/uadk_tool/benchmark/sec_wd_benchmark.c @@ -600,6 +600,14 @@ static int init_wd_queue(struct acc_option *options) /* nodemask need to be clean */ g_thread_queue.bd_res[i].queue->node_mask = 0x0; memset(g_thread_queue.bd_res[i].queue->dev_path, 0x0, PATH_STR_SIZE); + if (strlen(options->device) != 0) { + ret = snprintf(g_thread_queue.bd_res[i].queue->dev_path, + PATH_STR_SIZE, options->device); + if (ret < 0) { + WD_ERR("failed to copy dev file path!\n"); + return -WD_EINVAL; + } + }
ret = wd_request_queue(g_thread_queue.bd_res[i].queue); if (ret) { diff --git a/uadk_tool/benchmark/trng_wd_benchmark.c b/uadk_tool/benchmark/trng_wd_benchmark.c index 64942f0..e643520 100644 --- a/uadk_tool/benchmark/trng_wd_benchmark.c +++ b/uadk_tool/benchmark/trng_wd_benchmark.c @@ -51,6 +51,14 @@ static int init_trng_wd_queue(struct acc_option *options) /* nodemask need to be clean */ g_thread_queue.bd_res[i].queue->node_mask = 0x0; memset(g_thread_queue.bd_res[i].queue->dev_path, 0x0, PATH_STR_SIZE); + if (strlen(options->device) != 0) { + ret = snprintf(g_thread_queue.bd_res[i].queue->dev_path, + PATH_STR_SIZE, options->device); + if (ret < 0) { + WD_ERR("failed to copy dev file path!\n"); + return -WD_EINVAL; + } + }
g_thread_queue.bd_res[i].in_bytes = options->pktlen; g_thread_queue.bd_res[i].out = malloc(options->pktlen); diff --git a/uadk_tool/benchmark/uadk_benchmark.c b/uadk_tool/benchmark/uadk_benchmark.c index cf3a93c..0ebbb68 100644 --- a/uadk_tool/benchmark/uadk_benchmark.c +++ b/uadk_tool/benchmark/uadk_benchmark.c @@ -595,6 +595,7 @@ static void dump_param(struct acc_option *option) ACC_TST_PRT(" [--engine]: %s\n", option->engine); ACC_TST_PRT(" [--latency]: %u\n", option->latency); ACC_TST_PRT(" [--init2]: %u\n", option->inittype); + ACC_TST_PRT(" [--device]: %s\n", option->device); }
int acc_benchmark_run(struct acc_option *option) @@ -718,6 +719,8 @@ static void print_help(void) ACC_TST_PRT(" test the running time of packets\n"); ACC_TST_PRT(" [--init2]:\n"); ACC_TST_PRT(" select init2 mode in the init interface of UADK SVA\n"); + ACC_TST_PRT(" [--device]:\n"); + ACC_TST_PRT(" select device to do task\n"); ACC_TST_PRT(" [--help] = usage\n"); ACC_TST_PRT("Example\n"); ACC_TST_PRT(" ./uadk_tool benchmark --alg aes-128-cbc --mode sva --opt 0 --sync\n"); diff --git a/uadk_tool/benchmark/zip_wd_benchmark.c b/uadk_tool/benchmark/zip_wd_benchmark.c index d7bafd6..7f85b3c 100644 --- a/uadk_tool/benchmark/zip_wd_benchmark.c +++ b/uadk_tool/benchmark/zip_wd_benchmark.c @@ -310,6 +310,14 @@ static int init_zip_wd_queue(struct acc_option *options) /* nodemask need to be clean */ g_thread_queue.bd_res[i].queue->node_mask = 0x0; memset(g_thread_queue.bd_res[i].queue->dev_path, 0x0, PATH_STR_SIZE); + if (strlen(options->device) != 0) { + ret = snprintf(g_thread_queue.bd_res[i].queue->dev_path, + PATH_STR_SIZE, options->device); + if (ret < 0) { + WD_ERR("failed to copy dev file path!\n"); + return -WD_EINVAL; + } + }
ret = wd_request_queue(g_thread_queue.bd_res[i].queue); if (ret) {