diff options
-rw-r--r-- | common/recipes-extended/openssl-qat/openssl-qat/0001-Use_sched_yield_api.patch | 47 | ||||
-rw-r--r-- | common/recipes-extended/openssl-qat/openssl-qat_0.4.9-009.bb | 2 |
2 files changed, 49 insertions, 0 deletions
diff --git a/common/recipes-extended/openssl-qat/openssl-qat/0001-Use_sched_yield_api.patch b/common/recipes-extended/openssl-qat/openssl-qat/0001-Use_sched_yield_api.patch new file mode 100644 index 00000000..1b7921fa --- /dev/null +++ b/common/recipes-extended/openssl-qat/openssl-qat/0001-Use_sched_yield_api.patch | |||
@@ -0,0 +1,47 @@ | |||
1 | From f4c50648752ee1000f606585f4df9fa6bd9ff8e8 Mon Sep 17 00:00:00 2001 | ||
2 | From: Saul Wold <sgw@linux.intel.com> | ||
3 | Date: Wed, 8 Feb 2017 17:36:48 -0800 | ||
4 | Subject: [PATCH] openssl-qat: Use sched_yield() instead of pthread_yield() | ||
5 | |||
6 | sched_yield() is the correct POSIX API to use for thread switching | ||
7 | This futher supports building with MUSL. | ||
8 | |||
9 | Upstream-Status: Pending | ||
10 | Signed-off-by: Saul Wold <sgw@linux.intel.com> | ||
11 | --- | ||
12 | engines/qat_engine/e_qat.c | 5 +++-- | ||
13 | 1 file changed, 3 insertions(+), 2 deletions(-) | ||
14 | |||
15 | diff --git a/engines/qat_engine/e_qat.c b/engines/qat_engine/e_qat.c | ||
16 | index 17d7935..af543bc 100644 | ||
17 | --- a/engines/qat_engine/e_qat.c | ||
18 | +++ b/engines/qat_engine/e_qat.c | ||
19 | @@ -90,6 +90,7 @@ | ||
20 | #include <stdio.h> | ||
21 | #include <stdlib.h> | ||
22 | #include <string.h> | ||
23 | +#include <sched.h> | ||
24 | #include <pthread.h> | ||
25 | #include <unistd.h> | ||
26 | #include <ctype.h> | ||
27 | @@ -545,7 +546,7 @@ CpaStatus myPerformOp(const CpaInstanceHandle instanceHandle, | ||
28 | pSrcBuffer, pDstBuffer, pVerifyResult); | ||
29 | if (status == CPA_STATUS_RETRY) { | ||
30 | qatPerformOpRetries++; | ||
31 | - pthread_yield(); | ||
32 | + sched_yield(); | ||
33 | if (uiRetry >= iMsgRetry | ||
34 | && iMsgRetry != QAT_INFINITE_MAX_NUM_RETRIES) { | ||
35 | break; | ||
36 | @@ -588,7 +589,7 @@ static void *sendPoll(void *ih) | ||
37 | if (likely(CPA_STATUS_SUCCESS == status)) { | ||
38 | /* Do nothing */ | ||
39 | } else if (CPA_STATUS_RETRY == status) { | ||
40 | - pthread_yield(); | ||
41 | + sched_yield(); | ||
42 | } else { | ||
43 | WARN("WARNING icp_sal_CyPollInstance returned status %d\n", | ||
44 | status); | ||
45 | -- | ||
46 | 2.7.4 | ||
47 | |||
diff --git a/common/recipes-extended/openssl-qat/openssl-qat_0.4.9-009.bb b/common/recipes-extended/openssl-qat/openssl-qat_0.4.9-009.bb index f2c479ef..e3d8ccc0 100644 --- a/common/recipes-extended/openssl-qat/openssl-qat_0.4.9-009.bb +++ b/common/recipes-extended/openssl-qat/openssl-qat_0.4.9-009.bb | |||
@@ -7,6 +7,8 @@ SRC_URI += "git://opensslfoundation.com/openssl-async.git;branch=OpenSSL_1_0_1- | |||
7 | file://openssl-qat_0.4.9-009-openssl_qat-add-openssl-async-specific-symbols.patch \ | 7 | file://openssl-qat_0.4.9-009-openssl_qat-add-openssl-async-specific-symbols.patch \ |
8 | " | 8 | " |
9 | 9 | ||
10 | SRC_URI_append_libc-musl = " file://0001-Use_sched_yield_api.patch" | ||
11 | |||
10 | SRC_URI[openssl_qat.md5sum]="8e2b45cf9b345356bdff0956845c6103" | 12 | SRC_URI[openssl_qat.md5sum]="8e2b45cf9b345356bdff0956845c6103" |
11 | SRC_URI[openssl_qat.sha256sum]="c2334b4d1fc8498e06f0554ef155041a6bf441de134cfdd3635e5a449a34bf81" | 13 | SRC_URI[openssl_qat.sha256sum]="c2334b4d1fc8498e06f0554ef155041a6bf441de134cfdd3635e5a449a34bf81" |
12 | 14 | ||