1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2014-2020 Broadcom
6 #ifndef _ULP_RTE_PARSER_H_
7 #define _ULP_RTE_PARSER_H_
11 #include <rte_flow_driver.h>
12 #include "ulp_template_db.h"
13 #include "ulp_template_struct.h"
15 /* defines to be used in the tunnel header parsing */
16 #define BNXT_ULP_ENCAP_IPV4_VER_HLEN_TOS 2
17 #define BNXT_ULP_ENCAP_IPV4_ID_PROTO 6
18 #define BNXT_ULP_ENCAP_IPV4_DEST_IP 4
19 #define BNXT_ULP_ENCAP_IPV4_SIZE 12
20 #define BNXT_ULP_ENCAP_IPV6_SIZE 8
21 #define BNXT_ULP_ENCAP_UDP_SIZE 4
23 /* Function to handle the parsing of the RTE port id. */
25 ulp_rte_parser_svif_process(struct ulp_rte_hdr_bitmap *hdr_bitmap,
26 struct ulp_rte_hdr_field *hdr_field);
29 * Function to handle the parsing of RTE Flows and placing
30 * the RTE flow items into the ulp structures.
33 bnxt_ulp_rte_parser_hdr_parse(const struct rte_flow_item pattern[],
34 struct ulp_rte_hdr_bitmap *hdr_bitmap,
35 struct ulp_rte_hdr_field *hdr_field);
38 * Function to handle the parsing of RTE Flows and placing
39 * the RTE flow actions into the ulp structures.
42 bnxt_ulp_rte_parser_act_parse(const struct rte_flow_action actions[],
43 struct ulp_rte_act_bitmap *act_bitmap,
44 struct ulp_rte_act_prop *act_prop);
46 /* Function to handle the parsing of RTE Flow item PF Header. */
48 ulp_rte_pf_hdr_handler(const struct rte_flow_item *item,
49 struct ulp_rte_hdr_bitmap *hdr_bitmap,
50 struct ulp_rte_hdr_field *hdr_field,
54 /* Function to handle the parsing of RTE Flow item VF Header. */
56 ulp_rte_vf_hdr_handler(const struct rte_flow_item *item,
57 struct ulp_rte_hdr_bitmap *hdr_bitmap,
58 struct ulp_rte_hdr_field *hdr_field,
62 /* Function to handle the parsing of RTE Flow item port id Header. */
64 ulp_rte_port_id_hdr_handler(const struct rte_flow_item *item,
65 struct ulp_rte_hdr_bitmap *hdr_bitmap,
66 struct ulp_rte_hdr_field *hdr_field,
70 /* Function to handle the parsing of RTE Flow item port Header. */
72 ulp_rte_phy_port_hdr_handler(const struct rte_flow_item *item,
73 struct ulp_rte_hdr_bitmap *hdr_bitmap,
74 struct ulp_rte_hdr_field *hdr_field,
78 /* Function to handle the RTE item Ethernet Header. */
80 ulp_rte_eth_hdr_handler(const struct rte_flow_item *item,
81 struct ulp_rte_hdr_bitmap *hdr_bitmap,
82 struct ulp_rte_hdr_field *hdr_field,
86 /* Function to handle the parsing of RTE Flow item Vlan Header. */
88 ulp_rte_vlan_hdr_handler(const struct rte_flow_item *item,
89 struct ulp_rte_hdr_bitmap *hdr_bitmap,
90 struct ulp_rte_hdr_field *hdr_field,
94 /* Function to handle the parsing of RTE Flow item IPV4 Header. */
96 ulp_rte_ipv4_hdr_handler(const struct rte_flow_item *item,
97 struct ulp_rte_hdr_bitmap *hdr_bitmap,
98 struct ulp_rte_hdr_field *hdr_field,
102 /* Function to handle the parsing of RTE Flow item IPV6 Header. */
104 ulp_rte_ipv6_hdr_handler(const struct rte_flow_item *item,
105 struct ulp_rte_hdr_bitmap *hdr_bitmap,
106 struct ulp_rte_hdr_field *hdr_field,
110 /* Function to handle the parsing of RTE Flow item UDP Header. */
112 ulp_rte_udp_hdr_handler(const struct rte_flow_item *item,
113 struct ulp_rte_hdr_bitmap *hdr_bitmap,
114 struct ulp_rte_hdr_field *hdr_field,
118 /* Function to handle the parsing of RTE Flow item TCP Header. */
120 ulp_rte_tcp_hdr_handler(const struct rte_flow_item *item,
121 struct ulp_rte_hdr_bitmap *hdr_bitmap,
122 struct ulp_rte_hdr_field *hdr_field,
126 /* Function to handle the parsing of RTE Flow item Vxlan Header. */
128 ulp_rte_vxlan_hdr_handler(const struct rte_flow_item *item,
129 struct ulp_rte_hdr_bitmap *hdrbitmap,
130 struct ulp_rte_hdr_field *hdr_field,
134 /* Function to handle the parsing of RTE Flow item void Header. */
136 ulp_rte_void_hdr_handler(const struct rte_flow_item *item,
137 struct ulp_rte_hdr_bitmap *hdr_bitmap,
138 struct ulp_rte_hdr_field *hdr_field,
142 /* Function to handle the parsing of RTE Flow action void Header. */
144 ulp_rte_void_act_handler(const struct rte_flow_action *action_item,
145 struct ulp_rte_act_bitmap *act,
146 struct ulp_rte_act_prop *act_prop);
148 /* Function to handle the parsing of RTE Flow action RSS Header. */
150 ulp_rte_rss_act_handler(const struct rte_flow_action *action_item,
151 struct ulp_rte_act_bitmap *act,
152 struct ulp_rte_act_prop *act_prop);
154 /* Function to handle the parsing of RTE Flow action Mark Header. */
156 ulp_rte_mark_act_handler(const struct rte_flow_action *action_item,
157 struct ulp_rte_act_bitmap *act,
158 struct ulp_rte_act_prop *act_prop);
160 /* Function to handle the parsing of RTE Flow action vxlan_encap Header. */
162 ulp_rte_vxlan_encap_act_handler(const struct rte_flow_action *action_item,
163 struct ulp_rte_act_bitmap *act,
164 struct ulp_rte_act_prop *act_prop);
166 /* Function to handle the parsing of RTE Flow action vxlan_encap Header. */
168 ulp_rte_vxlan_decap_act_handler(const struct rte_flow_action *action_item,
169 struct ulp_rte_act_bitmap *act,
170 struct ulp_rte_act_prop *act_prop);
172 /* Function to handle the parsing of RTE Flow action drop Header. */
174 ulp_rte_drop_act_handler(const struct rte_flow_action *action_item,
175 struct ulp_rte_act_bitmap *act,
176 struct ulp_rte_act_prop *act_prop);
178 /* Function to handle the parsing of RTE Flow action count. */
180 ulp_rte_count_act_handler(const struct rte_flow_action *action_item,
181 struct ulp_rte_act_bitmap *act,
182 struct ulp_rte_act_prop *act_prop);
184 /* Function to handle the parsing of RTE Flow action PF. */
186 ulp_rte_pf_act_handler(const struct rte_flow_action *action_item,
187 struct ulp_rte_act_bitmap *act,
188 struct ulp_rte_act_prop *act_prop);
190 /* Function to handle the parsing of RTE Flow action VF. */
192 ulp_rte_vf_act_handler(const struct rte_flow_action *action_item,
193 struct ulp_rte_act_bitmap *act,
194 struct ulp_rte_act_prop *act_prop);
196 /* Function to handle the parsing of RTE Flow action port_id. */
198 ulp_rte_port_id_act_handler(const struct rte_flow_action *act_item,
199 struct ulp_rte_act_bitmap *act,
200 struct ulp_rte_act_prop *act_p);
202 /* Function to handle the parsing of RTE Flow action phy_port. */
204 ulp_rte_phy_port_act_handler(const struct rte_flow_action *action_item,
205 struct ulp_rte_act_bitmap *act,
206 struct ulp_rte_act_prop *act_prop);
208 #endif /* _ULP_RTE_PARSER_H_ */