1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2014-2019 Broadcom
6 #ifndef _ULP_TEMPLATE_STRUCT_H_
7 #define _ULP_TEMPLATE_STRUCT_H_
10 #include "rte_ether.h"
20 struct ulp_rte_hdr_bitmap {
24 /* Structure to store the protocol fields */
25 #define RTE_PARSER_FLOW_HDR_FIELD_SIZE 16
26 struct ulp_rte_hdr_field {
27 uint8_t spec[RTE_PARSER_FLOW_HDR_FIELD_SIZE];
28 uint8_t mask[RTE_PARSER_FLOW_HDR_FIELD_SIZE];
32 struct bnxt_ulp_matcher_field_info {
33 enum bnxt_ulp_fmf_mask mask_opcode;
34 enum bnxt_ulp_fmf_spec spec_opcode;
37 struct ulp_rte_act_bitmap {
42 * Structure to hold the action property details.
43 * It is a array of 128 bytes.
45 struct ulp_rte_act_prop {
46 uint8_t act_details[BNXT_ULP_ACT_PROP_IDX_LAST];
49 /* Flow Matcher structures */
50 struct bnxt_ulp_header_match_info {
51 struct ulp_rte_hdr_bitmap hdr_bitmap;
54 uint32_t class_tmpl_id;
58 /* Flow Matcher templates Structure Array defined in template source*/
59 extern struct bnxt_ulp_header_match_info ulp_ingress_hdr_match_list[];
60 extern struct bnxt_ulp_header_match_info ulp_egress_hdr_match_list[];
62 /* Flow field match Information Structure Array defined in template source*/
63 extern struct bnxt_ulp_matcher_field_info ulp_field_match[];
65 /* Flow Matcher Action structures */
66 struct bnxt_ulp_action_match_info {
67 struct ulp_rte_act_bitmap act_bitmap;
71 /* Flow Matcher templates Structure Array defined in template source */
72 extern struct bnxt_ulp_action_match_info ulp_ingress_act_match_list[];
73 extern struct bnxt_ulp_action_match_info ulp_egress_act_match_list[];
75 /* Device specific parameters */
76 struct bnxt_ulp_device_params {
77 uint8_t description[16];
78 uint32_t global_fid_enable;
79 enum bnxt_ulp_byte_order byte_order;
80 uint8_t encap_byte_swap;
81 uint32_t lfid_entries;
82 uint32_t lfid_entry_size;
83 uint64_t gfid_entries;
84 uint32_t gfid_entry_size;
86 uint32_t num_resources_per_flow;
90 struct bnxt_ulp_mapper_tbl_list_info {
92 uint32_t start_tbl_idx;
96 struct bnxt_ulp_mapper_class_tbl_info {
97 enum bnxt_ulp_resource_func resource_func;
102 uint8_t srch_b4_alloc;
103 uint32_t critical_resource;
105 /* Information for accessing the ulp_key_field_list */
106 uint32_t key_start_idx;
107 uint16_t key_bit_size;
108 uint16_t key_num_fields;
109 /* Size of the blob that holds the key */
110 uint16_t blob_key_bit_size;
112 /* Information for accessing the ulp_class_result_field_list */
113 uint32_t result_start_idx;
114 uint16_t result_bit_size;
115 uint16_t result_num_fields;
117 /* Information for accessing the ulp_ident_list */
118 uint32_t ident_start_idx;
122 enum bnxt_ulp_regfile_index regfile_wr_idx;
125 struct bnxt_ulp_mapper_act_tbl_info {
126 enum bnxt_ulp_resource_func resource_func;
127 enum tf_tbl_type table_type;
129 uint8_t srch_b4_alloc;
130 uint32_t result_start_idx;
131 uint16_t result_bit_size;
132 uint16_t encap_num_fields;
133 uint16_t result_num_fields;
135 enum bnxt_ulp_regfile_index regfile_wr_idx;
138 struct bnxt_ulp_mapper_class_key_field_info {
140 enum bnxt_ulp_mask_opc mask_opcode;
141 enum bnxt_ulp_spec_opc spec_opcode;
142 uint16_t field_bit_size;
143 uint8_t mask_operand[16];
144 uint8_t spec_operand[16];
147 struct bnxt_ulp_mapper_result_field_info {
149 enum bnxt_ulp_result_opc result_opcode;
150 uint16_t field_bit_size;
151 uint8_t result_operand[16];
154 struct bnxt_ulp_mapper_ident_info {
156 uint32_t resource_func;
159 uint16_t ident_bit_size;
160 uint16_t ident_bit_pos;
161 enum bnxt_ulp_regfile_index regfile_wr_idx;
165 * Flow Mapper Static Data Externs:
166 * Access to the below static data should be done through access functions and
167 * directly throughout the code.
171 * The ulp_device_params is indexed by the dev_id.
172 * This table maintains the device specific parameters.
174 extern struct bnxt_ulp_device_params ulp_device_params[];
177 * The ulp_class_tmpl_list and ulp_act_tmpl_list are indexed by the dev_id
178 * and template id (either class or action) returned by the matcher.
179 * The result provides the start index and number of entries in the connected
180 * ulp_class_tbl_list/ulp_act_tbl_list.
182 extern struct bnxt_ulp_mapper_tbl_list_info ulp_class_tmpl_list[];
183 extern struct bnxt_ulp_mapper_tbl_list_info ulp_act_tmpl_list[];
186 * The ulp_class_tbl_list and ulp_act_tbl_list are indexed based on the results
187 * of the template lists. Each entry describes the high level details of the
188 * table entry to include the start index and number of instructions in the
191 extern struct bnxt_ulp_mapper_class_tbl_info ulp_class_tbl_list[];
192 extern struct bnxt_ulp_mapper_act_tbl_info ulp_act_tbl_list[];
195 * The ulp_class_result_field_list provides the instructions for creating result
196 * records such as tcam/em results.
198 extern struct bnxt_ulp_mapper_result_field_info ulp_class_result_field_list[];
201 * The ulp_data_field_list provides the instructions for creating an action
202 * record. It uses the same structure as the result list, but is only used for
206 struct bnxt_ulp_mapper_result_field_info ulp_act_result_field_list[];
209 * The ulp_act_prop_map_table provides the mapping to index and size of action
210 * tcam and em tables.
213 struct bnxt_ulp_mapper_class_key_field_info ulp_class_key_field_list[];
216 * The ulp_ident_list provides the instructions for creating identifiers such
219 extern struct bnxt_ulp_mapper_ident_info ulp_ident_list[];
222 * The ulp_act_prop_map_table provides the mapping to index and size of action
225 extern uint32_t ulp_act_prop_map_table[];
227 #endif /* _ULP_TEMPLATE_STRUCT_H_ */