126 Star 3 Fork 18

src-openEuler/libwd

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0035-uadk-tools-support-the-nosva-test-of-a-specified-dev.patch 4.84 KB
一键复制 编辑 原始数据 按行查看 历史
JangShui Yang 提交于 2024-04-07 18:05 . libwd: update the source code
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
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/libwd.git
git@gitee.com:src-openeuler/libwd.git
src-openeuler
libwd
libwd
master

搜索帮助