net/bnxt: support freeing key and action tables
[dpdk.git] / drivers / net / bnxt / tf_ulp / ulp_template_struct.h
index 2b0a3d7..e28d049 100644 (file)
 #include "rte_flow.h"
 #include "tf_core.h"
 
+/* Structure to store the protocol fields */
+#define RTE_PARSER_FLOW_HDR_FIELD_SIZE         16
+struct ulp_rte_hdr_field {
+       uint8_t         spec[RTE_PARSER_FLOW_HDR_FIELD_SIZE];
+       uint8_t         mask[RTE_PARSER_FLOW_HDR_FIELD_SIZE];
+       uint32_t        size;
+};
+
+struct ulp_rte_act_bitmap {
+       uint64_t        bits;
+};
+
 /*
- * structure to hold the action property details
- * It is a array of 128 bytes
+ * Structure to hold the action property details.
+ * It is a array of 128 bytes.
  */
 struct ulp_rte_act_prop {
        uint8_t act_details[BNXT_ULP_ACT_PROP_IDX_LAST];
@@ -39,6 +51,35 @@ struct bnxt_ulp_device_params {
        uint32_t                        num_resources_per_flow;
 };
 
+struct bnxt_ulp_mapper_class_tbl_info {
+       enum bnxt_ulp_resource_func     resource_func;
+       uint32_t        table_type;
+       uint8_t         direction;
+       uint8_t         mem;
+       uint32_t        priority;
+       uint8_t         srch_b4_alloc;
+       uint32_t        critical_resource;
+
+       /* Information for accessing the ulp_key_field_list */
+       uint32_t        key_start_idx;
+       uint16_t        key_bit_size;
+       uint16_t        key_num_fields;
+       /* Size of the blob that holds the key */
+       uint16_t        blob_key_bit_size;
+
+       /* Information for accessing the ulp_class_result_field_list */
+       uint32_t        result_start_idx;
+       uint16_t        result_bit_size;
+       uint16_t        result_num_fields;
+
+       /* Information for accessing the ulp_ident_list */
+       uint32_t        ident_start_idx;
+       uint16_t        ident_nums;
+
+       uint8_t         mark_enable;
+       enum bnxt_ulp_regfile_index     regfile_wr_idx;
+};
+
 struct bnxt_ulp_mapper_act_tbl_info {
        enum bnxt_ulp_resource_func     resource_func;
        enum tf_tbl_type table_type;
@@ -52,6 +93,15 @@ struct bnxt_ulp_mapper_act_tbl_info {
        enum bnxt_ulp_regfile_index     regfile_wr_idx;
 };
 
+struct bnxt_ulp_mapper_class_key_field_info {
+       uint8_t                 name[64];
+       enum bnxt_ulp_mask_opc  mask_opcode;
+       enum bnxt_ulp_spec_opc  spec_opcode;
+       uint16_t                field_bit_size;
+       uint8_t                 mask_operand[16];
+       uint8_t                 spec_operand[16];
+};
+
 struct bnxt_ulp_mapper_result_field_info {
        uint8_t                         name[64];
        enum bnxt_ulp_result_opc        result_opcode;
@@ -59,12 +109,34 @@ struct bnxt_ulp_mapper_result_field_info {
        uint8_t                         result_operand[16];
 };
 
+struct bnxt_ulp_mapper_ident_info {
+       uint8_t         name[64];
+       uint32_t        resource_func;
+
+       uint16_t        ident_type;
+       uint16_t        ident_bit_size;
+       uint16_t        ident_bit_pos;
+       enum bnxt_ulp_regfile_index     regfile_wr_idx;
+};
+
+/*
+ * Flow Mapper Static Data Externs:
+ * Access to the below static data should be done through access functions and
+ * directly throughout the code.
+ */
+
 /*
- * The ulp_device_params is indexed by the dev_id
- * This table maintains the device specific parameters
+ * The ulp_device_params is indexed by the dev_id.
+ * This table maintains the device specific parameters.
  */
 extern struct bnxt_ulp_device_params ulp_device_params[];
 
+/*
+ * The ulp_data_field_list provides the instructions for creating an action
+ * records such as tcam/em results.
+ */
+extern struct bnxt_ulp_mapper_result_field_info        ulp_class_result_field_list[];
+
 /*
  * The ulp_data_field_list provides the instructions for creating an action
  * record.  It uses the same structure as the result list, but is only used for
@@ -73,6 +145,19 @@ extern struct bnxt_ulp_device_params ulp_device_params[];
 extern
 struct bnxt_ulp_mapper_result_field_info ulp_act_result_field_list[];
 
+/*
+ * The ulp_act_prop_map_table provides the mapping to index and size of action
+ * tcam and em tables.
+ */
+extern
+struct bnxt_ulp_mapper_class_key_field_info    ulp_class_key_field_list[];
+
+/*
+ * The ulp_ident_list provides the instructions for creating identifiers such
+ * as profile ids.
+ */
+extern struct bnxt_ulp_mapper_ident_info       ulp_ident_list[];
+
 /*
  * The ulp_act_prop_map_table provides the mapping to index and size of action
  * properties.