Projects
openEuler:Roll:Everything:RVA20
libwd
_service:obs_scm:0035-uadk-tools-support-the-no...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:obs_scm:0035-uadk-tools-support-the-nosva-test-of-a-specified-dev.patch of Package libwd
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
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2