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 ulp_rte_act_bitmap {
37 * Structure to hold the action property details.
38 * It is a array of 128 bytes.
40 struct ulp_rte_act_prop {
41 uint8_t act_details[BNXT_ULP_ACT_PROP_IDX_LAST];
44 /* Device specific parameters */
45 struct bnxt_ulp_device_params {
46 uint8_t description[16];
47 uint32_t global_fid_enable;
48 enum bnxt_ulp_byte_order byte_order;
49 uint8_t encap_byte_swap;
50 uint32_t lfid_entries;
51 uint32_t lfid_entry_size;
52 uint64_t gfid_entries;
53 uint32_t gfid_entry_size;
55 uint32_t num_resources_per_flow;
59 struct bnxt_ulp_mapper_tbl_list_info {
61 uint32_t start_tbl_idx;
65 struct bnxt_ulp_mapper_class_tbl_info {
66 enum bnxt_ulp_resource_func resource_func;
71 uint8_t srch_b4_alloc;
72 uint32_t critical_resource;
74 /* Information for accessing the ulp_key_field_list */
75 uint32_t key_start_idx;
76 uint16_t key_bit_size;
77 uint16_t key_num_fields;
78 /* Size of the blob that holds the key */
79 uint16_t blob_key_bit_size;
81 /* Information for accessing the ulp_class_result_field_list */
82 uint32_t result_start_idx;
83 uint16_t result_bit_size;
84 uint16_t result_num_fields;
86 /* Information for accessing the ulp_ident_list */
87 uint32_t ident_start_idx;
91 enum bnxt_ulp_regfile_index regfile_wr_idx;
94 struct bnxt_ulp_mapper_act_tbl_info {
95 enum bnxt_ulp_resource_func resource_func;
96 enum tf_tbl_type table_type;
98 uint8_t srch_b4_alloc;
99 uint32_t result_start_idx;
100 uint16_t result_bit_size;
101 uint16_t encap_num_fields;
102 uint16_t result_num_fields;
104 enum bnxt_ulp_regfile_index regfile_wr_idx;
107 struct bnxt_ulp_mapper_class_key_field_info {
109 enum bnxt_ulp_mask_opc mask_opcode;
110 enum bnxt_ulp_spec_opc spec_opcode;
111 uint16_t field_bit_size;
112 uint8_t mask_operand[16];
113 uint8_t spec_operand[16];
116 struct bnxt_ulp_mapper_result_field_info {
118 enum bnxt_ulp_result_opc result_opcode;
119 uint16_t field_bit_size;
120 uint8_t result_operand[16];
123 struct bnxt_ulp_mapper_ident_info {
125 uint32_t resource_func;
128 uint16_t ident_bit_size;
129 uint16_t ident_bit_pos;
130 enum bnxt_ulp_regfile_index regfile_wr_idx;
134 * Flow Mapper Static Data Externs:
135 * Access to the below static data should be done through access functions and
136 * directly throughout the code.
140 * The ulp_device_params is indexed by the dev_id.
141 * This table maintains the device specific parameters.
143 extern struct bnxt_ulp_device_params ulp_device_params[];
146 * The ulp_class_tmpl_list and ulp_act_tmpl_list are indexed by the dev_id
147 * and template id (either class or action) returned by the matcher.
148 * The result provides the start index and number of entries in the connected
149 * ulp_class_tbl_list/ulp_act_tbl_list.
151 extern struct bnxt_ulp_mapper_tbl_list_info ulp_class_tmpl_list[];
152 extern struct bnxt_ulp_mapper_tbl_list_info ulp_act_tmpl_list[];
155 * The ulp_class_tbl_list and ulp_act_tbl_list are indexed based on the results
156 * of the template lists. Each entry describes the high level details of the
157 * table entry to include the start index and number of instructions in the
160 extern struct bnxt_ulp_mapper_class_tbl_info ulp_class_tbl_list[];
161 extern struct bnxt_ulp_mapper_act_tbl_info ulp_act_tbl_list[];
164 * The ulp_class_result_field_list provides the instructions for creating result
165 * records such as tcam/em results.
167 extern struct bnxt_ulp_mapper_result_field_info ulp_class_result_field_list[];
170 * The ulp_data_field_list provides the instructions for creating an action
171 * record. It uses the same structure as the result list, but is only used for
175 struct bnxt_ulp_mapper_result_field_info ulp_act_result_field_list[];
178 * The ulp_act_prop_map_table provides the mapping to index and size of action
179 * tcam and em tables.
182 struct bnxt_ulp_mapper_class_key_field_info ulp_class_key_field_list[];
185 * The ulp_ident_list provides the instructions for creating identifiers such
188 extern struct bnxt_ulp_mapper_ident_info ulp_ident_list[];
191 * The ulp_act_prop_map_table provides the mapping to index and size of action
194 extern uint32_t ulp_act_prop_map_table[];
196 #endif /* _ULP_TEMPLATE_STRUCT_H_ */