1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2019 Intel Corporation
5 #ifndef _ICE_GENERIC_FLOW_H_
6 #define _ICE_GENERIC_FLOW_H_
8 #include <rte_flow_driver.h>
12 #define ICE_PROT_MAC BIT_ULL(1)
13 #define ICE_PROT_VLAN BIT_ULL(2)
14 #define ICE_PROT_IPV4 BIT_ULL(3)
15 #define ICE_PROT_IPV6 BIT_ULL(4)
16 #define ICE_PROT_TCP BIT_ULL(5)
17 #define ICE_PROT_UDP BIT_ULL(6)
18 #define ICE_PROT_SCTP BIT_ULL(7)
19 #define ICE_PROT_ICMP4 BIT_ULL(8)
20 #define ICE_PROT_ICMP6 BIT_ULL(9)
21 #define ICE_PROT_VXLAN BIT_ULL(10)
22 #define ICE_PROT_NVGRE BIT_ULL(11)
23 #define ICE_PROT_GTPU BIT_ULL(12)
24 #define ICE_PROT_PPPOE_S BIT_ULL(13)
25 #define ICE_PROT_ESP BIT_ULL(14)
26 #define ICE_PROT_AH BIT_ULL(15)
27 #define ICE_PROT_L2TPV3OIP BIT_ULL(16)
28 #define ICE_PROT_PFCP BIT_ULL(17)
29 #define ICE_PROT_NAT_T_ESP BIT_ULL(18)
33 #define ICE_SMAC BIT_ULL(63)
34 #define ICE_DMAC BIT_ULL(62)
35 #define ICE_ETHERTYPE BIT_ULL(61)
36 #define ICE_IP_SRC BIT_ULL(60)
37 #define ICE_IP_DST BIT_ULL(59)
38 #define ICE_IP_PROTO BIT_ULL(58)
39 #define ICE_IP_TTL BIT_ULL(57)
40 #define ICE_IP_TOS BIT_ULL(56)
41 #define ICE_SPORT BIT_ULL(55)
42 #define ICE_DPORT BIT_ULL(54)
43 #define ICE_ICMP_TYPE BIT_ULL(53)
44 #define ICE_ICMP_CODE BIT_ULL(52)
45 #define ICE_VXLAN_VNI BIT_ULL(51)
46 #define ICE_NVGRE_TNI BIT_ULL(50)
47 #define ICE_GTPU_TEID BIT_ULL(49)
48 #define ICE_GTPU_QFI BIT_ULL(48)
49 #define ICE_PPPOE_SESSION BIT_ULL(47)
50 #define ICE_PPPOE_PROTO BIT_ULL(46)
51 #define ICE_ESP_SPI BIT_ULL(45)
52 #define ICE_AH_SPI BIT_ULL(44)
53 #define ICE_L2TPV3OIP_SESSION_ID BIT_ULL(43)
54 #define ICE_PFCP_SEID BIT_ULL(42)
55 #define ICE_PFCP_S_FIELD BIT_ULL(41)
56 #define ICE_IP_PK_ID BIT_ULL(40)
60 #define ICE_INSET_NONE 0ULL
62 #define ICE_INSET_SMAC (ICE_SMAC)
63 #define ICE_INSET_DMAC (ICE_DMAC)
64 #define ICE_INSET_VLAN (ICE_PROT_VLAN)
65 #define ICE_INSET_VLAN_INNER (ICE_PROT_VLAN)
66 #define ICE_INSET_VLAN_OUTER (ICE_PROT_VLAN)
67 #define ICE_INSET_ETHERTYPE (ICE_ETHERTYPE)
69 #define ICE_INSET_IPV4_SRC (ICE_PROT_IPV4 | ICE_IP_SRC)
70 #define ICE_INSET_IPV4_DST (ICE_PROT_IPV4 | ICE_IP_DST)
71 #define ICE_INSET_IPV4_TOS (ICE_PROT_IPV4 | ICE_IP_TOS)
72 #define ICE_INSET_IPV4_PROTO (ICE_PROT_IPV4 | ICE_IP_PROTO)
73 #define ICE_INSET_IPV4_TTL (ICE_PROT_IPV4 | ICE_IP_TTL)
74 #define ICE_INSET_IPV4_PKID (ICE_PROT_IPV4 | ICE_IP_PK_ID)
75 #define ICE_INSET_IPV6_SRC (ICE_PROT_IPV6 | ICE_IP_SRC)
76 #define ICE_INSET_IPV6_DST (ICE_PROT_IPV6 | ICE_IP_DST)
77 #define ICE_INSET_IPV6_NEXT_HDR (ICE_PROT_IPV6 | ICE_IP_PROTO)
78 #define ICE_INSET_IPV6_HOP_LIMIT (ICE_PROT_IPV6 | ICE_IP_TTL)
79 #define ICE_INSET_IPV6_TC (ICE_PROT_IPV6 | ICE_IP_TOS)
80 #define ICE_INSET_IPV6_PKID (ICE_PROT_IPV6 | ICE_IP_PK_ID)
82 #define ICE_INSET_TCP_SRC_PORT (ICE_PROT_TCP | ICE_SPORT)
83 #define ICE_INSET_TCP_DST_PORT (ICE_PROT_TCP | ICE_DPORT)
84 #define ICE_INSET_UDP_SRC_PORT (ICE_PROT_UDP | ICE_SPORT)
85 #define ICE_INSET_UDP_DST_PORT (ICE_PROT_UDP | ICE_DPORT)
86 #define ICE_INSET_SCTP_SRC_PORT (ICE_PROT_SCTP | ICE_SPORT)
87 #define ICE_INSET_SCTP_DST_PORT (ICE_PROT_SCTP | ICE_DPORT)
88 #define ICE_INSET_ICMP4_SRC_PORT (ICE_PROT_ICMP4 | ICE_SPORT)
89 #define ICE_INSET_ICMP4_DST_PORT (ICE_PROT_ICMP4 | ICE_DPORT)
90 #define ICE_INSET_ICMP6_SRC_PORT (ICE_PROT_ICMP6 | ICE_SPORT)
91 #define ICE_INSET_ICMP6_DST_PORT (ICE_PROT_ICMP6 | ICE_DPORT)
92 #define ICE_INSET_ICMP4_TYPE (ICE_PROT_ICMP4 | ICE_ICMP_TYPE)
93 #define ICE_INSET_ICMP4_CODE (ICE_PROT_ICMP4 | ICE_ICMP_CODE)
94 #define ICE_INSET_ICMP6_TYPE (ICE_PROT_ICMP6 | ICE_ICMP_TYPE)
95 #define ICE_INSET_ICMP6_CODE (ICE_PROT_ICMP6 | ICE_ICMP_CODE)
99 #define ICE_INSET_VXLAN_VNI \
100 (ICE_PROT_VXLAN | ICE_VXLAN_VNI)
101 #define ICE_INSET_NVGRE_TNI \
102 (ICE_PROT_NVGRE | ICE_NVGRE_TNI)
103 #define ICE_INSET_GTPU_TEID \
104 (ICE_PROT_GTPU | ICE_GTPU_TEID)
105 #define ICE_INSET_GTPU_QFI \
106 (ICE_PROT_GTPU | ICE_GTPU_QFI)
107 #define ICE_INSET_PPPOE_SESSION \
108 (ICE_PROT_PPPOE_S | ICE_PPPOE_SESSION)
109 #define ICE_INSET_PPPOE_PROTO \
110 (ICE_PROT_PPPOE_S | ICE_PPPOE_PROTO)
111 #define ICE_INSET_ESP_SPI \
112 (ICE_PROT_ESP | ICE_ESP_SPI)
113 #define ICE_INSET_AH_SPI \
114 (ICE_PROT_AH | ICE_AH_SPI)
115 #define ICE_INSET_L2TPV3OIP_SESSION_ID \
116 (ICE_PROT_L2TPV3OIP | ICE_L2TPV3OIP_SESSION_ID)
117 #define ICE_INSET_PFCP_S_FIELD \
118 (ICE_PROT_PFCP | ICE_PFCP_S_FIELD)
119 #define ICE_INSET_PFCP_SEID \
120 (ICE_PROT_PFCP | ICE_PFCP_S_FIELD | ICE_PFCP_SEID)
121 #define ICE_INSET_NAT_T_ESP_SPI \
122 (ICE_PROT_NAT_T_ESP | ICE_ESP_SPI)
125 extern enum rte_flow_item_type pattern_empty[];
128 extern enum rte_flow_item_type pattern_ethertype[];
129 extern enum rte_flow_item_type pattern_ethertype_vlan[];
130 extern enum rte_flow_item_type pattern_ethertype_qinq[];
133 extern enum rte_flow_item_type pattern_eth_arp[];
135 /* non-tunnel IPv4 */
136 extern enum rte_flow_item_type pattern_eth_ipv4[];
137 extern enum rte_flow_item_type pattern_eth_vlan_ipv4[];
138 extern enum rte_flow_item_type pattern_eth_qinq_ipv4[];
139 extern enum rte_flow_item_type pattern_eth_ipv4_udp[];
140 extern enum rte_flow_item_type pattern_eth_vlan_ipv4_udp[];
141 extern enum rte_flow_item_type pattern_eth_qinq_ipv4_udp[];
142 extern enum rte_flow_item_type pattern_eth_ipv4_tcp[];
143 extern enum rte_flow_item_type pattern_eth_vlan_ipv4_tcp[];
144 extern enum rte_flow_item_type pattern_eth_qinq_ipv4_tcp[];
145 extern enum rte_flow_item_type pattern_eth_ipv4_sctp[];
146 extern enum rte_flow_item_type pattern_eth_vlan_ipv4_sctp[];
147 extern enum rte_flow_item_type pattern_eth_qinq_ipv4_sctp[];
148 extern enum rte_flow_item_type pattern_eth_ipv4_icmp[];
149 extern enum rte_flow_item_type pattern_eth_vlan_ipv4_icmp[];
150 extern enum rte_flow_item_type pattern_eth_qinq_ipv4_icmp[];
152 /* non-tunnel IPv6 */
153 extern enum rte_flow_item_type pattern_eth_ipv6[];
154 extern enum rte_flow_item_type pattern_eth_vlan_ipv6[];
155 extern enum rte_flow_item_type pattern_eth_qinq_ipv6[];
156 extern enum rte_flow_item_type pattern_eth_ipv6_frag_ext[];
157 extern enum rte_flow_item_type pattern_eth_vlan_ipv6_frag_ext[];
158 extern enum rte_flow_item_type pattern_eth_qinq_ipv6_frag_ext[];
159 extern enum rte_flow_item_type pattern_eth_ipv6_udp[];
160 extern enum rte_flow_item_type pattern_eth_vlan_ipv6_udp[];
161 extern enum rte_flow_item_type pattern_eth_qinq_ipv6_udp[];
162 extern enum rte_flow_item_type pattern_eth_ipv6_tcp[];
163 extern enum rte_flow_item_type pattern_eth_vlan_ipv6_tcp[];
164 extern enum rte_flow_item_type pattern_eth_qinq_ipv6_tcp[];
165 extern enum rte_flow_item_type pattern_eth_ipv6_sctp[];
166 extern enum rte_flow_item_type pattern_eth_vlan_ipv6_sctp[];
167 extern enum rte_flow_item_type pattern_eth_qinq_ipv6_sctp[];
168 extern enum rte_flow_item_type pattern_eth_ipv6_icmp6[];
169 extern enum rte_flow_item_type pattern_eth_vlan_ipv6_icmp6[];
170 extern enum rte_flow_item_type pattern_eth_qinq_ipv6_icmp6[];
172 /* IPv4 VXLAN IPv4 */
173 extern enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_ipv4[];
174 extern enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_ipv4_udp[];
175 extern enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_ipv4_tcp[];
176 extern enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_ipv4_sctp[];
177 extern enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_ipv4_icmp[];
179 /* IPv4 VXLAN MAC IPv4 */
180 extern enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_eth_ipv4[];
181 extern enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_eth_ipv4_udp[];
182 extern enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_eth_ipv4_tcp[];
183 extern enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_eth_ipv4_sctp[];
184 extern enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_eth_ipv4_icmp[];
186 /* IPv6 VXLAN IPv4 */
187 extern enum rte_flow_item_type pattern_eth_ipv6_udp_vxlan_ipv4[];
188 extern enum rte_flow_item_type pattern_eth_ipv6_udp_vxlan_ipv4_tcp[];
189 extern enum rte_flow_item_type pattern_eth_ipv6_udp_vxlan_ipv4_udp[];
190 extern enum rte_flow_item_type pattern_eth_ipv6_udp_vxlan_ipv4_sctp[];
191 extern enum rte_flow_item_type pattern_eth_ipv6_udp_vxlan_ipv4_icmp[];
193 /* IPv6 VXLAN MAC IPv4 */
194 extern enum rte_flow_item_type pattern_eth_ipv6_udp_vxlan_eth_ipv4[];
195 extern enum rte_flow_item_type pattern_eth_ipv6_udp_vxlan_eth_ipv4_tcp[];
196 extern enum rte_flow_item_type pattern_eth_ipv6_udp_vxlan_eth_ipv4_udp[];
197 extern enum rte_flow_item_type pattern_eth_ipv6_udp_vxlan_eth_ipv4_sctp[];
198 extern enum rte_flow_item_type pattern_eth_ipv6_udp_vxlan_eth_ipv4_icmp[];
200 /* IPv4 VXLAN IPv6 */
201 extern enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_ipv6[];
202 extern enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_ipv6_udp[];
203 extern enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_ipv6_tcp[];
204 extern enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_ipv6_sctp[];
205 extern enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_ipv6_icmp6[];
207 /* IPv4 VXLAN MAC IPv6 */
208 extern enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_eth_ipv6[];
209 extern enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_eth_ipv6_udp[];
210 extern enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_eth_ipv6_tcp[];
211 extern enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_eth_ipv6_sctp[];
212 extern enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_eth_ipv6_icmp6[];
214 /* IPv6 VXLAN IPv6 */
215 extern enum rte_flow_item_type pattern_eth_ipv6_udp_vxlan_ipv6[];
216 extern enum rte_flow_item_type pattern_eth_ipv6_udp_vxlan_ipv6_tcp[];
217 extern enum rte_flow_item_type pattern_eth_ipv6_udp_vxlan_ipv6_udp[];
218 extern enum rte_flow_item_type pattern_eth_ipv6_udp_vxlan_ipv6_sctp[];
219 extern enum rte_flow_item_type pattern_eth_ipv6_udp_vxlan_ipv6_icmp6[];
221 /* IPv6 VXLAN MAC IPv6 */
222 extern enum rte_flow_item_type pattern_eth_ipv6_udp_vxlan_eth_ipv6[];
223 extern enum rte_flow_item_type pattern_eth_ipv6_udp_vxlan_eth_ipv6_tcp[];
224 extern enum rte_flow_item_type pattern_eth_ipv6_udp_vxlan_eth_ipv6_udp[];
225 extern enum rte_flow_item_type pattern_eth_ipv6_udp_vxlan_eth_ipv6_sctp[];
226 extern enum rte_flow_item_type pattern_eth_ipv6_udp_vxlan_eth_ipv6_icmp6[];
228 /* IPv4 NVGRE IPv4 */
229 extern enum rte_flow_item_type pattern_eth_ipv4_nvgre_ipv4[];
230 extern enum rte_flow_item_type pattern_eth_ipv4_nvgre_ipv4_udp[];
231 extern enum rte_flow_item_type pattern_eth_ipv4_nvgre_ipv4_tcp[];
232 extern enum rte_flow_item_type pattern_eth_ipv4_nvgre_ipv4_sctp[];
233 extern enum rte_flow_item_type pattern_eth_ipv4_nvgre_ipv4_icmp[];
235 /* IPv4 NVGRE MAC IPv4 */
236 extern enum rte_flow_item_type pattern_eth_ipv4_nvgre_eth_ipv4[];
237 extern enum rte_flow_item_type pattern_eth_ipv4_nvgre_eth_ipv4_udp[];
238 extern enum rte_flow_item_type pattern_eth_ipv4_nvgre_eth_ipv4_tcp[];
239 extern enum rte_flow_item_type pattern_eth_ipv4_nvgre_eth_ipv4_sctp[];
240 extern enum rte_flow_item_type pattern_eth_ipv4_nvgre_eth_ipv4_icmp[];
242 /* IPv6 NVGRE IPv4 */
243 extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_ipv4[];
244 extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_ipv4_tcp[];
245 extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_ipv4_udp[];
246 extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_ipv4_sctp[];
247 extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_ipv4_icmp[];
249 /* IPv6 NVGRE MAC IPv4 */
250 extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_eth_ipv4[];
251 extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_eth_ipv4_tcp[];
252 extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_eth_ipv4_udp[];
253 extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_eth_ipv4_sctp[];
254 extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_eth_ipv4_icmp[];
256 /* IPv4 NVGRE IPv6 */
257 extern enum rte_flow_item_type pattern_eth_ipv4_nvgre_ipv6[];
258 extern enum rte_flow_item_type pattern_eth_ipv4_nvgre_ipv6_udp[];
259 extern enum rte_flow_item_type pattern_eth_ipv4_nvgre_ipv6_tcp[];
260 extern enum rte_flow_item_type pattern_eth_ipv4_nvgre_ipv6_sctp[];
261 extern enum rte_flow_item_type pattern_eth_ipv4_nvgre_ipv6_icmp6[];
263 /* IPv4 NVGRE MAC IPv6 */
264 extern enum rte_flow_item_type pattern_eth_ipv4_nvgre_eth_ipv6[];
265 extern enum rte_flow_item_type pattern_eth_ipv4_nvgre_eth_ipv6_udp[];
266 extern enum rte_flow_item_type pattern_eth_ipv4_nvgre_eth_ipv6_tcp[];
267 extern enum rte_flow_item_type pattern_eth_ipv4_nvgre_eth_ipv6_sctp[];
268 extern enum rte_flow_item_type pattern_eth_ipv4_nvgre_eth_ipv6_icmp6[];
270 /* IPv6 NVGRE IPv6 */
271 extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_ipv6[];
272 extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_ipv6_tcp[];
273 extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_ipv6_udp[];
274 extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_ipv6_sctp[];
275 extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_ipv6_icmp6[];
277 /* IPv6 NVGRE MAC IPv6 */
278 extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_eth_ipv6[];
279 extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_eth_ipv6_tcp[];
280 extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_eth_ipv6_udp[];
281 extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_eth_ipv6_sctp[];
282 extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_eth_ipv6_icmp6[];
285 extern enum rte_flow_item_type pattern_eth_ipv4_gtpu[];
286 extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_eh[];
289 extern enum rte_flow_item_type pattern_eth_ipv6_gtpu[];
290 extern enum rte_flow_item_type pattern_eth_ipv6_gtpu_eh[];
293 extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_ipv4[];
294 extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_ipv4_udp[];
295 extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_ipv4_tcp[];
296 extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_ipv4_icmp[];
299 extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_ipv6[];
300 extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_ipv6_udp[];
301 extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_ipv6_tcp[];
302 extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_ipv6_icmp[];
305 extern enum rte_flow_item_type pattern_eth_ipv6_gtpu_ipv4[];
306 extern enum rte_flow_item_type pattern_eth_ipv6_gtpu_ipv4_udp[];
307 extern enum rte_flow_item_type pattern_eth_ipv6_gtpu_ipv4_tcp[];
308 extern enum rte_flow_item_type pattern_eth_ipv6_gtpu_ipv4_icmp[];
311 extern enum rte_flow_item_type pattern_eth_ipv6_gtpu_ipv6[];
312 extern enum rte_flow_item_type pattern_eth_ipv6_gtpu_ipv6_udp[];
313 extern enum rte_flow_item_type pattern_eth_ipv6_gtpu_ipv6_tcp[];
314 extern enum rte_flow_item_type pattern_eth_ipv6_gtpu_ipv6_icmp[];
316 /* IPv4 GTPU EH IPv4 */
317 extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_eh_ipv4[];
318 extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_eh_ipv4_udp[];
319 extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_eh_ipv4_tcp[];
320 extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_eh_ipv4_icmp[];
322 /* IPv4 GTPU EH IPv6 */
323 extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_eh_ipv6[];
324 extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_eh_ipv6_udp[];
325 extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_eh_ipv6_tcp[];
326 extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_eh_ipv6_icmp[];
328 /* IPv6 GTPU EH IPv4 */
329 extern enum rte_flow_item_type pattern_eth_ipv6_gtpu_eh_ipv4[];
330 extern enum rte_flow_item_type pattern_eth_ipv6_gtpu_eh_ipv4_udp[];
331 extern enum rte_flow_item_type pattern_eth_ipv6_gtpu_eh_ipv4_tcp[];
332 extern enum rte_flow_item_type pattern_eth_ipv6_gtpu_eh_ipv4_icmp[];
334 /* IPv6 GTPU EH IPv6 */
335 extern enum rte_flow_item_type pattern_eth_ipv6_gtpu_eh_ipv6[];
336 extern enum rte_flow_item_type pattern_eth_ipv6_gtpu_eh_ipv6_udp[];
337 extern enum rte_flow_item_type pattern_eth_ipv6_gtpu_eh_ipv6_tcp[];
338 extern enum rte_flow_item_type pattern_eth_ipv6_gtpu_eh_ipv6_icmp[];
341 extern enum rte_flow_item_type pattern_eth_pppoed[];
342 extern enum rte_flow_item_type pattern_eth_vlan_pppoed[];
343 extern enum rte_flow_item_type pattern_eth_qinq_pppoed[];
344 extern enum rte_flow_item_type pattern_eth_pppoes[];
345 extern enum rte_flow_item_type pattern_eth_pppoes_proto[];
346 extern enum rte_flow_item_type pattern_eth_vlan_pppoes[];
347 extern enum rte_flow_item_type pattern_eth_vlan_pppoes_proto[];
348 extern enum rte_flow_item_type pattern_eth_qinq_pppoes[];
349 extern enum rte_flow_item_type pattern_eth_qinq_pppoes_proto[];
350 extern enum rte_flow_item_type pattern_eth_pppoes_ipv4[];
351 extern enum rte_flow_item_type pattern_eth_vlan_pppoes_ipv4[];
352 extern enum rte_flow_item_type pattern_eth_qinq_pppoes_ipv4[];
353 extern enum rte_flow_item_type pattern_eth_pppoes_ipv4_udp[];
354 extern enum rte_flow_item_type pattern_eth_vlan_pppoes_ipv4_udp[];
355 extern enum rte_flow_item_type pattern_eth_qinq_pppoes_ipv4_udp[];
356 extern enum rte_flow_item_type pattern_eth_pppoes_ipv4_tcp[];
357 extern enum rte_flow_item_type pattern_eth_vlan_pppoes_ipv4_tcp[];
358 extern enum rte_flow_item_type pattern_eth_qinq_pppoes_ipv4_tcp[];
359 extern enum rte_flow_item_type pattern_eth_pppoes_ipv4_sctp[];
360 extern enum rte_flow_item_type pattern_eth_vlan_pppoes_ipv4_sctp[];
361 extern enum rte_flow_item_type pattern_eth_qinq_pppoes_ipv4_sctp[];
362 extern enum rte_flow_item_type pattern_eth_pppoes_ipv4_icmp[];
363 extern enum rte_flow_item_type pattern_eth_vlan_pppoes_ipv4_icmp[];
364 extern enum rte_flow_item_type pattern_eth_qinq_pppoes_ipv4_icmp[];
365 extern enum rte_flow_item_type pattern_eth_pppoes_ipv6[];
366 extern enum rte_flow_item_type pattern_eth_vlan_pppoes_ipv6[];
367 extern enum rte_flow_item_type pattern_eth_qinq_pppoes_ipv6[];
368 extern enum rte_flow_item_type pattern_eth_pppoes_ipv6_udp[];
369 extern enum rte_flow_item_type pattern_eth_vlan_pppoes_ipv6_udp[];
370 extern enum rte_flow_item_type pattern_eth_qinq_pppoes_ipv6_udp[];
371 extern enum rte_flow_item_type pattern_eth_pppoes_ipv6_tcp[];
372 extern enum rte_flow_item_type pattern_eth_vlan_pppoes_ipv6_tcp[];
373 extern enum rte_flow_item_type pattern_eth_qinq_pppoes_ipv6_tcp[];
374 extern enum rte_flow_item_type pattern_eth_pppoes_ipv6_sctp[];
375 extern enum rte_flow_item_type pattern_eth_vlan_pppoes_ipv6_sctp[];
376 extern enum rte_flow_item_type pattern_eth_qinq_pppoes_ipv6_sctp[];
377 extern enum rte_flow_item_type pattern_eth_pppoes_ipv6_icmp6[];
378 extern enum rte_flow_item_type pattern_eth_vlan_pppoes_ipv6_icmp6[];
379 extern enum rte_flow_item_type pattern_eth_qinq_pppoes_ipv6_icmp6[];
382 extern enum rte_flow_item_type pattern_eth_ipv4_esp[];
383 extern enum rte_flow_item_type pattern_eth_ipv4_udp_esp[];
384 extern enum rte_flow_item_type pattern_eth_ipv6_esp[];
385 extern enum rte_flow_item_type pattern_eth_ipv6_udp_esp[];
388 extern enum rte_flow_item_type pattern_eth_ipv4_ah[];
389 extern enum rte_flow_item_type pattern_eth_ipv6_ah[];
390 extern enum rte_flow_item_type pattern_eth_ipv6_udp_ah[];
393 extern enum rte_flow_item_type pattern_eth_ipv4_l2tp[];
394 extern enum rte_flow_item_type pattern_eth_ipv6_l2tp[];
397 extern enum rte_flow_item_type pattern_eth_ipv4_pfcp[];
398 extern enum rte_flow_item_type pattern_eth_ipv6_pfcp[];
402 extern const struct rte_flow_ops ice_flow_ops;
405 enum ice_flow_engine_type {
406 ICE_FLOW_ENGINE_NONE = 0,
407 ICE_FLOW_ENGINE_FDIR,
408 ICE_FLOW_ENGINE_SWITCH,
409 ICE_FLOW_ENGINE_HASH,
415 * classification stages.
416 * for non-pipeline mode, we have two classification stages: Distributor/RSS
417 * for pipeline-mode we have three classification stages:
418 * Permission/Distributor/RSS
420 enum ice_flow_classification_stage {
421 ICE_FLOW_STAGE_NONE = 0,
423 ICE_FLOW_STAGE_PERMISSION,
424 ICE_FLOW_STAGE_DISTRIBUTOR,
427 /* pattern structure */
428 struct ice_pattern_match_item {
429 enum rte_flow_item_type *pattern_list;
430 /* pattern_list must end with RTE_FLOW_ITEM_TYPE_END */
431 uint64_t input_set_mask_o; /* used for tunnel outer or non tunnel fields */
432 uint64_t input_set_mask_i; /* only used for tunnel inner fields */
436 enum ice_flow_redirect_type {
437 ICE_FLOW_REDIRECT_VSI,
440 struct ice_flow_redirect {
441 enum ice_flow_redirect_type type;
445 uint16_t new_vsi_num;
450 typedef int (*engine_init_t)(struct ice_adapter *ad);
451 typedef void (*engine_uninit_t)(struct ice_adapter *ad);
452 typedef int (*engine_create_t)(struct ice_adapter *ad,
453 struct rte_flow *flow,
455 struct rte_flow_error *error);
456 typedef int (*engine_destroy_t)(struct ice_adapter *ad,
457 struct rte_flow *flow,
458 struct rte_flow_error *error);
459 typedef int (*engine_query_t)(struct ice_adapter *ad,
460 struct rte_flow *flow,
461 struct rte_flow_query_count *count,
462 struct rte_flow_error *error);
463 typedef int(*engine_redirect_t)(struct ice_adapter *ad,
464 struct rte_flow *flow,
465 struct ice_flow_redirect *redirect);
466 typedef void (*engine_free_t) (struct rte_flow *flow);
467 typedef int (*parse_pattern_action_t)(struct ice_adapter *ad,
468 struct ice_pattern_match_item *array,
470 const struct rte_flow_item pattern[],
471 const struct rte_flow_action actions[],
474 struct rte_flow_error *error);
476 /* Struct to store engine created. */
477 struct ice_flow_engine {
478 TAILQ_ENTRY(ice_flow_engine) node;
480 engine_uninit_t uninit;
481 engine_create_t create;
482 engine_destroy_t destroy;
483 engine_query_t query_count;
484 engine_redirect_t redirect;
486 enum ice_flow_engine_type type;
488 TAILQ_HEAD(ice_engine_list, ice_flow_engine);
490 /* Struct to store flow created. */
492 TAILQ_ENTRY(rte_flow) node;
493 struct ice_flow_engine *engine;
497 struct ice_flow_parser {
498 struct ice_flow_engine *engine;
499 struct ice_pattern_match_item *array;
501 parse_pattern_action_t parse_pattern_action;
502 enum ice_flow_classification_stage stage;
505 /* Struct to store parser created. */
506 struct ice_flow_parser_node {
507 TAILQ_ENTRY(ice_flow_parser_node) node;
508 struct ice_flow_parser *parser;
511 void ice_register_flow_engine(struct ice_flow_engine *engine);
512 int ice_flow_init(struct ice_adapter *ad);
513 void ice_flow_uninit(struct ice_adapter *ad);
514 int ice_register_parser(struct ice_flow_parser *parser,
515 struct ice_adapter *ad);
516 void ice_unregister_parser(struct ice_flow_parser *parser,
517 struct ice_adapter *ad);
518 struct ice_pattern_match_item *
519 ice_search_pattern_match_item(struct ice_adapter *ad,
520 const struct rte_flow_item pattern[],
521 struct ice_pattern_match_item *array,
523 struct rte_flow_error *error);
525 ice_flow_redirect(struct ice_adapter *ad,
526 struct ice_flow_redirect *rd);