Branch data Line data Source code
1 : : /* SPDX-License-Identifier: BSD-3-Clause 2 : : * Copyright(C) 2021 Marvell. 3 : : */ 4 : : 5 : : #include <cryptodev_pmd.h> 6 : : #include <rte_cryptodev.h> 7 : : 8 : : #include "roc_cpt.h" 9 : : #include "roc_model.h" 10 : : 11 : : #include "cnxk_cryptodev.h" 12 : : 13 : : uint64_t 14 [ # # ]: 0 : cnxk_cpt_default_ff_get(void) 15 : : { 16 : : uint64_t ff = RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO | RTE_CRYPTODEV_FF_ASYMMETRIC_CRYPTO | 17 : : RTE_CRYPTODEV_FF_HW_ACCELERATED | RTE_CRYPTODEV_FF_RSA_PRIV_OP_KEY_QT | 18 : : RTE_CRYPTODEV_FF_RSA_PRIV_OP_KEY_EXP | 19 : : RTE_CRYPTODEV_FF_SYM_OPERATION_CHAINING | RTE_CRYPTODEV_FF_IN_PLACE_SGL | 20 : : RTE_CRYPTODEV_FF_OOP_LB_IN_LB_OUT | RTE_CRYPTODEV_FF_OOP_SGL_IN_LB_OUT | 21 : : RTE_CRYPTODEV_FF_OOP_SGL_IN_SGL_OUT | RTE_CRYPTODEV_FF_SYM_SESSIONLESS | 22 : : RTE_CRYPTODEV_FF_DIGEST_ENCRYPTED | RTE_CRYPTODEV_FF_SECURITY | 23 : : RTE_CRYPTODEV_FF_ASYM_SESSIONLESS; 24 : : 25 [ # # # # ]: 0 : if (roc_model_is_cn10k() || roc_model_is_cn20k()) 26 : : ff |= RTE_CRYPTODEV_FF_SECURITY_INNER_CSUM | RTE_CRYPTODEV_FF_SYM_RAW_DP; 27 : : 28 [ # # # # : 0 : if (roc_model_is_cn10ka_b0() || roc_model_is_cn10kb() || roc_model_is_cn20k()) # # ] 29 : 0 : ff |= RTE_CRYPTODEV_FF_SECURITY_RX_INJECT; 30 : : 31 [ # # ]: 0 : if (roc_model_is_cn20k()) 32 : 0 : ff |= RTE_CRYPTODEV_FF_MLDSA_SIGN_PREHASH; 33 : : 34 : 0 : return ff; 35 : : } 36 : : 37 : : int 38 : 0 : cnxk_cpt_eng_grp_add(struct roc_cpt *roc_cpt) 39 : : { 40 : : int ret; 41 : : 42 : 0 : ret = roc_cpt_eng_grp_add(roc_cpt, CPT_ENG_TYPE_SE); 43 [ # # ]: 0 : if (ret < 0) { 44 : 0 : plt_err("Could not add CPT SE engines"); 45 : 0 : return -ENOTSUP; 46 : : } 47 : : 48 [ # # ]: 0 : if (!roc_model_is_cn20k()) { 49 : 0 : ret = roc_cpt_eng_grp_add(roc_cpt, CPT_ENG_TYPE_IE); 50 [ # # ]: 0 : if (ret < 0) { 51 : 0 : plt_err("Could not add CPT IE engines"); 52 : 0 : return -ENOTSUP; 53 : : } 54 : : } 55 : : 56 : 0 : ret = roc_cpt_eng_grp_add(roc_cpt, CPT_ENG_TYPE_AE); 57 [ # # ]: 0 : if (ret < 0) { 58 : 0 : plt_err("Could not add CPT AE engines"); 59 : 0 : return -ENOTSUP; 60 : : } 61 : : 62 [ # # ]: 0 : if (roc_model_is_cn20k()) { 63 : 0 : ret = roc_cpt_eng_grp_add(roc_cpt, CPT_ENG_TYPE_RE); 64 [ # # ]: 0 : if (ret < 0) { 65 : 0 : plt_err("Could not add CPT RE engines"); 66 : 0 : return ret; 67 : : } 68 : : } 69 : : 70 : : return 0; 71 : : } 72 : : 73 : : void 74 : 0 : cnxk_cpt_int_misc_cb(struct roc_cpt_lf *lf, __rte_unused void *args) 75 : : { 76 : 0 : struct roc_cpt *roc_cpt = lf->roc_cpt; 77 : : 78 [ # # ]: 0 : if (roc_cpt == NULL) 79 : : return; 80 : : 81 : 0 : rte_cryptodev_pmd_callback_process(roc_cpt->opaque, RTE_CRYPTODEV_EVENT_ERROR); 82 : : }