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 : return ff; 32 : : } 33 : : 34 : : int 35 : 0 : cnxk_cpt_eng_grp_add(struct roc_cpt *roc_cpt) 36 : : { 37 : : int ret; 38 : : 39 : 0 : ret = roc_cpt_eng_grp_add(roc_cpt, CPT_ENG_TYPE_SE); 40 [ # # ]: 0 : if (ret < 0) { 41 : 0 : plt_err("Could not add CPT SE engines"); 42 : 0 : return -ENOTSUP; 43 : : } 44 : : 45 [ # # ]: 0 : if (!roc_model_is_cn20k()) { 46 : 0 : ret = roc_cpt_eng_grp_add(roc_cpt, CPT_ENG_TYPE_IE); 47 [ # # ]: 0 : if (ret < 0) { 48 : 0 : plt_err("Could not add CPT IE engines"); 49 : 0 : return -ENOTSUP; 50 : : } 51 : : } 52 : : 53 : 0 : ret = roc_cpt_eng_grp_add(roc_cpt, CPT_ENG_TYPE_AE); 54 [ # # ]: 0 : if (ret < 0) { 55 : 0 : plt_err("Could not add CPT AE engines"); 56 : 0 : return -ENOTSUP; 57 : : } 58 : : 59 : : return 0; 60 : : } 61 : : 62 : : void 63 : 0 : cnxk_cpt_int_misc_cb(struct roc_cpt_lf *lf, __rte_unused void *args) 64 : : { 65 : 0 : struct roc_cpt *roc_cpt = lf->roc_cpt; 66 : : 67 [ # # ]: 0 : if (roc_cpt == NULL) 68 : : return; 69 : : 70 : 0 : rte_cryptodev_pmd_callback_process(roc_cpt->opaque, RTE_CRYPTODEV_EVENT_ERROR); 71 : : }