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 /* Device specific parameters */
66 struct bnxt_ulp_device_params {
67 uint8_t description[16];
68 uint32_t global_fid_enable;
69 enum bnxt_ulp_byte_order byte_order;
70 uint8_t encap_byte_swap;
71 uint32_t lfid_entries;
72 uint32_t lfid_entry_size;
73 uint64_t gfid_entries;
74 uint32_t gfid_entry_size;
76 uint32_t num_resources_per_flow;
80 struct bnxt_ulp_mapper_tbl_list_info {
82 uint32_t start_tbl_idx;
86 struct bnxt_ulp_mapper_class_tbl_info {
87 enum bnxt_ulp_resource_func resource_func;
92 uint8_t srch_b4_alloc;
93 uint32_t critical_resource;
95 /* Information for accessing the ulp_key_field_list */
96 uint32_t key_start_idx;
97 uint16_t key_bit_size;
98 uint16_t key_num_fields;
99 /* Size of the blob that holds the key */
100 uint16_t blob_key_bit_size;
102 /* Information for accessing the ulp_class_result_field_list */
103 uint32_t result_start_idx;
104 uint16_t result_bit_size;
105 uint16_t result_num_fields;
107 /* Information for accessing the ulp_ident_list */
108 uint32_t ident_start_idx;
112 enum bnxt_ulp_regfile_index regfile_wr_idx;
115 struct bnxt_ulp_mapper_act_tbl_info {
116 enum bnxt_ulp_resource_func resource_func;
117 enum tf_tbl_type table_type;
119 uint8_t srch_b4_alloc;
120 uint32_t result_start_idx;
121 uint16_t result_bit_size;
122 uint16_t encap_num_fields;
123 uint16_t result_num_fields;
125 enum bnxt_ulp_regfile_index regfile_wr_idx;
128 struct bnxt_ulp_mapper_class_key_field_info {
130 enum bnxt_ulp_mask_opc mask_opcode;
131 enum bnxt_ulp_spec_opc spec_opcode;
132 uint16_t field_bit_size;
133 uint8_t mask_operand[16];
134 uint8_t spec_operand[16];
137 struct bnxt_ulp_mapper_result_field_info {
139 enum bnxt_ulp_result_opc result_opcode;
140 uint16_t field_bit_size;
141 uint8_t result_operand[16];
144 struct bnxt_ulp_mapper_ident_info {
146 uint32_t resource_func;
149 uint16_t ident_bit_size;
150 uint16_t ident_bit_pos;
151 enum bnxt_ulp_regfile_index regfile_wr_idx;
155 * Flow Mapper Static Data Externs:
156 * Access to the below static data should be done through access functions and
157 * directly throughout the code.
161 * The ulp_device_params is indexed by the dev_id.
162 * This table maintains the device specific parameters.
164 extern struct bnxt_ulp_device_params ulp_device_params[];
167 * The ulp_class_tmpl_list and ulp_act_tmpl_list are indexed by the dev_id
168 * and template id (either class or action) returned by the matcher.
169 * The result provides the start index and number of entries in the connected
170 * ulp_class_tbl_list/ulp_act_tbl_list.
172 extern struct bnxt_ulp_mapper_tbl_list_info ulp_class_tmpl_list[];
173 extern struct bnxt_ulp_mapper_tbl_list_info ulp_act_tmpl_list[];
176 * The ulp_class_tbl_list and ulp_act_tbl_list are indexed based on the results
177 * of the template lists. Each entry describes the high level details of the
178 * table entry to include the start index and number of instructions in the
181 extern struct bnxt_ulp_mapper_class_tbl_info ulp_class_tbl_list[];
182 extern struct bnxt_ulp_mapper_act_tbl_info ulp_act_tbl_list[];
185 * The ulp_class_result_field_list provides the instructions for creating result
186 * records such as tcam/em results.
188 extern struct bnxt_ulp_mapper_result_field_info ulp_class_result_field_list[];
191 * The ulp_data_field_list provides the instructions for creating an action
192 * record. It uses the same structure as the result list, but is only used for
196 struct bnxt_ulp_mapper_result_field_info ulp_act_result_field_list[];
199 * The ulp_act_prop_map_table provides the mapping to index and size of action
200 * tcam and em tables.
203 struct bnxt_ulp_mapper_class_key_field_info ulp_class_key_field_list[];
206 * The ulp_ident_list provides the instructions for creating identifiers such
209 extern struct bnxt_ulp_mapper_ident_info ulp_ident_list[];
212 * The ulp_act_prop_map_table provides the mapping to index and size of action
215 extern uint32_t ulp_act_prop_map_table[];
217 #endif /* _ULP_TEMPLATE_STRUCT_H_ */