net/mlx5: fix limit of direct rules tables number
[dpdk.git] / drivers / common / cpt / cpt_mcode_defines.h
index 263fc47..c0adbd5 100644 (file)
@@ -18,6 +18,7 @@
 #define CPT_MAJOR_OP_HMAC      0x35
 #define CPT_MAJOR_OP_ZUC_SNOW3G        0x37
 #define CPT_MAJOR_OP_KASUMI    0x38
+#define CPT_MAJOR_OP_MISC      0x01
 
 #define CPT_BYTE_16            16
 #define CPT_BYTE_24            24
@@ -174,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;
@@ -341,6 +357,12 @@ typedef struct fc_params {
 
 } fc_params_t;
 
+/*
+ * Parameters for digest
+ * generate requests
+ * Only src_iov, op, ctx_buf, mac_buf, prep_req
+ * meta_buf, auth_data_len are used for digest gen.
+ */
 typedef struct fc_params digest_params_t;
 
 /* Cipher Algorithms */
@@ -361,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_ */