net/ice/base: update flag bits
[dpdk.git] / drivers / common / cpt / cpt_mcode_defines.h
index 60be8b3..b7c3feb 100644 (file)
@@ -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_ */