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
24 * Function to handle the parsing of RTE Flows and placing
25 * the RTE flow items into the ulp structures.
28 bnxt_ulp_rte_parser_hdr_parse(const struct rte_flow_item pattern[],
29 struct ulp_rte_hdr_bitmap *hdr_bitmap,
30 struct ulp_rte_hdr_field *hdr_field);
33 * Function to handle the parsing of RTE Flows and placing
34 * the RTE flow actions into the ulp structures.
37 bnxt_ulp_rte_parser_act_parse(const struct rte_flow_action actions[],
38 struct ulp_rte_act_bitmap *act_bitmap,
39 struct ulp_rte_act_prop *act_prop);
41 /* Function to handle the parsing of RTE Flow item PF Header. */
43 ulp_rte_pf_hdr_handler(const struct rte_flow_item *item,
44 struct ulp_rte_hdr_bitmap *hdr_bitmap,
45 struct ulp_rte_hdr_field *hdr_field,
49 /* Function to handle the parsing of RTE Flow item VF Header. */
51 ulp_rte_vf_hdr_handler(const struct rte_flow_item *item,
52 struct ulp_rte_hdr_bitmap *hdr_bitmap,
53 struct ulp_rte_hdr_field *hdr_field,
57 /* Function to handle the parsing of RTE Flow item port id Header. */
59 ulp_rte_port_id_hdr_handler(const struct rte_flow_item *item,
60 struct ulp_rte_hdr_bitmap *hdr_bitmap,
61 struct ulp_rte_hdr_field *hdr_field,
65 /* Function to handle the parsing of RTE Flow item port Header. */
67 ulp_rte_phy_port_hdr_handler(const struct rte_flow_item *item,
68 struct ulp_rte_hdr_bitmap *hdr_bitmap,
69 struct ulp_rte_hdr_field *hdr_field,
73 /* Function to handle the RTE item Ethernet Header. */
75 ulp_rte_eth_hdr_handler(const struct rte_flow_item *item,
76 struct ulp_rte_hdr_bitmap *hdr_bitmap,
77 struct ulp_rte_hdr_field *hdr_field,
81 /* Function to handle the parsing of RTE Flow item Vlan Header. */
83 ulp_rte_vlan_hdr_handler(const struct rte_flow_item *item,
84 struct ulp_rte_hdr_bitmap *hdr_bitmap,
85 struct ulp_rte_hdr_field *hdr_field,
89 /* Function to handle the parsing of RTE Flow item IPV4 Header. */
91 ulp_rte_ipv4_hdr_handler(const struct rte_flow_item *item,
92 struct ulp_rte_hdr_bitmap *hdr_bitmap,
93 struct ulp_rte_hdr_field *hdr_field,
97 /* Function to handle the parsing of RTE Flow item IPV6 Header. */
99 ulp_rte_ipv6_hdr_handler(const struct rte_flow_item *item,
100 struct ulp_rte_hdr_bitmap *hdr_bitmap,
101 struct ulp_rte_hdr_field *hdr_field,
105 /* Function to handle the parsing of RTE Flow item UDP Header. */
107 ulp_rte_udp_hdr_handler(const struct rte_flow_item *item,
108 struct ulp_rte_hdr_bitmap *hdr_bitmap,
109 struct ulp_rte_hdr_field *hdr_field,
113 /* Function to handle the parsing of RTE Flow item TCP Header. */
115 ulp_rte_tcp_hdr_handler(const struct rte_flow_item *item,
116 struct ulp_rte_hdr_bitmap *hdr_bitmap,
117 struct ulp_rte_hdr_field *hdr_field,
121 /* Function to handle the parsing of RTE Flow item Vxlan Header. */
123 ulp_rte_vxlan_hdr_handler(const struct rte_flow_item *item,
124 struct ulp_rte_hdr_bitmap *hdrbitmap,
125 struct ulp_rte_hdr_field *hdr_field,
129 /* Function to handle the parsing of RTE Flow item void Header. */
131 ulp_rte_void_hdr_handler(const struct rte_flow_item *item,
132 struct ulp_rte_hdr_bitmap *hdr_bitmap,
133 struct ulp_rte_hdr_field *hdr_field,
137 /* Function to handle the parsing of RTE Flow action void Header. */
139 ulp_rte_void_act_handler(const struct rte_flow_action *action_item,
140 struct ulp_rte_act_bitmap *act,
141 struct ulp_rte_act_prop *act_prop);
143 /* Function to handle the parsing of RTE Flow action RSS Header. */
145 ulp_rte_rss_act_handler(const struct rte_flow_action *action_item,
146 struct ulp_rte_act_bitmap *act,
147 struct ulp_rte_act_prop *act_prop);
149 /* Function to handle the parsing of RTE Flow action Mark Header. */
151 ulp_rte_mark_act_handler(const struct rte_flow_action *action_item,
152 struct ulp_rte_act_bitmap *act,
153 struct ulp_rte_act_prop *act_prop);
155 /* Function to handle the parsing of RTE Flow action vxlan_encap Header. */
157 ulp_rte_vxlan_encap_act_handler(const struct rte_flow_action *action_item,
158 struct ulp_rte_act_bitmap *act,
159 struct ulp_rte_act_prop *act_prop);
161 /* Function to handle the parsing of RTE Flow action vxlan_encap Header. */
163 ulp_rte_vxlan_decap_act_handler(const struct rte_flow_action *action_item,
164 struct ulp_rte_act_bitmap *act,
165 struct ulp_rte_act_prop *act_prop);
167 /* Function to handle the parsing of RTE Flow action drop Header. */
169 ulp_rte_drop_act_handler(const struct rte_flow_action *action_item,
170 struct ulp_rte_act_bitmap *act,
171 struct ulp_rte_act_prop *act_prop);
173 /* Function to handle the parsing of RTE Flow action count. */
175 ulp_rte_count_act_handler(const struct rte_flow_action *action_item,
176 struct ulp_rte_act_bitmap *act,
177 struct ulp_rte_act_prop *act_prop);
179 /* Function to handle the parsing of RTE Flow action PF. */
181 ulp_rte_pf_act_handler(const struct rte_flow_action *action_item,
182 struct ulp_rte_act_bitmap *act,
183 struct ulp_rte_act_prop *act_prop);
185 /* Function to handle the parsing of RTE Flow action VF. */
187 ulp_rte_vf_act_handler(const struct rte_flow_action *action_item,
188 struct ulp_rte_act_bitmap *act,
189 struct ulp_rte_act_prop *act_prop);
191 /* Function to handle the parsing of RTE Flow action port_id. */
193 ulp_rte_port_id_act_handler(const struct rte_flow_action *act_item,
194 struct ulp_rte_act_bitmap *act,
195 struct ulp_rte_act_prop *act_p);
197 /* Function to handle the parsing of RTE Flow action phy_port. */
199 ulp_rte_phy_port_act_handler(const struct rte_flow_action *action_item,
200 struct ulp_rte_act_bitmap *act,
201 struct ulp_rte_act_prop *act_prop);
203 #endif /* _ULP_RTE_PARSER_H_ */