net/cnxk: support to create meter profile
[dpdk.git] / drivers / common / cnxk / roc_cpt.h
index 9e63073..e84f168 100644 (file)
@@ -16,6 +16,7 @@
 #define ROC_CPT_DFLT_ENG_GRP_AE           2UL
 
 #define ROC_CPT_MAX_LFS 64
+#define ROC_CPT_MAX_BLKS 2
 #define ROC_CN10K_CPT_INST_DW_M1                                               \
        ((uint64_t)(((sizeof(struct cpt_inst_s) / 16) - 1) & 0x7))
 #define ROC_CN10K_TWO_CPT_INST_DW_M1                                           \
 #define ROC_CPT_TUNNEL_IPV4_HDR_LEN 20
 #define ROC_CPT_TUNNEL_IPV6_HDR_LEN 40
 
+#define ROC_CPT_CCM_AAD_DATA 1
+#define ROC_CPT_CCM_MSG_LEN  4
+#define ROC_CPT_CCM_ICV_LEN  16
+#define ROC_CPT_CCM_FLAGS                                                      \
+       ((ROC_CPT_CCM_AAD_DATA << 6) |                                         \
+        (((ROC_CPT_CCM_ICV_LEN - 2) / 2) << 3) | (ROC_CPT_CCM_MSG_LEN - 1))
+#define ROC_CPT_CCM_SALT_LEN 3
+
+enum {
+       ROC_CPT_REVISION_ID_83XX = 0,
+       ROC_CPT_REVISION_ID_96XX_B0 = 1,
+       ROC_CPT_REVISION_ID_96XX_C0 = 2,
+       ROC_CPT_REVISION_ID_98XX = 3,
+       ROC_CPT_REVISION_ID_106XX = 4,
+};
+
 struct roc_cpt_lmtline {
        uint64_t io_addr;
        uint64_t *fc_addr;
@@ -111,6 +128,7 @@ struct roc_cpt {
        /**< CPT device capabilities */
        union cpt_eng_caps hw_caps[CPT_MAX_ENG_TYPES];
        uint8_t eng_grp[CPT_MAX_ENG_TYPES];
+       uint8_t cpt_revision;
 
 #define ROC_CPT_MEM_SZ (6 * 1024)
        uint8_t reserved[ROC_CPT_MEM_SZ] __plt_cache_aligned;
@@ -155,4 +173,6 @@ void __roc_api roc_cpt_iq_enable(struct roc_cpt_lf *lf);
 int __roc_api roc_cpt_lmtline_init(struct roc_cpt *roc_cpt,
                                   struct roc_cpt_lmtline *lmtline, int lf_id);
 
+void __roc_api roc_cpt_parse_hdr_dump(const struct cpt_parse_hdr_s *cpth);
+
 #endif /* _ROC_CPT_H_ */