aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-kernel/cryptodev/sdk_patches/0100-close-the-session-after-every-test.patch
blob: a108b9d07a817d69b574489b7cbd05539e734a1d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
From 3ca93181fbcaa0acac01588738eb50270cf4999a Mon Sep 17 00:00:00 2001
From: Alexe Radu <radu.alexe@nxp.com>
Date: Fri, 9 Dec 2016 16:05:56 +0200
Subject: [PATCH 100/104] close the session after every test

Signed-off-by: Alexe Radu <radu.alexe@nxp.com>
---
 tests/speed.c | 42 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git a/tests/speed.c b/tests/speed.c
index 61259b9..99ef75b 100644
--- a/tests/speed.c
+++ b/tests/speed.c
@@ -488,6 +488,12 @@ int run_null(int fdc, struct test_params tp)
 	}
 
 	do_test_vectors(fdc, tp, &sess);
+
+	if (ioctl(fdc, CIOCFSESSION, &sess)) {
+		perror("ioctl(CIOCFSESSION)");
+		return -EINVAL;
+	}
+
 	return 0;
 }
 
@@ -507,6 +513,12 @@ int run_aes_128_cbc(int fdc, struct test_params tp)
 	}
 
 	do_test_vectors(fdc, tp, &sess);
+
+	if (ioctl(fdc, CIOCFSESSION, &sess)) {
+		perror("ioctl(CIOCFSESSION)");
+		return -EINVAL;
+	}
+
 	return 0;
 }
 
@@ -526,6 +538,12 @@ int run_aes_256_xts(int fdc, struct test_params tp)
 	}
 
 	do_test_vectors(fdc, tp, &sess);
+
+	if (ioctl(fdc, CIOCFSESSION, &sess)) {
+		perror("ioctl(CIOCFSESSION)");
+		return -EINVAL;
+	}
+
 	return 0;
 }
 
@@ -541,6 +559,12 @@ int run_crc32c(int fdc, struct test_params tp)
 	}
 
 	do_test_vectors(fdc, tp, &sess);
+
+	if (ioctl(fdc, CIOCFSESSION, &sess)) {
+		perror("ioctl(CIOCFSESSION)");
+		return -EINVAL;
+	}
+
 	return 0;
 }
 
@@ -556,6 +580,12 @@ int run_sha1(int fdc, struct test_params tp)
 	}
 
 	do_test_vectors(fdc, tp, &sess);
+
+	if (ioctl(fdc, CIOCFSESSION, &sess)) {
+		perror("ioctl(CIOCFSESSION)");
+		return -EINVAL;
+	}
+
 	return 0;
 }
 
@@ -571,6 +601,12 @@ int run_sha256(int fdc, struct test_params tp)
 	}
 
 	do_test_vectors(fdc, tp, &sess);
+
+	if (ioctl(fdc, CIOCFSESSION, &sess)) {
+		perror("ioctl(CIOCFSESSION)");
+		return -EINVAL;
+	}
+
 	return 0;
 }
 
@@ -595,6 +631,12 @@ int run_authenc(int fdc, struct test_params tp)
 	}
 
 	do_test_vectors(fdc, tp, &sess);
+
+	if (ioctl(fdc, CIOCFSESSION, &sess)) {
+		perror("ioctl(CIOCFSESSION)");
+		return -EINVAL;
+	}
+
 	return 0;
 }
 
-- 
2.10.2