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 /* Structure to store the protocol fields */
21 #define RTE_PARSER_FLOW_HDR_FIELD_SIZE 16
22 struct ulp_rte_hdr_field {
23 uint8_t spec[RTE_PARSER_FLOW_HDR_FIELD_SIZE];
24 uint8_t mask[RTE_PARSER_FLOW_HDR_FIELD_SIZE];
28 struct ulp_rte_act_bitmap {
33 * Structure to hold the action property details.
34 * It is a array of 128 bytes.
36 struct ulp_rte_act_prop {
37 uint8_t act_details[BNXT_ULP_ACT_PROP_IDX_LAST];
40 /* Device specific parameters */
41 struct bnxt_ulp_device_params {
42 uint8_t description[16];
43 uint32_t global_fid_enable;
44 enum bnxt_ulp_byte_order byte_order;
45 uint8_t encap_byte_swap;
46 uint32_t lfid_entries;
47 uint32_t lfid_entry_size;
48 uint64_t gfid_entries;
49 uint32_t gfid_entry_size;
51 uint32_t num_resources_per_flow;
54 struct bnxt_ulp_mapper_class_tbl_info {
55 enum bnxt_ulp_resource_func resource_func;
60 uint8_t srch_b4_alloc;
61 uint32_t critical_resource;
63 /* Information for accessing the ulp_key_field_list */
64 uint32_t key_start_idx;
65 uint16_t key_bit_size;
66 uint16_t key_num_fields;
67 /* Size of the blob that holds the key */
68 uint16_t blob_key_bit_size;
70 /* Information for accessing the ulp_class_result_field_list */
71 uint32_t result_start_idx;
72 uint16_t result_bit_size;
73 uint16_t result_num_fields;
75 /* Information for accessing the ulp_ident_list */
76 uint32_t ident_start_idx;
80 enum bnxt_ulp_regfile_index regfile_wr_idx;
83 struct bnxt_ulp_mapper_act_tbl_info {
84 enum bnxt_ulp_resource_func resource_func;
85 enum tf_tbl_type table_type;
87 uint8_t srch_b4_alloc;
88 uint32_t result_start_idx;
89 uint16_t result_bit_size;
90 uint16_t encap_num_fields;
91 uint16_t result_num_fields;
93 enum bnxt_ulp_regfile_index regfile_wr_idx;
96 struct bnxt_ulp_mapper_class_key_field_info {
98 enum bnxt_ulp_mask_opc mask_opcode;
99 enum bnxt_ulp_spec_opc spec_opcode;
100 uint16_t field_bit_size;
101 uint8_t mask_operand[16];
102 uint8_t spec_operand[16];
105 struct bnxt_ulp_mapper_result_field_info {
107 enum bnxt_ulp_result_opc result_opcode;
108 uint16_t field_bit_size;
109 uint8_t result_operand[16];
112 struct bnxt_ulp_mapper_ident_info {
114 uint32_t resource_func;
117 uint16_t ident_bit_size;
118 uint16_t ident_bit_pos;
119 enum bnxt_ulp_regfile_index regfile_wr_idx;
123 * Flow Mapper Static Data Externs:
124 * Access to the below static data should be done through access functions and
125 * directly throughout the code.
129 * The ulp_device_params is indexed by the dev_id.
130 * This table maintains the device specific parameters.
132 extern struct bnxt_ulp_device_params ulp_device_params[];
135 * The ulp_data_field_list provides the instructions for creating an action
136 * records such as tcam/em results.
138 extern struct bnxt_ulp_mapper_result_field_info ulp_class_result_field_list[];
141 * The ulp_data_field_list provides the instructions for creating an action
142 * record. It uses the same structure as the result list, but is only used for
146 struct bnxt_ulp_mapper_result_field_info ulp_act_result_field_list[];
149 * The ulp_act_prop_map_table provides the mapping to index and size of action
150 * tcam and em tables.
153 struct bnxt_ulp_mapper_class_key_field_info ulp_class_key_field_list[];
156 * The ulp_ident_list provides the instructions for creating identifiers such
159 extern struct bnxt_ulp_mapper_ident_info ulp_ident_list[];
162 * The ulp_act_prop_map_table provides the mapping to index and size of action
165 extern uint32_t ulp_act_prop_map_table[];
167 #endif /* _ULP_TEMPLATE_STRUCT_H_ */