lists.linaro.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
List overview
Download
Acc
----- 2024 -----
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
acc@lists.linaro.org
1 participants
111 discussions
Start a n
N
ew thread
[PATCH 09/24] uadk_provider: add aes alg for uadk_provider in openssl3.0
by Zhiqi Song
From: Chenghai Huang <huangchenghai2(a)huawei.com> The following 17 AES algorithms are added: AES-128-CBC AES-192-CBC AES-256-CBC AES-128-ECB AES-192-ECB AES-256-ECB AES-128-XTS AES-256-XTS AES-128-CTR AES-192-CTR AES-256-CTR AES-128-OFB AES-192-OFB AES-256-OFB AES-128-CFB AES-192-CFB AES-256-CFB Signed-off-by: Chenghai Huang <huangchenghai2(a)huawei.com> Signed-off-by: JiangShui Yang <yangjiangshui(a)h-partners.com> --- src/uadk_prov.h | 33 ++++++++++++++++++++++----------- src/uadk_prov_init.c | 26 +++++++++++++++++++++++++- 2 files changed, 47 insertions(+), 12 deletions(-) diff --git a/src/uadk_prov.h b/src/uadk_prov.h index 1b4816e..3655437 100644 --- a/src/uadk_prov.h +++ b/src/uadk_prov.h @@ -128,17 +128,28 @@ extern const OSSL_DISPATCH uadk_sha512_functions[FUNC_MAX_NUM]; extern const OSSL_DISPATCH uadk_sha512_224_functions[FUNC_MAX_NUM]; extern const OSSL_DISPATCH uadk_sha512_256_functions[FUNC_MAX_NUM]; - -extern const OSSL_DISPATCH uadk_aes_128_cbc_functions[]; -extern const OSSL_DISPATCH uadk_aes_192_cbc_functions[]; -extern const OSSL_DISPATCH uadk_aes_256_cbc_functions[]; -extern const OSSL_DISPATCH uadk_aes_128_ecb_functions[]; -extern const OSSL_DISPATCH uadk_aes_192_ecb_functions[]; -extern const OSSL_DISPATCH uadk_aes_256_ecb_functions[]; -extern const OSSL_DISPATCH uadk_aes_128_xts_functions[]; -extern const OSSL_DISPATCH uadk_aes_256_xts_functions[]; -extern const OSSL_DISPATCH uadk_sm4_cbc_functions[]; -extern const OSSL_DISPATCH uadk_sm4_ecb_functions[]; +extern const OSSL_DISPATCH uadk_aes_128_cbc_functions[FUNC_MAX_NUM]; +extern const OSSL_DISPATCH uadk_aes_192_cbc_functions[FUNC_MAX_NUM]; +extern const OSSL_DISPATCH uadk_aes_256_cbc_functions[FUNC_MAX_NUM]; +extern const OSSL_DISPATCH uadk_aes_128_ecb_functions[FUNC_MAX_NUM]; +extern const OSSL_DISPATCH uadk_aes_192_ecb_functions[FUNC_MAX_NUM]; +extern const OSSL_DISPATCH uadk_aes_256_ecb_functions[FUNC_MAX_NUM]; +extern const OSSL_DISPATCH uadk_aes_128_xts_functions[FUNC_MAX_NUM]; +extern const OSSL_DISPATCH uadk_aes_256_xts_functions[FUNC_MAX_NUM]; +extern const OSSL_DISPATCH uadk_aes_128_ctr_functions[FUNC_MAX_NUM]; +extern const OSSL_DISPATCH uadk_aes_192_ctr_functions[FUNC_MAX_NUM]; +extern const OSSL_DISPATCH uadk_aes_256_ctr_functions[FUNC_MAX_NUM]; +extern const OSSL_DISPATCH uadk_aes_128_ofb128_functions[FUNC_MAX_NUM]; +extern const OSSL_DISPATCH uadk_aes_192_ofb128_functions[FUNC_MAX_NUM]; +extern const OSSL_DISPATCH uadk_aes_256_ofb128_functions[FUNC_MAX_NUM]; +extern const OSSL_DISPATCH uadk_aes_128_cfb128_functions[FUNC_MAX_NUM]; +extern const OSSL_DISPATCH uadk_aes_192_cfb128_functions[FUNC_MAX_NUM]; +extern const OSSL_DISPATCH uadk_aes_256_cfb128_functions[FUNC_MAX_NUM]; +extern const OSSL_DISPATCH uadk_sm4_cbc_functions[FUNC_MAX_NUM]; +extern const OSSL_DISPATCH uadk_sm4_ecb_functions[FUNC_MAX_NUM]; +extern const OSSL_DISPATCH uadk_sm4_ofb128_functions[FUNC_MAX_NUM]; +extern const OSSL_DISPATCH uadk_sm4_cfb128_functions[FUNC_MAX_NUM]; +extern const OSSL_DISPATCH uadk_sm4_ctr_functions[FUNC_MAX_NUM]; extern const OSSL_DISPATCH uadk_des_ede3_cbc_functions[]; extern const OSSL_DISPATCH uadk_des_ede3_ecb_functions[]; diff --git a/src/uadk_prov_init.c b/src/uadk_prov_init.c index 52a5da0..05a1b9f 100644 --- a/src/uadk_prov_init.c +++ b/src/uadk_prov_init.c @@ -89,10 +89,34 @@ const OSSL_ALGORITHM uadk_prov_ciphers[] = { uadk_aes_128_xts_functions, "uadk_provider aes-128-xts" }, { "AES-256-XTS", UADK_DEFAULT_PROPERTIES, uadk_aes_256_xts_functions, "uadk_provider aes-256-xts" }, - { "SM4-CBC:SM4", UADK_DEFAULT_PROPERTIES, + { "AES-128-CTR", UADK_DEFAULT_PROPERTIES, + uadk_aes_128_ctr_functions, "uadk_provider aes-128-ctr" }, + { "AES-192-CTR", UADK_DEFAULT_PROPERTIES, + uadk_aes_192_ctr_functions, "uadk_provider aes-192-ctr" }, + { "AES-256-CTR", UADK_DEFAULT_PROPERTIES, + uadk_aes_256_ctr_functions, "uadk_provider aes-256-ctr" }, + { "AES-128-OFB", UADK_DEFAULT_PROPERTIES, + uadk_aes_128_ofb128_functions, "uadk_provider aes-128-ofb" }, + { "AES-192-OFB", UADK_DEFAULT_PROPERTIES, + uadk_aes_192_ofb128_functions, "uadk_provider aes-192-ofb" }, + { "AES-256-OFB", UADK_DEFAULT_PROPERTIES, + uadk_aes_256_ofb128_functions, "uadk_provider aes-256-ofb" }, + { "AES-128-CFB", UADK_DEFAULT_PROPERTIES, + uadk_aes_128_cfb128_functions, "uadk_provider aes-128-cfb" }, + { "AES-192-CFB", UADK_DEFAULT_PROPERTIES, + uadk_aes_192_cfb128_functions, "uadk_provider aes-192-cfb" }, + { "AES-256-CFB", UADK_DEFAULT_PROPERTIES, + uadk_aes_256_cfb128_functions, "uadk_provider aes-256-cfb" }, + { "SM4-CBC", UADK_DEFAULT_PROPERTIES, uadk_sm4_cbc_functions, "uadk_provider sm4-cbc" }, { "SM4-ECB", UADK_DEFAULT_PROPERTIES, uadk_sm4_ecb_functions, "uadk_provider sm4-ecb" }, + { "SM4-OFB", UADK_DEFAULT_PROPERTIES, + uadk_sm4_ofb128_functions, "uadk_provider sm4-ofb" }, + { "SM4-CFB", UADK_DEFAULT_PROPERTIES, + uadk_sm4_cfb128_functions, "uadk_provider sm4-cfb" }, + { "SM4-CTR", UADK_DEFAULT_PROPERTIES, + uadk_sm4_ctr_functions, "uadk_provider sm4-ctr" }, { "DES-EDE3-CBC", UADK_DEFAULT_PROPERTIES, uadk_des_ede3_cbc_functions, "uadk_provider des-ede3-cbc" }, { "DES-EDE3-ECB", UADK_DEFAULT_PROPERTIES, -- 2.33.0
1 week, 6 days
1
0
0
0
[PATCH 00/24] uadk_provider: some algorithm optimization and problem fixing
by Zhiqi Song
From: JiangShui Yang <yangjiangshui(a)h-partners.com> Chenghai Huang (15): uadk_provider: add input pointer length check for digest and cipher uadk_provider: code cleanup for provider bio uadk_provider: add length check for input pointer uadk_provider: add a timeout exit condition to the loop uadk_provider: code cleanup for uadk_provider and uadk_engine uadk_provider: add aes alg for uadk_provider in openssl3.0 uadk_engine: optimized engine update process uadk_provider: fix cipher issue when input len is 0 in decrypto update uadk_provider: fix the set ctx param function for ivlen and pad uadk_provider: fix the key and IV verification methods for cipher init uadk_provider: fix the switch condition issue of soft digest in engine uadk_provider: extract hardware initialization functions to separate functions uadk_provider: modify poll loop exit condition uadk_provider: add aes cts alg to uadk_provider in openssl3.0 uadk_provider: bugfix cipher decryption issue Qi Tao (2): uadk_prov: fix some cleancode issues and bugs for rsa uadk_prov: fix data type conversion errors Wenkai Lin (1): uadk_engine: remove update iv for cipher Zhiqi Song (6): uadk_provider: add openssl ffc library function uadk_provider: reconstructing dh implementation uadk_engine/ecx: merge some similar code logic uadk_engine: fixup pubkey size used in reverse operation uadk_provider/rsa: unify function definitions with macro uadk_provider/pkey: fixup functions with the same name src/Makefile.am | 3 +- src/uadk_async.c | 6 +- src/uadk_cipher.c | 114 +- src/uadk_digest.c | 41 +- src/uadk_ecx.c | 303 ++--- src/uadk_prov.h | 55 +- src/uadk_prov_bio.c | 19 +- src/uadk_prov_bio.h | 2 +- src/uadk_prov_cipher.c | 869 +++++++------ src/uadk_prov_dh.c | 2611 +++++++++++++++++++++------------------- src/uadk_prov_digest.c | 61 +- src/uadk_prov_ffc.c | 1888 +++++++++++++++++++++++++++++ src/uadk_prov_ffc.h | 330 +++++ src/uadk_prov_init.c | 46 +- src/uadk_prov_pkey.h | 114 +- src/uadk_prov_rsa.c | 1134 +++++++---------- src/uadk_prov_sm2.c | 94 +- 17 files changed, 5043 insertions(+), 2647 deletions(-) create mode 100644 src/uadk_prov_ffc.c create mode 100644 src/uadk_prov_ffc.h -- 2.33.0
2 weeks
1
24
0
0
[PATCH RFC 0/8] add heterogeneous computing capabilities to UADK
by Longfang Liu
In the current UADK framework, the hardware acceleration function and the software acceleration function are merged to ensure that the software function of instruction acceleration and the hardware function of hardware offload can run at the same time, thus providing users with stronger performance Under the heterogeneous scheduling mode enabled in the current scheduler, the test performance data is as follows: Alg Mode(1KB) Performance(MB/s) CPU sync async sync async sm4-ecb init1(HW) 454 1322 100% 200.00% init2(HW+CE) 1445.1 1864 100% 195.00% increase 218.30% 41.00% 0.00% -2.50% sm3 init1(HW) 153.1 1481 99% 199.80% init2(HW+CE) 431.5 508 100% 199.80% increase 181.84% -65.70% 0.91% 0.00% ------------------------------------------------------------------------ Alg Mode(8KB) Performance(MB/s) CPU sync async sync async sm4-ecb init1(HW) 1407.5 9092 100% 198.00% init2(HW+CE) 3626.8 6021 100% 199.80% increase 157.68% -33.78% 0.00% 0.91% sm3 init1(HW) 960.4 5161.1 100% 183.80% init2(HW+CE) 549.6 530.1 100% 199.80% increase -42.77% -89.73% -0.40% 8.71% ----------------------------------------------------------------------- Without increasing the CPU usage, the performance improvement of the synchronous mode is very huge. In the asynchronous mode, the performance is reduced because the CPU is used for soft calculations, which can be solved by creating dedicated calculation threads later. Longfang Liu (8): uadk: synchronize internal development code uadk: synchronous interface layer code uadk_tools: synchronous test tool code uadk: new heterogeneous scheduling framework uadk: added heterogeneous computing scheduler uadk: added heterogeneous computing mode uadk: add heterogeneous computing capabilities to UADK driver uadk_tools: enable UADK Tools to support heterogeneous computing Makefile.am | 139 +--- drv/hash_mb/hash_mb.c | 91 ++- drv/hash_mb/hash_mb.h | 3 + drv/hisi_comp.c | 47 +- drv/hisi_dae.c | 32 +- drv/hisi_hpre.c | 358 ++++---- drv/hisi_qm_udrv.c | 93 +-- drv/hisi_qm_udrv.h | 11 +- drv/hisi_sec.c | 223 ++--- drv/isa_ce_sm3.c | 62 +- drv/isa_ce_sm3.h | 3 + drv/isa_ce_sm4.c | 69 +- drv/isa_ce_sm4.h | 5 +- include/drv/wd_comp_drv.h | 3 +- include/drv/wd_digest_drv.h | 3 +- include/wd.h | 21 +- include/wd_aead.h | 1 + include/wd_alg.h | 50 +- include/wd_alg_common.h | 67 +- include/wd_comp.h | 3 +- include/wd_dh.h | 8 +- include/wd_digest.h | 9 +- include/wd_ecc.h | 2 + include/wd_rsa.h | 5 + include/wd_sched.h | 4 + include/wd_util.h | 51 +- uadk_mk.sh | 9 + uadk_tool/Makefile.am | 18 +- uadk_tool/benchmark/hpre_protocol_data.h | 2 +- uadk_tool/benchmark/hpre_uadk_benchmark.c | 40 +- uadk_tool/benchmark/hpre_wd_benchmark.c | 11 +- uadk_tool/benchmark/sec_soft_benchmark.c | 4 - uadk_tool/benchmark/sec_uadk_benchmark.c | 360 +------- uadk_tool/benchmark/sec_wd_benchmark.c | 11 +- uadk_tool/benchmark/trng_wd_benchmark.c | 3 +- uadk_tool/benchmark/uadk_benchmark.c | 32 +- uadk_tool/benchmark/zip_uadk_benchmark.c | 37 +- uadk_tool/benchmark/zip_wd_benchmark.c | 3 +- uadk_tool/uadk_tool.c | 2 +- wd.c | 12 +- wd_aead.c | 38 +- wd_agg.c | 13 +- wd_alg.c | 2 +- wd_cipher.c | 168 ++-- wd_comp.c | 109 +-- wd_dh.c | 32 +- wd_digest.c | 160 ++-- wd_ecc.c | 35 +- wd_mempool.c | 11 +- wd_rsa.c | 88 +- wd_sched.c | 664 ++++++++++++++- wd_util.c | 954 ++++++++++++++++------ wd_zlibwrapper.c | 30 +- 53 files changed, 2470 insertions(+), 1741 deletions(-) create mode 100755 uadk_mk.sh -- 2.24.0
1 month
1
8
0
0
[PATCH v4 0/4] Support SM2 in uadk provider
by Zhiqi Song
Support SM2 in uadk provider and add sanity test for it. v4: Update sanity test, check whether SM2 is supported. v3: Fixup parameter error in sanity test. v2: Fixup compile warning and add sanity test. v1: Support SM2 in uadk provider. Zhiqi Song (4): uadk_provider: add der encode and packet for SM2 uadk_provider: support sm2 hardware acceleration uadk_provider: add sanity test command for SM2 uadk_engine/digest: cleanup pointer type src/Makefile.am | 4 +- src/uadk_digest.c | 2 +- src/uadk_prov.h | 15 +- src/uadk_prov_bio.c | 3 +- src/uadk_prov_der_writer.c | 236 +++ src/uadk_prov_der_writer.h | 129 ++ src/uadk_prov_init.c | 14 +- src/uadk_prov_packet.c | 514 ++++++ src/uadk_prov_packet.h | 959 +++++++++++ src/uadk_prov_pkey.c | 770 +++++++++ src/uadk_prov_pkey.h | 389 +++++ src/uadk_prov_sm2.c | 3127 ++++++++++++++++++++++++++++++++++ test/sanity_test_provider.sh | 32 + 13 files changed, 6186 insertions(+), 8 deletions(-) create mode 100644 src/uadk_prov_der_writer.c create mode 100644 src/uadk_prov_der_writer.h create mode 100644 src/uadk_prov_packet.c create mode 100644 src/uadk_prov_packet.h create mode 100644 src/uadk_prov_pkey.c create mode 100644 src/uadk_prov_pkey.h create mode 100644 src/uadk_prov_sm2.c -- 2.33.0
1 month, 2 weeks
1
4
0
0
[PATCH v3 0/4] Support SM2 in uadk provider
by Zhiqi Song
Support SM2 in uadk provider and add sanity test for it. v3: Fixup parameter error in sanity test. v2: Fixup compile warning and add sanity test. v1: Support SM2 in uadk provider. Zhiqi Song (4): uadk_provider: add der encode and packet for SM2 uadk_provider: support sm2 hardware acceleration uadk_provider: add sanity test command for SM2 uadk_engine/digest: cleanup pointer type src/Makefile.am | 4 +- src/uadk_digest.c | 2 +- src/uadk_prov.h | 15 +- src/uadk_prov_bio.c | 3 +- src/uadk_prov_der_writer.c | 236 +++ src/uadk_prov_der_writer.h | 129 ++ src/uadk_prov_init.c | 14 +- src/uadk_prov_packet.c | 514 ++++++ src/uadk_prov_packet.h | 959 +++++++++++ src/uadk_prov_pkey.c | 770 +++++++++ src/uadk_prov_pkey.h | 389 +++++ src/uadk_prov_sm2.c | 3127 ++++++++++++++++++++++++++++++++++ test/sanity_test_provider.sh | 18 + 13 files changed, 6172 insertions(+), 8 deletions(-) create mode 100644 src/uadk_prov_der_writer.c create mode 100644 src/uadk_prov_der_writer.h create mode 100644 src/uadk_prov_packet.c create mode 100644 src/uadk_prov_packet.h create mode 100644 src/uadk_prov_pkey.c create mode 100644 src/uadk_prov_pkey.h create mode 100644 src/uadk_prov_sm2.c -- 2.33.0
1 month, 3 weeks
1
4
0
0
[PATCH v2 0/4] Fixup compile warning
by Zhiqi Song
This version fixup some compile warning and add sanity test for SM2. Zhiqi Song (4): uadk_provider: add der encode and packet for SM2 uadk_provider: support sm2 hardware acceleration uadk_provider: add sanity test command for SM2 uadk_engine/digest: cleanup pointer type src/Makefile.am | 4 +- src/uadk_digest.c | 2 +- src/uadk_prov.h | 15 +- src/uadk_prov_bio.c | 3 +- src/uadk_prov_der_writer.c | 236 +++ src/uadk_prov_der_writer.h | 129 ++ src/uadk_prov_init.c | 14 +- src/uadk_prov_packet.c | 514 ++++++ src/uadk_prov_packet.h | 959 +++++++++++ src/uadk_prov_pkey.c | 770 +++++++++ src/uadk_prov_pkey.h | 389 +++++ src/uadk_prov_sm2.c | 3127 ++++++++++++++++++++++++++++++++++ test/sanity_test_provider.sh | 18 + 13 files changed, 6172 insertions(+), 8 deletions(-) create mode 100644 src/uadk_prov_der_writer.c create mode 100644 src/uadk_prov_der_writer.h create mode 100644 src/uadk_prov_packet.c create mode 100644 src/uadk_prov_packet.h create mode 100644 src/uadk_prov_pkey.c create mode 100644 src/uadk_prov_pkey.h create mode 100644 src/uadk_prov_sm2.c -- 2.33.0
1 month, 3 weeks
1
4
0
0
[RFC PATCH 0/3] Debugging uadk heterogeneous scheduling function
by Longfang Liu
Based on SEC and ZIP modules. Debugging uadk heterogeneous scheduling function and completing the tasks can perform hardware acceleration and software instruction acceleration at the same time. Longfang Liu (3): uadk: add heterogeneous scheduling solutions uadk: update uadk tool uadk: update uadk scheduler processing Makefile.am | 124 +++--- drv/hisi_sec.c | 20 +- drv/isa_ce_sm4.c | 9 + drv/isa_ce_sm4.h | 5 + include/wd_alg.h | 1 + include/wd_alg_common.h | 13 + include/wd_sched.h | 1 + include/wd_util.h | 15 +- module.mk | 51 +-- test/Makefile.am | 11 +- uadk_tool/Makefile.am | 20 +- uadk_tool/benchmark/sec_uadk_benchmark.c | 527 +--------------------- uadk_tool/benchmark/uadk_benchmark.c | 22 +- uadk_tool/uadk_tool.c | 2 +- wd.c | 1 - wd_cipher.c | 144 +++--- wd_comp.c | 85 ++-- wd_sched.c | 203 +++++++-- wd_util.c | 529 +++++++++++++++++------ 19 files changed, 849 insertions(+), 934 deletions(-) -- 2.33.0
2 months
1
3
0
0
[PATCH 00/12] uadk_provider: add sm2 combined digest support
by Zhiqi Song
From: JiangShui Yang <yangjiangshui(a)h-partners.com> Chenghai Huang (9): uadk_provider: define the err and success return name uadk_provider: add digest single block function for provider uadk_provider: add input pointer check uadk_provider: code cleanup for provider digest uadk_provider: extract Digest info table check function uadk_provider: optimized provider update performance uadk_provider: add sha512_XXX algorithm name processing uadk_provider: fix the uadk_provider digest ctx copy function uadk_engine: optimized engine update process Zhiqi Song (3): uadk_provider: fixup bio problem in provider uadk_provider: add der encode and packet for SM2 uadk_provider: support sm2 hardware acceleration src/Makefile.am | 5 +- src/uadk_digest.c | 44 +- src/uadk_prov.h | 54 +- src/uadk_prov_bio.c | 265 +++ src/uadk_prov_bio.h | 34 + src/uadk_prov_der_writer.c | 236 +++ src/uadk_prov_der_writer.h | 129 ++ src/uadk_prov_digest.c | 352 ++-- src/uadk_prov_init.c | 84 +- src/uadk_prov_packet.c | 514 ++++++ src/uadk_prov_packet.h | 959 +++++++++++ src/uadk_prov_pkey.c | 770 +++++++++ src/uadk_prov_pkey.h | 429 +++++ src/uadk_prov_sm2.c | 3146 ++++++++++++++++++++++++++++++++++++ 14 files changed, 6864 insertions(+), 157 deletions(-) create mode 100644 src/uadk_prov_bio.c create mode 100644 src/uadk_prov_bio.h create mode 100644 src/uadk_prov_der_writer.c create mode 100644 src/uadk_prov_der_writer.h create mode 100644 src/uadk_prov_packet.c create mode 100644 src/uadk_prov_packet.h create mode 100644 src/uadk_prov_pkey.c create mode 100644 src/uadk_prov_pkey.h create mode 100644 src/uadk_prov_sm2.c -- 2.33.0
2 months, 3 weeks
1
12
0
0
[PATCH 01/15] cipher: add ctrl function, used by ASF set numa affinity
by Zhiqi Song
From: wangzengliang <wangzengliang2(a)huawei.com> Signed-off-by: wangzengliang <wangzengliang2(a)huawei.com> Signed-off-by: JiangShui Yang <yangjiangshui(a)h-partners.com> --- src/uadk_cipher.c | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/src/uadk_cipher.c b/src/uadk_cipher.c index b506c22..adcde01 100644 --- a/src/uadk_cipher.c +++ b/src/uadk_cipher.c @@ -67,6 +67,7 @@ struct cipher_priv_ctx { /* Crypto small packet offload threshold */ size_t switch_threshold; bool update_iv; + struct sched_params sched_param; }; struct cipher_info { @@ -690,11 +691,26 @@ static int do_cipher_async(struct cipher_priv_ctx *priv, struct async_op *op) return 1; } +static int uadk_e_cipher_ctrl(EVP_CIPHER_CTX *ctx, int type, int numa_node, void *ptr) +{ + struct cipher_priv_ctx *priv = + (struct cipher_priv_ctx *)EVP_CIPHER_CTX_get_cipher_data(ctx); + + if (unlikely(!priv)) { + fprintf(stderr, "cipher priv ctx is NULL!\n"); + return 0; + } + + priv->sched_param.numa_id = numa_node; + priv->setup.sched_param = (void *)&(priv->sched_param); + return 1; +} + static void uadk_e_ctx_init(EVP_CIPHER_CTX *ctx, struct cipher_priv_ctx *priv) { __u32 cipher_counts = ARRAY_SIZE(cipher_info_table); - struct sched_params params = {0}; - int nid, ret; + struct sched_params *para; + int nid, ret, type; __u32 i; priv->req.iv_bytes = EVP_CIPHER_CTX_iv_length(ctx); @@ -715,14 +731,17 @@ static void uadk_e_ctx_init(EVP_CIPHER_CTX *ctx, struct cipher_priv_ctx *priv) * the cipher algorithm does not distinguish between * encryption and decryption queues */ - params.type = priv->req.op_type; + type = priv->req.op_type; ret = uadk_e_is_env_enabled("cipher"); if (ret) - params.type = 0; + type = 0; /* Use the default numa parameters */ - params.numa_id = -1; - priv->setup.sched_param = ¶ms; + if (priv->setup.sched_param != &priv->sched_param) + uadk_e_cipher_ctrl(ctx, 0, -1, NULL); + + para = (struct sched_params *)priv->setup.sched_param; + para->type = type; if (!priv->sess) { nid = EVP_CIPHER_CTX_nid(ctx); @@ -820,6 +839,7 @@ do { \ !EVP_CIPHER_meth_set_init(uadk_##name, uadk_e_cipher_init) || \ !EVP_CIPHER_meth_set_do_cipher(uadk_##name, uadk_e_do_cipher) || \ !EVP_CIPHER_meth_set_cleanup(uadk_##name, uadk_e_cipher_cleanup) || \ + !EVP_CIPHER_meth_set_ctrl(uadk_##name, uadk_e_cipher_ctrl) || \ !EVP_CIPHER_meth_set_set_asn1_params(uadk_##name, EVP_CIPHER_set_asn1_iv) || \ !EVP_CIPHER_meth_set_get_asn1_params(uadk_##name, EVP_CIPHER_get_asn1_iv)) \ return 0; \ -- 2.33.0
5 months
1
14
0
0
[PATCH 0/4] uadk_engine: some cleanup
by Zhiqi Song
This series of patches are mainly used for cleanup. Zhiqi Song (4): uadk_engine: cleanup code style of async functions cipher: cleanup repeated function invoking digest: add ctx allocation check sm2: add ctx allocation check src/uadk_async.c | 126 ++++++++++++++++++++++------------------------ src/uadk_async.h | 3 ++ src/uadk_cipher.c | 7 ++- src/uadk_digest.c | 2 + src/uadk_sm2.c | 6 ++- 5 files changed, 74 insertions(+), 70 deletions(-) -- 2.33.0
7 months
1
4
0
0
← Newer
1
2
3
4
...
12
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
Results per page:
10
25
50
100
200