summaryrefslogtreecommitdiffstats
path: root/recipes-kernel/cryptodev/sdk_patches/0057-gracefull-stop-for-async-speed-tests.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-kernel/cryptodev/sdk_patches/0057-gracefull-stop-for-async-speed-tests.patch')
-rw-r--r--recipes-kernel/cryptodev/sdk_patches/0057-gracefull-stop-for-async-speed-tests.patch64
1 files changed, 64 insertions, 0 deletions
diff --git a/recipes-kernel/cryptodev/sdk_patches/0057-gracefull-stop-for-async-speed-tests.patch b/recipes-kernel/cryptodev/sdk_patches/0057-gracefull-stop-for-async-speed-tests.patch
new file mode 100644
index 00000000..5ba0578a
--- /dev/null
+++ b/recipes-kernel/cryptodev/sdk_patches/0057-gracefull-stop-for-async-speed-tests.patch
@@ -0,0 +1,64 @@
1From f7e3566382bf22fc73c5a0edfde5c5349a92f8ea Mon Sep 17 00:00:00 2001
2From: Alexe Radu <radu.alexe@nxp.com>
3Date: Tue, 25 Oct 2016 18:35:13 +0300
4Subject: [PATCH 057/104] gracefull stop for async speed tests
5
6Signed-off-by: Alexe Radu <radu.alexe@nxp.com>
7Signed-off-by: Cristian Stoica <cristian.stoica@nxp.com>
8---
9 tests/async_speed.c | 16 ++++++++++++++++
10 1 file changed, 16 insertions(+)
11
12diff --git a/tests/async_speed.c b/tests/async_speed.c
13index b895a85..e6bbeed 100644
14--- a/tests/async_speed.c
15+++ b/tests/async_speed.c
16@@ -77,6 +77,7 @@ static double udifftimeval(struct timeval start, struct timeval end)
17 }
18
19 static int must_finish = 0;
20+static int must_exit = 0;
21 static struct pollfd pfd;
22
23 static void alarm_handler(int signo)
24@@ -85,6 +86,12 @@ static void alarm_handler(int signo)
25 pfd.events = POLLIN;
26 }
27
28+static void exit_handler(int signo)
29+{
30+ must_exit = 1;
31+ printf("\nexit requested by user through ctrl+c \n");
32+}
33+
34 static char *units[] = { "", "Ki", "Mi", "Gi", "Ti", 0};
35
36 static void value2human(uint64_t bytes, double time, double* data, double* speed,char* metric)
37@@ -261,6 +268,10 @@ void do_test_vectors(int fdc, struct test_params tp, struct session_op *sess)
38 encrypt_data(fdc, tp, sess);
39 } else {
40 for (i = 256; i <= (64 * 1024); i *= 2) {
41+ if (must_exit) {
42+ break;
43+ }
44+
45 tp.nvalue = i;
46 if (encrypt_data(fdc, tp, sess)) {
47 break;
48@@ -422,8 +433,13 @@ int main(int argc, char **argv)
49 }
50
51 signal(SIGALRM, alarm_handler);
52+ signal(SIGINT, exit_handler);
53
54 for (i = 0; i < ALG_COUNT; i++) {
55+ if (must_exit) {
56+ break;
57+ }
58+
59 if (alg_flag) {
60 if (strcmp(alg_name, ciphers[i].name) == 0) {
61 run_test(i, tp);
62--
632.10.2
64