crypto/cnxk: add ML crypto support
Subsystems (2)
PATCH 1/1 crypto/cnxk: add ML crypto support
Add ML-KEM and ML-DSA support.
--- doc/guides/cryptodevs/features/cn20k.ini | 3 + doc/guides/cryptodevs/features/default.ini | 1 + doc/guides/rel_notes/release_26_07.rst | 3 + drivers/common/cnxk/hw/cpt.h | 1 + drivers/common/cnxk/meson.build | 1 + drivers/common/cnxk/roc_cpt.c | 4 + drivers/common/cnxk/roc_platform.h | 5 + .../common/cnxk/roc_platform_base_symbols.c | 2 + drivers/common/cnxk/roc_re.h | 31 ++ drivers/common/cnxk/roc_re_ml_tables.c | 248 +++++++++++ drivers/common/cnxk/roc_re_ml_tables.h | 19 + drivers/crypto/cnxk/cnxk_ae.h | 399 +++++++++++++++++- drivers/crypto/cnxk/cnxk_cryptodev.c | 11 + drivers/crypto/cnxk/cnxk_cryptodev.h | 4 +- .../crypto/cnxk/cnxk_cryptodev_capabilities.c | 62 ++- drivers/crypto/cnxk/cnxk_cryptodev_ops.c | 45 +- 16 files changed, 817 insertions(+), 22 deletions(-) create mode 100644 drivers/common/cnxk/roc_re.h create mode 100644 drivers/common/cnxk/roc_re_ml_tables.c create mode 100644 drivers/common/cnxk/roc_re_ml_tables.h
doc/guides/cryptodevs/features/cn20k.ini +3 -0
@@ -21,6 +21,7 @@ Asymmetric sessionless = Y Sym raw data path API = Y Inner checksum = Y Rx inject = Y +ML-DSA sign prehash = Y ; ; Supported crypto algorithms of 'cn20k' crypto driver.
@@ -110,6 +111,8 @@ ECDSA = Y ECPM = Y SM2 = Y EdDSA = Y +ML-DSA = Y +ML-KEM = Y ; ; Supported Operating systems of the 'cn20k' crypto driver.
doc/guides/cryptodevs/features/default.ini +1 -0
@@ -35,6 +35,7 @@ Cipher multiple data units = Cipher wrapped key = Inner checksum = Rx inject = +ML-DSA sign prehash = ; ; Supported crypto algorithms of a default crypto driver.
doc/guides/rel_notes/release_26_07.rst +3 -0
@@ -87,6 +87,9 @@ New Features Added AGENTS.md file for AI review and supporting scripts to review patches and documentation. +* **Updated Marvell cnxk crypto driver.** + + * Added support for ML-KEM and ML-DSA on CN20K platform. Removed Items -------------
drivers/common/cnxk/hw/cpt.h +1 -0
@@ -58,6 +58,7 @@ enum cpt_eng_type {CPT_ENG_TYPE_AE =1 ,CPT_ENG_TYPE_SE =2 ,CPT_ENG_TYPE_IE =3 , +CPT_ENG_TYPE_RE =4 , CPT_MAX_ENG_TYPES, };
drivers/common/cnxk/meson.build +1 -0
@@ -65,6 +65,7 @@ sources = files( 'roc_npc_utils.c', 'roc_platform.c', 'roc_platform_base_symbols.c', + 'roc_re_ml_tables.c', 'roc_se.c', 'roc_sso.c', 'roc_sso_debug.c',
drivers/common/cnxk/roc_cpt.c +4 -0
@@ -632,6 +632,9 @@ roc_cpt_dev_configure(struct roc_cpt *roc_cpt, int nb_lf, bool rxc_ena, uint16_t eng_grpmsk = (1 << roc_cpt->eng_grp[CPT_ENG_TYPE_AE ]) | (1 << roc_cpt->eng_grp[CPT_ENG_TYPE_SE ]); +if (roc_model_is_cn20k ()) + eng_grpmsk |= (1 << roc_cpt->eng_grp[CPT_ENG_TYPE_RE ]); +if (roc_errata_cpt_has_ctx_fetch_issue ()) { ctx_ilen_valid = true;/* Inbound SA size is max context size */
@@ -1097,6 +1100,7 @@ roc_cpt_eng_grp_add(struct roc_cpt *roc_cpt, enum cpt_eng_type eng_type)case CPT_ENG_TYPE_AE :case CPT_ENG_TYPE_SE :case CPT_ENG_TYPE_IE : +case CPT_ENG_TYPE_RE :break ;default : ret = -EINVAL ;
drivers/common/cnxk/roc_platform.h +5 -0
@@ -41,6 +41,7 @@ ".arch_extension lse\n"#endif +#define PLT_ATOMIC RTE_ATOMIC#define PLT_ASSERT RTE_ASSERT#define PLT_VERIFY RTE_VERIFY#define PLT_MEMZONE_NAMESIZE RTE_MEMZONE_NAMESIZE
@@ -217,6 +218,10 @@ plt_thread_is_valid(plt_thread_t thr)#define plt_memory_order_release rte_memory_order_release#define plt_memory_order_acquire rte_memory_order_acquire#define plt_memory_order_relaxed rte_memory_order_relaxed +#define plt_memory_order_seq_cst rte_memory_order_seq_cst + +#define plt_atomic_fetch_add_explicit rte_atomic_fetch_add_explicit +#define plt_atomic_fetch_sub_explicit rte_atomic_fetch_sub_explicit#define plt_bit_relaxed_get32 rte_bit_relaxed_get32#define plt_bit_relaxed_set32 rte_bit_relaxed_set32
drivers/common/cnxk/roc_platform_base_symbols.c +2 -0
@@ -497,6 +497,8 @@ RTE_EXPORT_INTERNAL_SYMBOL(roc_npc_aged_flow_ctx_get) RTE_EXPORT_INTERNAL_SYMBOL(roc_npc_defrag_mcam_banks) RTE_EXPORT_INTERNAL_SYMBOL(roc_npc_get_key_type) RTE_EXPORT_INTERNAL_SYMBOL(roc_npc_flow_mcam_dump) +RTE_EXPORT_INTERNAL_SYMBOL(roc_re_ml_zeta_get) +RTE_EXPORT_INTERNAL_SYMBOL(roc_re_ml_zeta_put) RTE_EXPORT_INTERNAL_SYMBOL(roc_ree_queues_attach) RTE_EXPORT_INTERNAL_SYMBOL(roc_ree_queues_detach) RTE_EXPORT_INTERNAL_SYMBOL(roc_ree_msix_offsets_get)
drivers/common/cnxk/roc_re.h new file +31 -0
@@ -0,0 +1,31 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright(C) 2026 Marvell. +*/ + +#ifndef __ROC_RE_H__ +#define __ROC_RE_H__ + +/* RE ML opcodes */ +#define ROC_RE_MAJOR_OP_MLKEM 0x1A +#define ROC_RE_MAJOR_OP_MLDSA 0x1B +#define ROC_RE_MINOR_OP_MLKEM_KEYGEN 0x00 +#define ROC_RE_MINOR_OP_MLKEM_ENCAP 0x01 +#define ROC_RE_MINOR_OP_MLKEM_DECAP 0x02 +#define ROC_RE_MINOR_OP_MLDSA_KEYGEN 0x00 +#define ROC_RE_MINOR_OP_MLDSA_SIGN 0x01 +#define ROC_RE_MINOR_OP_MLDSA_VERIFY 0x02 + +/* ML-KEM param2 fields */ +#define ROC_RE_ML_KEM_PARAM2_INMSG_BIT 4 +#define ROC_RE_ML_KEM_PARAM2_INSEED_BIT 5 + +/* ML-DSA param2 fields */ +#define ROC_RE_ML_DSA_PARAM2_SIGN_BIT 4 +#define ROC_RE_ML_DSA_PARAM2_SEED_BIT 5 +#define ROC_RE_ML_DSA_PARAM2_CTXN_BIT 8 + +/* ML-DSA minor op fields */ +#define ROC_RE_ML_DSA_MINOR_SIGN_TYPE_BIT 2 +#define ROC_RE_ML_DSA_MINOR_MSG_TYPE_BIT 4 + +#endif /* __ROC_RE_H__ */
drivers/common/cnxk/roc_re_ml_tables.c new file +248 -0
248 lines not on this page · raw message
drivers/common/cnxk/roc_re_ml_tables.h new file +19 -0
@@ -0,0 +1,19 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright(C) 2026 Marvell. +*/ + +#ifndef _ROC_RE_ML_TABLES_H_ +#define _ROC_RE_ML_TABLES_H_ + +#include "roc_platform.h" + +enum roc_re_ml_zeta_idx { +ROC_RE_ML_ZETA_IDX_KEM =0 , +ROC_RE_ML_ZETA_IDX_DSA , +ROC_RE_ML_ZETA_IDX_MAX +}; + +int __roc_api roc_re_ml_zeta_get(uint64_t *tbl); +void __roc_api roc_re_ml_zeta_put(void); + +#endif /* _ROC_RE_ML_TABLES_H_ */
drivers/crypto/cnxk/cnxk_ae.h +383 -16
495 lines not on this page · raw message
drivers/crypto/cnxk/cnxk_cryptodev.c +11 -0
@@ -28,6 +28,9 @@ cnxk_cpt_default_ff_get(void)if (roc_model_is_cn10ka_b0 () ||roc_model_is_cn10kb () ||roc_model_is_cn20k ()) ff |=RTE_CRYPTODEV_FF_SECURITY_RX_INJECT ; +if (roc_model_is_cn20k ()) + ff |=RTE_CRYPTODEV_FF_MLDSA_SIGN_PREHASH ; +return ff; }
@@ -56,6 +59,14 @@ cnxk_cpt_eng_grp_add(struct roc_cpt *roc_cpt)return -ENOTSUP ; } +if (roc_model_is_cn20k ()) { + ret =roc_cpt_eng_grp_add (roc_cpt,CPT_ENG_TYPE_RE ); +if (ret <0 ) { +plt_err ("Could not add CPT RE engines" ); +return ret; + } + } +return 0 ; }
drivers/crypto/cnxk/cnxk_cryptodev.h +3 -1
@@ -10,8 +10,9 @@#include "roc_ae.h" #include "roc_cpt.h" +#include "roc_re_ml_tables.h" -#define CNXK_CPT_MAX_CAPS 60 +#define CNXK_CPT_MAX_CAPS 62#define CNXK_SEC_IPSEC_CRYPTO_MAX_CAPS 16#define CNXK_SEC_TLS_1_3_CRYPTO_MAX_CAPS 3#define CNXK_SEC_TLS_1_2_CRYPTO_MAX_CAPS 7
@@ -33,6 +34,7 @@ struct cnxk_cpt_vf { sec_dtls_1_2_crypto_caps[CNXK_SEC_TLS_1_2_CRYPTO_MAX_CAPS ];struct rte_security_capability sec_caps[CNXK_SEC_MAX_CAPS ];uint64_t cnxk_fpm_iova[ROC_AE_EC_ID_PMAX ]; +uint64_t cnxk_ml_iova[ROC_RE_ML_ZETA_IDX_MAX ];struct roc_ae_ec_group *ec_grp[ROC_AE_EC_ID_PMAX ];uint16_t max_qps_limit;uint16_t rx_inject_qp;
drivers/crypto/cnxk/cnxk_cryptodev_capabilities.c +61 -1
77 lines not on this page · raw message
drivers/crypto/cnxk/cnxk_cryptodev_ops.c +41 -4
93 lines not on this page · raw message
Signature · 1 line
2.37.1
drivers/common/cnxk/roc_re_ml_tables.c line 15
Quoted 5 lines · On Fri, 29 May 2026 14:43:26 +0530 Gowrishankar Muthukrishnan…
drivers/common/cnxk/roc_re_ml_tables.c new file +5
-0+/* ML table address and length */ +struct re_ml_entry { +const uint8_t *data; +int len; +};
Better to use unsigned for size like size_t
drivers/common/cnxk/roc_re_ml_tables.c line 22
Quoted 7 lines
drivers/common/cnxk/roc_re_ml_tables.c new file +7
-0+ +struct re_ml_tbl { +PLT_ATOMIC (uint64_t ) refcount; +uint8_t ml_tbl[]; +}; + +const uint8_t re_mlkem_zeta_tbl[RE_MLKEM_ZETA_LEN ] = {
Tables should be local to file so static?
drivers/common/cnxk/roc_re_ml_tables.c line 202
Quoted 5 lines · On Fri, 29 May 2026 14:43:26 +0530 Gowrishankar Muthukrishnan…
drivers/common/cnxk/roc_re_ml_tables.c new file +5
-0+ +int +roc_re_ml_zeta_get (uint64_t *tbl) +{ +int len = (RE_MLKEM_ZETA_LEN +RE_MLDSA_ZETA_LEN );
Unneeded paraens.
Quoted 7 lines
drivers/common/cnxk/roc_re_ml_tables.c new file +7
-0+const char name[] =RE_ML_TBL_NAME ; +const struct plt_memzone *mz; +struct re_ml_tbl *ml; +uint8_t *data; + +if (tbl ==NULL ) +return -EINVAL ;
drivers/common/cnxk/roc_re_ml_tables.c line 219
Quoted 10 lines
drivers/common/cnxk/roc_re_ml_tables.c new file +10
-0+ + mz =plt_memzone_lookup (name); +if (mz ==NULL ) { +/* Create memzone first time */ + mz =plt_memzone_reserve_cache_align (name,sizeof (struct re_ml_tbl ) + len); +if (mz ==NULL ) +return -ENOMEM ; + } + + ml = (struct re_ml_tbl *)mz->addr;
mz->addr is void * so cast here is unnecessary.
Quoted 15 lines
drivers/common/cnxk/roc_re_ml_tables.c new file +13
-0+if (plt_atomic_fetch_add_explicit (&ml->refcount,1 , plt_memory_order_seq_cst) !=0 ) +return 0 ; + + data =PLT_PTR_ADD (mz->addr,sizeof (uint64_t )); +memcpy (data, re_ml_zeta_tbl[0 ].data, re_ml_zeta_tbl[0 ].len); + tbl[0 ] =plt_cpu_to_be_64 ((uintptr_t )data); + + data =PLT_PTR_ADD (data, re_ml_zeta_tbl[0 ].len); +memcpy (data, re_ml_zeta_tbl[1 ].data, re_ml_zeta_tbl[1 ].len); + tbl[1 ] =plt_cpu_to_be_64 ((uintptr_t )data); + +return 0 ; +}
PATCH v2 1/1 crypto/cnxk: add ML crypto support
In reply to Gowrishankar MuthukrishnanAdd ML-KEM and ML-DSA support.
---
v2:
- Addressed comments from v1.
--- doc/guides/cryptodevs/features/cn20k.ini | 3 + doc/guides/cryptodevs/features/default.ini | 1 + doc/guides/rel_notes/release_26_07.rst | 3 + drivers/common/cnxk/hw/cpt.h | 1 + drivers/common/cnxk/meson.build | 1 + drivers/common/cnxk/roc_cpt.c | 4 + drivers/common/cnxk/roc_platform.h | 5 + .../common/cnxk/roc_platform_base_symbols.c | 2 + drivers/common/cnxk/roc_re.h | 31 ++ drivers/common/cnxk/roc_re_ml_tables.c | 248 +++++++++++ drivers/common/cnxk/roc_re_ml_tables.h | 19 + drivers/crypto/cnxk/cnxk_ae.h | 399 +++++++++++++++++- drivers/crypto/cnxk/cnxk_cryptodev.c | 11 + drivers/crypto/cnxk/cnxk_cryptodev.h | 4 +- .../crypto/cnxk/cnxk_cryptodev_capabilities.c | 62 ++- drivers/crypto/cnxk/cnxk_cryptodev_ops.c | 45 +- 16 files changed, 817 insertions(+), 22 deletions(-) create mode 100644 drivers/common/cnxk/roc_re.h create mode 100644 drivers/common/cnxk/roc_re_ml_tables.c create mode 100644 drivers/common/cnxk/roc_re_ml_tables.h
doc/guides/cryptodevs/features/cn20k.ini +3 -0
@@ -21,6 +21,7 @@ Asymmetric sessionless = Y Sym raw data path API = Y Inner checksum = Y Rx inject = Y +ML-DSA sign prehash = Y ; ; Supported crypto algorithms of 'cn20k' crypto driver.
@@ -110,6 +111,8 @@ ECDSA = Y ECPM = Y SM2 = Y EdDSA = Y +ML-DSA = Y +ML-KEM = Y ; ; Supported Operating systems of the 'cn20k' crypto driver.
doc/guides/cryptodevs/features/default.ini +1 -0
@@ -35,6 +35,7 @@ Cipher multiple data units = Cipher wrapped key = Inner checksum = Rx inject = +ML-DSA sign prehash = ; ; Supported crypto algorithms of a default crypto driver.
doc/guides/rel_notes/release_26_07.rst +3 -0
@@ -155,6 +155,9 @@ New Features Added AGENTS.md file for AI review and supporting scripts to review patches and documentation. +* **Updated Marvell cnxk crypto driver.** + + * Added support for ML-KEM and ML-DSA on CN20K platform. Removed Items -------------
drivers/common/cnxk/hw/cpt.h +1 -0
@@ -58,6 +58,7 @@ enum cpt_eng_type {CPT_ENG_TYPE_AE =1 ,CPT_ENG_TYPE_SE =2 ,CPT_ENG_TYPE_IE =3 , +CPT_ENG_TYPE_RE =4 , CPT_MAX_ENG_TYPES, };
drivers/common/cnxk/meson.build +1 -0
@@ -65,6 +65,7 @@ sources = files( 'roc_npc_utils.c', 'roc_platform.c', 'roc_platform_base_symbols.c', + 'roc_re_ml_tables.c', 'roc_se.c', 'roc_sso.c', 'roc_sso_debug.c',
drivers/common/cnxk/roc_cpt.c +4 -0
@@ -632,6 +632,9 @@ roc_cpt_dev_configure(struct roc_cpt *roc_cpt, int nb_lf, bool rxc_ena, uint16_t eng_grpmsk = (1 << roc_cpt->eng_grp[CPT_ENG_TYPE_AE ]) | (1 << roc_cpt->eng_grp[CPT_ENG_TYPE_SE ]); +if (roc_model_is_cn20k ()) + eng_grpmsk |= (1 << roc_cpt->eng_grp[CPT_ENG_TYPE_RE ]); +if (roc_errata_cpt_has_ctx_fetch_issue ()) { ctx_ilen_valid = true;/* Inbound SA size is max context size */
@@ -1097,6 +1100,7 @@ roc_cpt_eng_grp_add(struct roc_cpt *roc_cpt, enum cpt_eng_type eng_type)case CPT_ENG_TYPE_AE :case CPT_ENG_TYPE_SE :case CPT_ENG_TYPE_IE : +case CPT_ENG_TYPE_RE :break ;default : ret = -EINVAL ;
drivers/common/cnxk/roc_platform.h +5 -0
@@ -41,6 +41,7 @@ ".arch_extension lse\n"#endif +#define PLT_ATOMIC RTE_ATOMIC#define PLT_ASSERT RTE_ASSERT#define PLT_VERIFY RTE_VERIFY#define PLT_MEMZONE_NAMESIZE RTE_MEMZONE_NAMESIZE
@@ -218,6 +219,10 @@ plt_thread_is_valid(plt_thread_t thr)#define plt_memory_order_release rte_memory_order_release#define plt_memory_order_acquire rte_memory_order_acquire#define plt_memory_order_relaxed rte_memory_order_relaxed +#define plt_memory_order_seq_cst rte_memory_order_seq_cst + +#define plt_atomic_fetch_add_explicit rte_atomic_fetch_add_explicit +#define plt_atomic_fetch_sub_explicit rte_atomic_fetch_sub_explicit#define plt_bit_relaxed_get32 rte_bit_relaxed_get32#define plt_bit_relaxed_set32 rte_bit_relaxed_set32
drivers/common/cnxk/roc_platform_base_symbols.c +2 -0
@@ -500,6 +500,8 @@ RTE_EXPORT_INTERNAL_SYMBOL(roc_npc_aged_flow_ctx_get) RTE_EXPORT_INTERNAL_SYMBOL(roc_npc_defrag_mcam_banks) RTE_EXPORT_INTERNAL_SYMBOL(roc_npc_get_key_type) RTE_EXPORT_INTERNAL_SYMBOL(roc_npc_flow_mcam_dump) +RTE_EXPORT_INTERNAL_SYMBOL(roc_re_ml_zeta_get) +RTE_EXPORT_INTERNAL_SYMBOL(roc_re_ml_zeta_put) RTE_EXPORT_INTERNAL_SYMBOL(roc_ree_queues_attach) RTE_EXPORT_INTERNAL_SYMBOL(roc_ree_queues_detach) RTE_EXPORT_INTERNAL_SYMBOL(roc_ree_msix_offsets_get)
drivers/common/cnxk/roc_re.h new file +31 -0
@@ -0,0 +1,31 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright(C) 2026 Marvell. +*/ + +#ifndef __ROC_RE_H__ +#define __ROC_RE_H__ + +/* RE ML opcodes */ +#define ROC_RE_MAJOR_OP_MLKEM 0x1A +#define ROC_RE_MAJOR_OP_MLDSA 0x1B +#define ROC_RE_MINOR_OP_MLKEM_KEYGEN 0x00 +#define ROC_RE_MINOR_OP_MLKEM_ENCAP 0x01 +#define ROC_RE_MINOR_OP_MLKEM_DECAP 0x02 +#define ROC_RE_MINOR_OP_MLDSA_KEYGEN 0x00 +#define ROC_RE_MINOR_OP_MLDSA_SIGN 0x01 +#define ROC_RE_MINOR_OP_MLDSA_VERIFY 0x02 + +/* ML-KEM param2 fields */ +#define ROC_RE_ML_KEM_PARAM2_INMSG_BIT 4 +#define ROC_RE_ML_KEM_PARAM2_INSEED_BIT 5 + +/* ML-DSA param2 fields */ +#define ROC_RE_ML_DSA_PARAM2_SIGN_BIT 4 +#define ROC_RE_ML_DSA_PARAM2_SEED_BIT 5 +#define ROC_RE_ML_DSA_PARAM2_CTXN_BIT 8 + +/* ML-DSA minor op fields */ +#define ROC_RE_ML_DSA_MINOR_SIGN_TYPE_BIT 2 +#define ROC_RE_ML_DSA_MINOR_MSG_TYPE_BIT 4 + +#endif /* __ROC_RE_H__ */
drivers/common/cnxk/roc_re_ml_tables.c new file +248 -0
248 lines not on this page · raw message
drivers/common/cnxk/roc_re_ml_tables.h new file +19 -0
@@ -0,0 +1,19 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright(C) 2026 Marvell. +*/ + +#ifndef _ROC_RE_ML_TABLES_H_ +#define _ROC_RE_ML_TABLES_H_ + +#include "roc_platform.h" + +enum roc_re_ml_zeta_idx { +ROC_RE_ML_ZETA_IDX_KEM =0 , +ROC_RE_ML_ZETA_IDX_DSA , +ROC_RE_ML_ZETA_IDX_MAX +}; + +int __roc_api roc_re_ml_zeta_get(uint64_t *tbl); +void __roc_api roc_re_ml_zeta_put(void); + +#endif /* _ROC_RE_ML_TABLES_H_ */
drivers/crypto/cnxk/cnxk_ae.h +383 -16
495 lines not on this page · raw message
drivers/crypto/cnxk/cnxk_cryptodev.c +11 -0
@@ -28,6 +28,9 @@ cnxk_cpt_default_ff_get(void)if (roc_model_is_cn10ka_b0 () ||roc_model_is_cn10kb () ||roc_model_is_cn20k ()) ff |=RTE_CRYPTODEV_FF_SECURITY_RX_INJECT ; +if (roc_model_is_cn20k ()) + ff |=RTE_CRYPTODEV_FF_MLDSA_SIGN_PREHASH ; +return ff; }
@@ -56,6 +59,14 @@ cnxk_cpt_eng_grp_add(struct roc_cpt *roc_cpt)return -ENOTSUP ; } +if (roc_model_is_cn20k ()) { + ret =roc_cpt_eng_grp_add (roc_cpt,CPT_ENG_TYPE_RE ); +if (ret <0 ) { +plt_err ("Could not add CPT RE engines" ); +return ret; + } + } +return 0 ; }
drivers/crypto/cnxk/cnxk_cryptodev.h +3 -1
@@ -10,8 +10,9 @@#include "roc_ae.h" #include "roc_cpt.h" +#include "roc_re_ml_tables.h" -#define CNXK_CPT_MAX_CAPS 60 +#define CNXK_CPT_MAX_CAPS 62#define CNXK_SEC_IPSEC_CRYPTO_MAX_CAPS 16#define CNXK_SEC_TLS_1_3_CRYPTO_MAX_CAPS 3#define CNXK_SEC_TLS_1_2_CRYPTO_MAX_CAPS 7
@@ -33,6 +34,7 @@ struct cnxk_cpt_vf { sec_dtls_1_2_crypto_caps[CNXK_SEC_TLS_1_2_CRYPTO_MAX_CAPS ];struct rte_security_capability sec_caps[CNXK_SEC_MAX_CAPS ];uint64_t cnxk_fpm_iova[ROC_AE_EC_ID_PMAX ]; +uint64_t cnxk_ml_iova[ROC_RE_ML_ZETA_IDX_MAX ];struct roc_ae_ec_group *ec_grp[ROC_AE_EC_ID_PMAX ];uint16_t max_qps_limit;uint16_t rx_inject_qp;
drivers/crypto/cnxk/cnxk_cryptodev_capabilities.c +61 -1
77 lines not on this page · raw message
drivers/crypto/cnxk/cnxk_cryptodev_ops.c +41 -4
93 lines not on this page · raw message
Signature · 1 line
2.37.1
Quoted 21 lines
Subject: [v2]
crypto/cnxk: add ML crypto supportAdd ML-KEM and ML-DSA support.
Signed-off-by Gowrishankar Muthukrishnan <[email protected]>---
v2:
- Addressed comments from v1.--- doc/guides/cryptodevs/features/cn20k.ini | 3 + doc/guides/cryptodevs/features/default.ini | 1 + doc/guides/rel_notes/release_26_07.rst | 3 + drivers/common/cnxk/hw/cpt.h | 1 + drivers/common/cnxk/meson.build | 1 + drivers/common/cnxk/roc_cpt.c | 4 + drivers/common/cnxk/roc_platform.h | 5 + .../common/cnxk/roc_platform_base_symbols.c | 2 + drivers/common/cnxk/roc_re.h | 31 ++ drivers/common/cnxk/roc_re_ml_tables.c | 248 +++++++++++ drivers/common/cnxk/roc_re_ml_tables.h | 19 + drivers/crypto/cnxk/cnxk_ae.h | 399 +++++++++++++++++-
Quoted 8 lines
drivers/crypto/cnxk/cnxk_cryptodev.c | 11 + drivers/crypto/cnxk/cnxk_cryptodev.h | 4 +- .../crypto/cnxk/cnxk_cryptodev_capabilities.c | 62 ++- drivers/crypto/cnxk/cnxk_cryptodev_ops.c | 45 +- 16 files changed, 817 insertions(+), 22 deletions(-) create mode 100644 drivers/common/cnxk/roc_re.h create mode 100644 drivers/common/cnxk/roc_re_ml_tables.c create mode 100644 drivers/common/cnxk/roc_re_ml_tables.h
Applied to dpdk-next-crypto