1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2014-2021 Broadcom
6 #include "ulp_template_db_enum.h"
7 #include "ulp_template_struct.h"
8 #include "ulp_rte_parser.h"
11 * This structure has to be indexed based on the rte_flow_action_type that is
12 * part of DPDK. The below array is list of parsing functions for each of the
13 * flow actions that are supported.
15 struct bnxt_ulp_rte_act_info ulp_act_info[] = {
16 [RTE_FLOW_ACTION_TYPE_END] = {
17 .act_type = BNXT_ULP_ACT_TYPE_END,
18 .proto_act_func = NULL
20 [RTE_FLOW_ACTION_TYPE_VOID] = {
21 .act_type = BNXT_ULP_ACT_TYPE_SUPPORTED,
22 .proto_act_func = ulp_rte_void_act_handler
24 [RTE_FLOW_ACTION_TYPE_PASSTHRU] = {
25 .act_type = BNXT_ULP_ACT_TYPE_NOT_SUPPORTED,
26 .proto_act_func = NULL
28 [RTE_FLOW_ACTION_TYPE_JUMP] = {
29 .act_type = BNXT_ULP_ACT_TYPE_SUPPORTED,
30 .proto_act_func = ulp_rte_jump_act_handler
32 [RTE_FLOW_ACTION_TYPE_MARK] = {
33 .act_type = BNXT_ULP_ACT_TYPE_SUPPORTED,
34 .proto_act_func = ulp_rte_mark_act_handler
36 [RTE_FLOW_ACTION_TYPE_FLAG] = {
37 .act_type = BNXT_ULP_ACT_TYPE_NOT_SUPPORTED,
38 .proto_act_func = NULL
40 [RTE_FLOW_ACTION_TYPE_QUEUE] = {
41 .act_type = BNXT_ULP_ACT_TYPE_NOT_SUPPORTED,
42 .proto_act_func = NULL
44 [RTE_FLOW_ACTION_TYPE_DROP] = {
45 .act_type = BNXT_ULP_ACT_TYPE_SUPPORTED,
46 .proto_act_func = ulp_rte_drop_act_handler
48 [RTE_FLOW_ACTION_TYPE_COUNT] = {
49 .act_type = BNXT_ULP_ACT_TYPE_SUPPORTED,
50 .proto_act_func = ulp_rte_count_act_handler
52 [RTE_FLOW_ACTION_TYPE_RSS] = {
53 .act_type = BNXT_ULP_ACT_TYPE_SUPPORTED,
54 .proto_act_func = ulp_rte_rss_act_handler
56 [RTE_FLOW_ACTION_TYPE_PF] = {
57 .act_type = BNXT_ULP_ACT_TYPE_SUPPORTED,
58 .proto_act_func = ulp_rte_pf_act_handler
60 [RTE_FLOW_ACTION_TYPE_VF] = {
61 .act_type = BNXT_ULP_ACT_TYPE_SUPPORTED,
62 .proto_act_func = ulp_rte_vf_act_handler
64 [RTE_FLOW_ACTION_TYPE_PHY_PORT] = {
65 .act_type = BNXT_ULP_ACT_TYPE_SUPPORTED,
66 .proto_act_func = ulp_rte_phy_port_act_handler
68 [RTE_FLOW_ACTION_TYPE_PORT_ID] = {
69 .act_type = BNXT_ULP_ACT_TYPE_SUPPORTED,
70 .proto_act_func = ulp_rte_port_id_act_handler
72 [RTE_FLOW_ACTION_TYPE_METER] = {
73 .act_type = BNXT_ULP_ACT_TYPE_NOT_SUPPORTED,
74 .proto_act_func = NULL
76 [RTE_FLOW_ACTION_TYPE_SECURITY] = {
77 .act_type = BNXT_ULP_ACT_TYPE_NOT_SUPPORTED,
78 .proto_act_func = NULL
80 [RTE_FLOW_ACTION_TYPE_OF_SET_MPLS_TTL] = {
81 .act_type = BNXT_ULP_ACT_TYPE_NOT_SUPPORTED,
82 .proto_act_func = NULL
84 [RTE_FLOW_ACTION_TYPE_OF_DEC_MPLS_TTL] = {
85 .act_type = BNXT_ULP_ACT_TYPE_NOT_SUPPORTED,
86 .proto_act_func = NULL
88 [RTE_FLOW_ACTION_TYPE_OF_SET_NW_TTL] = {
89 .act_type = BNXT_ULP_ACT_TYPE_NOT_SUPPORTED,
90 .proto_act_func = NULL
92 [RTE_FLOW_ACTION_TYPE_OF_DEC_NW_TTL] = {
93 .act_type = BNXT_ULP_ACT_TYPE_NOT_SUPPORTED,
94 .proto_act_func = NULL
96 [RTE_FLOW_ACTION_TYPE_OF_COPY_TTL_OUT] = {
97 .act_type = BNXT_ULP_ACT_TYPE_NOT_SUPPORTED,
98 .proto_act_func = NULL
100 [RTE_FLOW_ACTION_TYPE_OF_COPY_TTL_IN] = {
101 .act_type = BNXT_ULP_ACT_TYPE_NOT_SUPPORTED,
102 .proto_act_func = NULL
104 [RTE_FLOW_ACTION_TYPE_OF_POP_VLAN] = {
105 .act_type = BNXT_ULP_ACT_TYPE_SUPPORTED,
106 .proto_act_func = ulp_rte_of_pop_vlan_act_handler
108 [RTE_FLOW_ACTION_TYPE_OF_PUSH_VLAN] = {
109 .act_type = BNXT_ULP_ACT_TYPE_SUPPORTED,
110 .proto_act_func = ulp_rte_of_push_vlan_act_handler
112 [RTE_FLOW_ACTION_TYPE_OF_SET_VLAN_VID] = {
113 .act_type = BNXT_ULP_ACT_TYPE_SUPPORTED,
114 .proto_act_func = ulp_rte_of_set_vlan_vid_act_handler
116 [RTE_FLOW_ACTION_TYPE_OF_SET_VLAN_PCP] = {
117 .act_type = BNXT_ULP_ACT_TYPE_SUPPORTED,
118 .proto_act_func = ulp_rte_of_set_vlan_pcp_act_handler
120 [RTE_FLOW_ACTION_TYPE_OF_POP_MPLS] = {
121 .act_type = BNXT_ULP_ACT_TYPE_NOT_SUPPORTED,
122 .proto_act_func = NULL
124 [RTE_FLOW_ACTION_TYPE_OF_PUSH_MPLS] = {
125 .act_type = BNXT_ULP_ACT_TYPE_NOT_SUPPORTED,
126 .proto_act_func = NULL
128 [RTE_FLOW_ACTION_TYPE_VXLAN_ENCAP] = {
129 .act_type = BNXT_ULP_ACT_TYPE_SUPPORTED,
130 .proto_act_func = ulp_rte_vxlan_encap_act_handler
132 [RTE_FLOW_ACTION_TYPE_VXLAN_DECAP] = {
133 .act_type = BNXT_ULP_ACT_TYPE_SUPPORTED,
134 .proto_act_func = ulp_rte_vxlan_decap_act_handler
136 [RTE_FLOW_ACTION_TYPE_NVGRE_ENCAP] = {
137 .act_type = BNXT_ULP_ACT_TYPE_NOT_SUPPORTED,
138 .proto_act_func = NULL
140 [RTE_FLOW_ACTION_TYPE_NVGRE_DECAP] = {
141 .act_type = BNXT_ULP_ACT_TYPE_NOT_SUPPORTED,
142 .proto_act_func = NULL
144 [RTE_FLOW_ACTION_TYPE_RAW_ENCAP] = {
145 .act_type = BNXT_ULP_ACT_TYPE_NOT_SUPPORTED,
146 .proto_act_func = NULL
148 [RTE_FLOW_ACTION_TYPE_RAW_DECAP] = {
149 .act_type = BNXT_ULP_ACT_TYPE_NOT_SUPPORTED,
150 .proto_act_func = NULL
152 [RTE_FLOW_ACTION_TYPE_SET_IPV4_SRC] = {
153 .act_type = BNXT_ULP_ACT_TYPE_SUPPORTED,
154 .proto_act_func = ulp_rte_set_ipv4_src_act_handler
156 [RTE_FLOW_ACTION_TYPE_SET_IPV4_DST] = {
157 .act_type = BNXT_ULP_ACT_TYPE_SUPPORTED,
158 .proto_act_func = ulp_rte_set_ipv4_dst_act_handler
160 [RTE_FLOW_ACTION_TYPE_SET_IPV6_SRC] = {
161 .act_type = BNXT_ULP_ACT_TYPE_NOT_SUPPORTED,
162 .proto_act_func = NULL
164 [RTE_FLOW_ACTION_TYPE_SET_IPV6_DST] = {
165 .act_type = BNXT_ULP_ACT_TYPE_NOT_SUPPORTED,
166 .proto_act_func = NULL
168 [RTE_FLOW_ACTION_TYPE_SET_TP_SRC] = {
169 .act_type = BNXT_ULP_ACT_TYPE_SUPPORTED,
170 .proto_act_func = ulp_rte_set_tp_src_act_handler
172 [RTE_FLOW_ACTION_TYPE_SET_TP_DST] = {
173 .act_type = BNXT_ULP_ACT_TYPE_SUPPORTED,
174 .proto_act_func = ulp_rte_set_tp_dst_act_handler
176 [RTE_FLOW_ACTION_TYPE_MAC_SWAP] = {
177 .act_type = BNXT_ULP_ACT_TYPE_NOT_SUPPORTED,
178 .proto_act_func = NULL
180 [RTE_FLOW_ACTION_TYPE_DEC_TTL] = {
181 .act_type = BNXT_ULP_ACT_TYPE_SUPPORTED,
182 .proto_act_func = ulp_rte_dec_ttl_act_handler
184 [RTE_FLOW_ACTION_TYPE_SET_TTL] = {
185 .act_type = BNXT_ULP_ACT_TYPE_NOT_SUPPORTED,
186 .proto_act_func = NULL
188 [RTE_FLOW_ACTION_TYPE_SET_MAC_SRC] = {
189 .act_type = BNXT_ULP_ACT_TYPE_NOT_SUPPORTED,
190 .proto_act_func = NULL
192 [RTE_FLOW_ACTION_TYPE_SET_MAC_DST] = {
193 .act_type = BNXT_ULP_ACT_TYPE_NOT_SUPPORTED,
194 .proto_act_func = NULL
196 [RTE_FLOW_ACTION_TYPE_INC_TCP_SEQ] = {
197 .act_type = BNXT_ULP_ACT_TYPE_NOT_SUPPORTED,
198 .proto_act_func = NULL
200 [RTE_FLOW_ACTION_TYPE_DEC_TCP_SEQ] = {
201 .act_type = BNXT_ULP_ACT_TYPE_NOT_SUPPORTED,
202 .proto_act_func = NULL
204 [RTE_FLOW_ACTION_TYPE_INC_TCP_ACK] = {
205 .act_type = BNXT_ULP_ACT_TYPE_NOT_SUPPORTED,
206 .proto_act_func = NULL
208 [RTE_FLOW_ACTION_TYPE_DEC_TCP_ACK] = {
209 .act_type = BNXT_ULP_ACT_TYPE_NOT_SUPPORTED,
210 .proto_act_func = NULL
215 * This table has to be indexed based on the rte_flow_item_type that is part of
216 * DPDK. The below array is list of parsing functions for each of the flow items
217 * that are supported.
219 struct bnxt_ulp_rte_hdr_info ulp_hdr_info[] = {
220 [RTE_FLOW_ITEM_TYPE_END] = {
221 .hdr_type = BNXT_ULP_HDR_TYPE_END,
222 .proto_hdr_func = NULL
224 [RTE_FLOW_ITEM_TYPE_VOID] = {
225 .hdr_type = BNXT_ULP_HDR_TYPE_SUPPORTED,
226 .proto_hdr_func = ulp_rte_void_hdr_handler
228 [RTE_FLOW_ITEM_TYPE_INVERT] = {
229 .hdr_type = BNXT_ULP_HDR_TYPE_NOT_SUPPORTED,
230 .proto_hdr_func = NULL
232 [RTE_FLOW_ITEM_TYPE_ANY] = {
233 .hdr_type = BNXT_ULP_HDR_TYPE_NOT_SUPPORTED,
234 .proto_hdr_func = NULL
236 [RTE_FLOW_ITEM_TYPE_PF] = {
237 .hdr_type = BNXT_ULP_HDR_TYPE_SUPPORTED,
238 .proto_hdr_func = ulp_rte_pf_hdr_handler
240 [RTE_FLOW_ITEM_TYPE_VF] = {
241 .hdr_type = BNXT_ULP_HDR_TYPE_SUPPORTED,
242 .proto_hdr_func = ulp_rte_vf_hdr_handler
244 [RTE_FLOW_ITEM_TYPE_PHY_PORT] = {
245 .hdr_type = BNXT_ULP_HDR_TYPE_SUPPORTED,
246 .proto_hdr_func = ulp_rte_phy_port_hdr_handler
248 [RTE_FLOW_ITEM_TYPE_PORT_ID] = {
249 .hdr_type = BNXT_ULP_HDR_TYPE_SUPPORTED,
250 .proto_hdr_func = ulp_rte_port_id_hdr_handler
252 [RTE_FLOW_ITEM_TYPE_RAW] = {
253 .hdr_type = BNXT_ULP_HDR_TYPE_NOT_SUPPORTED,
254 .proto_hdr_func = NULL
256 [RTE_FLOW_ITEM_TYPE_ETH] = {
257 .hdr_type = BNXT_ULP_HDR_TYPE_SUPPORTED,
258 .proto_hdr_func = ulp_rte_eth_hdr_handler
260 [RTE_FLOW_ITEM_TYPE_VLAN] = {
261 .hdr_type = BNXT_ULP_HDR_TYPE_SUPPORTED,
262 .proto_hdr_func = ulp_rte_vlan_hdr_handler
264 [RTE_FLOW_ITEM_TYPE_IPV4] = {
265 .hdr_type = BNXT_ULP_HDR_TYPE_SUPPORTED,
266 .proto_hdr_func = ulp_rte_ipv4_hdr_handler
268 [RTE_FLOW_ITEM_TYPE_IPV6] = {
269 .hdr_type = BNXT_ULP_HDR_TYPE_SUPPORTED,
270 .proto_hdr_func = ulp_rte_ipv6_hdr_handler
272 [RTE_FLOW_ITEM_TYPE_ICMP] = {
273 .hdr_type = BNXT_ULP_HDR_TYPE_NOT_SUPPORTED,
274 .proto_hdr_func = NULL
276 [RTE_FLOW_ITEM_TYPE_UDP] = {
277 .hdr_type = BNXT_ULP_HDR_TYPE_SUPPORTED,
278 .proto_hdr_func = ulp_rte_udp_hdr_handler
280 [RTE_FLOW_ITEM_TYPE_TCP] = {
281 .hdr_type = BNXT_ULP_HDR_TYPE_SUPPORTED,
282 .proto_hdr_func = ulp_rte_tcp_hdr_handler
284 [RTE_FLOW_ITEM_TYPE_SCTP] = {
285 .hdr_type = BNXT_ULP_HDR_TYPE_NOT_SUPPORTED,
286 .proto_hdr_func = NULL
288 [RTE_FLOW_ITEM_TYPE_VXLAN] = {
289 .hdr_type = BNXT_ULP_HDR_TYPE_SUPPORTED,
290 .proto_hdr_func = ulp_rte_vxlan_hdr_handler
292 [RTE_FLOW_ITEM_TYPE_E_TAG] = {
293 .hdr_type = BNXT_ULP_HDR_TYPE_NOT_SUPPORTED,
294 .proto_hdr_func = NULL
296 [RTE_FLOW_ITEM_TYPE_NVGRE] = {
297 .hdr_type = BNXT_ULP_HDR_TYPE_NOT_SUPPORTED,
298 .proto_hdr_func = NULL
300 [RTE_FLOW_ITEM_TYPE_MPLS] = {
301 .hdr_type = BNXT_ULP_HDR_TYPE_NOT_SUPPORTED,
302 .proto_hdr_func = NULL
304 [RTE_FLOW_ITEM_TYPE_GRE] = {
305 .hdr_type = BNXT_ULP_HDR_TYPE_NOT_SUPPORTED,
306 .proto_hdr_func = NULL
308 [RTE_FLOW_ITEM_TYPE_FUZZY] = {
309 .hdr_type = BNXT_ULP_HDR_TYPE_NOT_SUPPORTED,
310 .proto_hdr_func = NULL
312 [RTE_FLOW_ITEM_TYPE_GTP] = {
313 .hdr_type = BNXT_ULP_HDR_TYPE_NOT_SUPPORTED,
314 .proto_hdr_func = NULL
316 [RTE_FLOW_ITEM_TYPE_GTPC] = {
317 .hdr_type = BNXT_ULP_HDR_TYPE_NOT_SUPPORTED,
318 .proto_hdr_func = NULL
320 [RTE_FLOW_ITEM_TYPE_GTPU] = {
321 .hdr_type = BNXT_ULP_HDR_TYPE_NOT_SUPPORTED,
322 .proto_hdr_func = NULL
324 [RTE_FLOW_ITEM_TYPE_ESP] = {
325 .hdr_type = BNXT_ULP_HDR_TYPE_NOT_SUPPORTED,
326 .proto_hdr_func = NULL
328 [RTE_FLOW_ITEM_TYPE_GENEVE] = {
329 .hdr_type = BNXT_ULP_HDR_TYPE_NOT_SUPPORTED,
330 .proto_hdr_func = NULL
332 [RTE_FLOW_ITEM_TYPE_VXLAN_GPE] = {
333 .hdr_type = BNXT_ULP_HDR_TYPE_NOT_SUPPORTED,
334 .proto_hdr_func = NULL
336 [RTE_FLOW_ITEM_TYPE_ARP_ETH_IPV4] = {
337 .hdr_type = BNXT_ULP_HDR_TYPE_NOT_SUPPORTED,
338 .proto_hdr_func = NULL
340 [RTE_FLOW_ITEM_TYPE_IPV6_EXT] = {
341 .hdr_type = BNXT_ULP_HDR_TYPE_NOT_SUPPORTED,
342 .proto_hdr_func = NULL
344 [RTE_FLOW_ITEM_TYPE_ICMP6] = {
345 .hdr_type = BNXT_ULP_HDR_TYPE_NOT_SUPPORTED,
346 .proto_hdr_func = NULL
348 [RTE_FLOW_ITEM_TYPE_ICMP6_ND_NS] = {
349 .hdr_type = BNXT_ULP_HDR_TYPE_NOT_SUPPORTED,
350 .proto_hdr_func = NULL
352 [RTE_FLOW_ITEM_TYPE_ICMP6_ND_NA] = {
353 .hdr_type = BNXT_ULP_HDR_TYPE_NOT_SUPPORTED,
354 .proto_hdr_func = NULL
356 [RTE_FLOW_ITEM_TYPE_ICMP6_ND_OPT] = {
357 .hdr_type = BNXT_ULP_HDR_TYPE_NOT_SUPPORTED,
358 .proto_hdr_func = NULL
360 [RTE_FLOW_ITEM_TYPE_ICMP6_ND_OPT_SLA_ETH] = {
361 .hdr_type = BNXT_ULP_HDR_TYPE_NOT_SUPPORTED,
362 .proto_hdr_func = NULL
364 [RTE_FLOW_ITEM_TYPE_ICMP6_ND_OPT_TLA_ETH] = {
365 .hdr_type = BNXT_ULP_HDR_TYPE_NOT_SUPPORTED,
366 .proto_hdr_func = NULL
368 [RTE_FLOW_ITEM_TYPE_MARK] = {
369 .hdr_type = BNXT_ULP_HDR_TYPE_NOT_SUPPORTED,
370 .proto_hdr_func = NULL
372 [RTE_FLOW_ITEM_TYPE_META] = {
373 .hdr_type = BNXT_ULP_HDR_TYPE_NOT_SUPPORTED,
374 .proto_hdr_func = NULL
376 [RTE_FLOW_ITEM_TYPE_GRE_KEY] = {
377 .hdr_type = BNXT_ULP_HDR_TYPE_NOT_SUPPORTED,
378 .proto_hdr_func = NULL
380 [RTE_FLOW_ITEM_TYPE_GTP_PSC] = {
381 .hdr_type = BNXT_ULP_HDR_TYPE_NOT_SUPPORTED,
382 .proto_hdr_func = NULL
384 [RTE_FLOW_ITEM_TYPE_PPPOES] = {
385 .hdr_type = BNXT_ULP_HDR_TYPE_NOT_SUPPORTED,
386 .proto_hdr_func = NULL
388 [RTE_FLOW_ITEM_TYPE_PPPOED] = {
389 .hdr_type = BNXT_ULP_HDR_TYPE_NOT_SUPPORTED,
390 .proto_hdr_func = NULL
392 [RTE_FLOW_ITEM_TYPE_PPPOE_PROTO_ID] = {
393 .hdr_type = BNXT_ULP_HDR_TYPE_NOT_SUPPORTED,
394 .proto_hdr_func = NULL
396 [RTE_FLOW_ITEM_TYPE_NSH] = {
397 .hdr_type = BNXT_ULP_HDR_TYPE_NOT_SUPPORTED,
398 .proto_hdr_func = NULL
400 [RTE_FLOW_ITEM_TYPE_IGMP] = {
401 .hdr_type = BNXT_ULP_HDR_TYPE_NOT_SUPPORTED,
402 .proto_hdr_func = NULL
404 [RTE_FLOW_ITEM_TYPE_AH] = {
405 .hdr_type = BNXT_ULP_HDR_TYPE_NOT_SUPPORTED,
406 .proto_hdr_func = NULL
408 [RTE_FLOW_ITEM_TYPE_HIGIG2] = {
409 .hdr_type = BNXT_ULP_HDR_TYPE_NOT_SUPPORTED,
410 .proto_hdr_func = NULL