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