X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fcommon%2Fcpt%2Fcpt_mcode_defines.h;h=b7c3feb24b53a1d4c113dc67e1351e47e7d058f1;hb=7b6b3886defc3549190d4fc963705b88d219820c;hp=60be8b3553b088cc43283a2ab47521c8b849a7d3;hpb=351fbee2198641ecbcb45869df8378b7c5335fff;p=dpdk.git diff --git a/drivers/common/cpt/cpt_mcode_defines.h b/drivers/common/cpt/cpt_mcode_defines.h index 60be8b3553..b7c3feb24b 100644 --- a/drivers/common/cpt/cpt_mcode_defines.h +++ b/drivers/common/cpt/cpt_mcode_defines.h @@ -175,6 +175,21 @@ typedef enum { ERR_ENODEV, } mc_error_code_t; +/** + * Enumeration cpt_comp_e + * + * CPT Completion Enumeration + * Enumerates the values of CPT_RES_S[COMPCODE]. + */ +typedef enum { + CPT_8X_COMP_E_NOTDONE = (0x00), + CPT_8X_COMP_E_GOOD = (0x01), + CPT_8X_COMP_E_FAULT = (0x02), + CPT_8X_COMP_E_SWERR = (0x03), + CPT_8X_COMP_E_HWERR = (0x04), + CPT_8X_COMP_E_LAST_ENTRY = (0xFF) +} cpt_comp_e_t; + typedef struct sglist_comp { union { uint64_t len; @@ -288,8 +303,8 @@ struct cpt_ctx { uint64_t hmac :1; uint64_t zsk_flags :3; uint64_t k_ecb :1; - uint64_t snow3g :1; - uint64_t rsvd :22; + uint64_t snow3g :2; + uint64_t rsvd :21; /* Below fields are accessed by hardware */ union { mc_fc_context_t fctx; @@ -368,4 +383,16 @@ typedef mc_hash_type_t auth_type_t; #define SESS_PRIV(__sess) \ (void *)((uint8_t *)__sess + sizeof(struct cpt_sess_misc)) +/* + * Get the session size + * + * @return + * - session size + */ +static __rte_always_inline unsigned int +cpt_get_session_size(void) +{ + unsigned int ctx_len = sizeof(struct cpt_ctx); + return (sizeof(struct cpt_sess_misc) + RTE_ALIGN_CEIL(ctx_len, 8)); +} #endif /* _CPT_MCODE_DEFINES_H_ */