代码拉取完成,页面将自动刷新
From 17e5f25df480a5cacc3ac5e8ae88b708786eec44 Mon Sep 17 00:00:00 2001
From: Chenghai Huang <huangchenghai2@huawei.com>
Date: Mon, 11 Mar 2024 16:22:58 +0800
Subject: [PATCH 35/44] uadk/tools - support the nosva test of a specified
device
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..6dc1269 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, "%s", 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..2ed8493 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, "%s", 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..3ce329a 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, "%s", 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..4424e08 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, "%s", 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) {
--
2.25.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。