net/bnxt: reorganize ULP template directory structure
[dpdk.git] / drivers / net / bnxt / tf_ulp / generic_templates / ulp_template_db_thor_act.c
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2014-2021 Broadcom
3  * All rights reserved.
4  */
5
6 /* date: Mon Apr  5 11:35:38 2021 */
7
8 #include "ulp_template_db_enum.h"
9 #include "ulp_template_db_field.h"
10 #include "ulp_template_struct.h"
11 #include "ulp_template_db_tbl.h"
12
13 /* Mapper templates for header act list */
14 struct bnxt_ulp_mapper_tmpl_info ulp_thor_act_tmpl_list[] = {
15         /* act_tid: 1, thor, ingress */
16         [1] = {
17         .device_name = BNXT_ULP_DEVICE_ID_THOR,
18         .num_tbls = 2,
19         .start_tbl_idx = 0,
20         .reject_info = {
21                 .cond_list_opcode = BNXT_ULP_COND_LIST_OPC_FALSE,
22                 .cond_start_idx = 0,
23                 .cond_nums = 0 }
24         }
25 };
26
27 struct bnxt_ulp_mapper_tbl_info ulp_thor_act_tbl_list[] = {
28         { /* act_tid: 1, thor, table: int_flow_counter_tbl.0 */
29         .resource_func = BNXT_ULP_RESOURCE_FUNC_INDEX_TABLE,
30         .resource_type = TF_TBL_TYPE_ACT_STATS_64,
31         .resource_sub_type =
32                 BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TABLE_INT_COUNT,
33         .direction = TF_DIR_RX,
34         .execute_info = {
35                 .cond_true_goto  = 1,
36                 .cond_false_goto = 1,
37                 .cond_list_opcode = BNXT_ULP_COND_LIST_OPC_AND,
38                 .cond_start_idx = 0,
39                 .cond_nums = 1 },
40         .tbl_opcode = BNXT_ULP_INDEX_TBL_OPC_ALLOC_REGFILE,
41         .tbl_operand = BNXT_ULP_RF_IDX_FLOW_CNTR_PTR_0,
42         .fdb_opcode = BNXT_ULP_FDB_OPC_PUSH_FID,
43         .mark_db_opcode = BNXT_ULP_MARK_DB_OPC_NOP,
44         .byte_order = BNXT_ULP_BYTE_ORDER_LE,
45         .result_start_idx = 0,
46         .result_bit_size = 64,
47         .result_num_fields = 1
48         },
49         { /* act_tid: 1, thor, table: int_full_act_record.0 */
50         .resource_func = BNXT_ULP_RESOURCE_FUNC_INDEX_TABLE,
51         .resource_type = TF_TBL_TYPE_FULL_ACT_RECORD,
52         .resource_sub_type =
53                 BNXT_ULP_RESOURCE_SUB_TYPE_INDEX_TABLE_NORMAL,
54         .direction = TF_DIR_RX,
55         .execute_info = {
56                 .cond_true_goto  = 0,
57                 .cond_false_goto = 0,
58                 .cond_list_opcode = BNXT_ULP_COND_LIST_OPC_TRUE,
59                 .cond_start_idx = 1,
60                 .cond_nums = 0 },
61         .tbl_opcode = BNXT_ULP_INDEX_TBL_OPC_ALLOC_WR_REGFILE,
62         .tbl_operand = BNXT_ULP_RF_IDX_MAIN_ACTION_PTR,
63         .fdb_opcode = BNXT_ULP_FDB_OPC_PUSH_FID,
64         .mark_db_opcode = BNXT_ULP_MARK_DB_OPC_NOP,
65         .byte_order = BNXT_ULP_BYTE_ORDER_LE,
66         .result_start_idx = 1,
67         .result_bit_size = 128,
68         .result_num_fields = 17
69         }
70 };
71
72 struct bnxt_ulp_mapper_cond_info ulp_thor_act_cond_list[] = {
73         /* cond_execute: act_tid: 1, int_flow_counter_tbl.0 */
74         {
75         .cond_opcode = BNXT_ULP_COND_OPC_ACT_BIT_IS_SET,
76         .cond_operand = BNXT_ULP_ACT_BIT_COUNT
77         }
78 };
79
80 struct bnxt_ulp_mapper_field_info ulp_thor_act_result_field_list[] = {
81         /* act_tid: 1, thor, table: int_flow_counter_tbl.0 */
82         {
83         .description = "count",
84         .field_bit_size = 64,
85         .field_opc = BNXT_ULP_FIELD_OPC_SRC1,
86         .field_src1 = BNXT_ULP_FIELD_SRC_ZERO
87         },
88         /* act_tid: 1, thor, table: int_full_act_record.0 */
89         {
90         .description = "sp_rec_ptr",
91         .field_bit_size = 16,
92         .field_opc = BNXT_ULP_FIELD_OPC_SRC1,
93         .field_src1 = BNXT_ULP_FIELD_SRC_ZERO
94         },
95         {
96         .description = "encap_ptr",
97         .field_bit_size = 16,
98         .field_opc = BNXT_ULP_FIELD_OPC_SRC1,
99         .field_src1 = BNXT_ULP_FIELD_SRC_ZERO
100         },
101         {
102         .description = "mod_rec_ptr",
103         .field_bit_size = 16,
104         .field_opc = BNXT_ULP_FIELD_OPC_SRC1,
105         .field_src1 = BNXT_ULP_FIELD_SRC_ZERO
106         },
107         {
108         .description = "rsvd1",
109         .field_bit_size = 16,
110         .field_opc = BNXT_ULP_FIELD_OPC_SRC1,
111         .field_src1 = BNXT_ULP_FIELD_SRC_ZERO
112         },
113         {
114         .description = "rsvd0",
115         .field_bit_size = 8,
116         .field_opc = BNXT_ULP_FIELD_OPC_SRC1,
117         .field_src1 = BNXT_ULP_FIELD_SRC_ZERO
118         },
119         {
120         .description = "decap_func",
121         .field_bit_size = 5,
122         .field_opc = BNXT_ULP_FIELD_OPC_SRC1,
123         .field_src1 = BNXT_ULP_FIELD_SRC_ZERO
124         },
125         {
126         .description = "meter",
127         .field_bit_size = 10,
128         .field_opc = BNXT_ULP_FIELD_OPC_SRC1,
129         .field_src1 = BNXT_ULP_FIELD_SRC_ZERO
130         },
131         {
132         .description = "stats_op",
133         .field_bit_size = 1,
134         .field_opc = BNXT_ULP_FIELD_OPC_SRC1,
135         .field_src1 = BNXT_ULP_FIELD_SRC_ZERO
136         },
137         {
138         .description = "stats_ptr",
139         .field_bit_size = 16,
140         .field_opc = BNXT_ULP_FIELD_OPC_SRC1,
141         .field_src1 = BNXT_ULP_FIELD_SRC_RF,
142         .field_opr1 = {
143         (BNXT_ULP_RF_IDX_FLOW_CNTR_PTR_0 >> 8) & 0xff,
144         BNXT_ULP_RF_IDX_FLOW_CNTR_PTR_0 & 0xff}
145         },
146         {
147         .description = "vnic_or_vport",
148         .field_bit_size = 11,
149         .field_opc = BNXT_ULP_FIELD_OPC_SRC1,
150         .field_src1 = BNXT_ULP_FIELD_SRC_ACT_PROP,
151         .field_opr1 = {
152         (BNXT_ULP_ACT_PROP_IDX_VNIC >> 8) & 0xff,
153         BNXT_ULP_ACT_PROP_IDX_VNIC & 0xff}
154         },
155         {
156         .description = "use_default",
157         .field_bit_size = 1,
158         .field_opc = BNXT_ULP_FIELD_OPC_SRC1,
159         .field_src1 = BNXT_ULP_FIELD_SRC_ZERO
160         },
161         {
162         .description = "mirror",
163         .field_bit_size = 4,
164         .field_opc = BNXT_ULP_FIELD_OPC_SRC1,
165         .field_src1 = BNXT_ULP_FIELD_SRC_ZERO
166         },
167         {
168         .description = "cond_copy",
169         .field_bit_size = 1,
170         .field_opc = BNXT_ULP_FIELD_OPC_SRC1,
171         .field_src1 = BNXT_ULP_FIELD_SRC_ZERO
172         },
173         {
174         .description = "vlan_del_rpt",
175         .field_bit_size = 2,
176         .field_opc = BNXT_ULP_FIELD_OPC_SRC1,
177         .field_src1 = BNXT_ULP_FIELD_SRC_ZERO
178         },
179         {
180         .description = "drop",
181         .field_bit_size = 1,
182         .field_opc = BNXT_ULP_FIELD_OPC_SRC1,
183         .field_src1 = BNXT_ULP_FIELD_SRC_ZERO
184         },
185         {
186         .description = "hit",
187         .field_bit_size = 1,
188         .field_opc = BNXT_ULP_FIELD_OPC_SRC1,
189         .field_src1 = BNXT_ULP_FIELD_SRC_ZERO
190         },
191         {
192         .description = "type",
193         .field_bit_size = 3,
194         .field_opc = BNXT_ULP_FIELD_OPC_SRC1,
195         .field_src1 = BNXT_ULP_FIELD_SRC_CONST,
196         .field_opr1 = {
197         1}
198         }
199 };