net/bnxt: add TCAM table processing for search and alloc
[dpdk.git] / drivers / net / bnxt / tf_ulp / ulp_template_struct.h
index a3ddd33..6617ab9 100644 (file)
 #define BNXT_ULP_PROTO_HDR_MAX         128
 #define BNXT_ULP_PROTO_HDR_FIELD_SVIF_IDX      0
 
+/* Direction attributes */
+#define BNXT_ULP_FLOW_ATTR_TRANSFER    0x1
+#define BNXT_ULP_FLOW_ATTR_INGRESS     0x2
+#define BNXT_ULP_FLOW_ATTR_EGRESS      0x4
+
 struct ulp_rte_hdr_bitmap {
        uint64_t        bits;
 };
@@ -58,6 +63,7 @@ struct ulp_rte_act_prop {
 /* Structure to be used for passing all the parser functions */
 struct ulp_rte_parser_params {
        struct ulp_rte_hdr_bitmap       hdr_bitmap;
+       struct ulp_rte_hdr_bitmap       hdr_fp_bit;
        struct ulp_rte_field_bitmap     fld_bitmap;
        struct ulp_rte_hdr_field        hdr_field[BNXT_ULP_PROTO_HDR_MAX];
        uint32_t                        comp_fld[BNXT_ULP_CF_IDX_LAST];
@@ -65,7 +71,7 @@ struct ulp_rte_parser_params {
        uint32_t                        vlan_idx;
        struct ulp_rte_act_bitmap       act_bitmap;
        struct ulp_rte_act_prop         act_prop;
-       uint32_t                        dir;
+       uint32_t                        dir_attr;
        struct bnxt_ulp_context         *ulp_ctx;
 };
 
@@ -146,6 +152,11 @@ struct bnxt_ulp_device_params {
        uint64_t                        flow_db_num_entries;
        uint32_t                        flow_count_db_entries;
        uint32_t                        num_resources_per_flow;
+       uint32_t                        ext_cntr_table_type;
+       uint64_t                        byte_count_mask;
+       uint64_t                        packet_count_mask;
+       uint32_t                        byte_count_shift;
+       uint32_t                        packet_count_shift;
 };
 
 /* Flow Mapper */
@@ -160,10 +171,12 @@ struct bnxt_ulp_mapper_tbl_info {
        enum bnxt_ulp_resource_func     resource_func;
        uint32_t                        resource_type; /* TF_ enum type */
        enum bnxt_ulp_resource_sub_type resource_sub_type;
-       uint8_t         direction;
-       uint32_t        priority;
-       uint8_t         srch_b4_alloc;
-       enum bnxt_ulp_critical_resource critical_resource;
+       enum bnxt_ulp_cond_opcode       cond_opcode;
+       uint32_t                        cond_operand;
+       uint8_t                         direction;
+       uint32_t                        priority;
+       enum bnxt_ulp_search_before_alloc       srch_b4_alloc;
+       enum bnxt_ulp_critical_resource         critical_resource;
 
        /* Information for accessing the ulp_key_field_list */
        uint32_t        key_start_idx;
@@ -201,6 +214,8 @@ struct bnxt_ulp_mapper_result_field_info {
        enum bnxt_ulp_mapper_opc        result_opcode;
        uint16_t                        field_bit_size;
        uint8_t                         result_operand[16];
+       uint8_t                         result_operand_true[16];
+       uint8_t                         result_operand_false[16];
 };
 
 struct bnxt_ulp_mapper_ident_info {
@@ -299,4 +314,10 @@ extern struct bnxt_ulp_glb_resource_info ulp_glb_resource_tbl[];
  */
 extern struct bnxt_ulp_cache_tbl_params ulp_cache_tbl_params[];
 
+/*
+ * The ulp_global template table is used to initialize default entries
+ * that could be reused by other templates.
+ */
+extern uint32_t ulp_glb_template_tbl[];
+
 #endif /* _ULP_TEMPLATE_STRUCT_H_ */