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)
32 #define ICE_SMAC BIT_ULL(63)
33 #define ICE_DMAC BIT_ULL(62)
34 #define ICE_ETHERTYPE BIT_ULL(61)
35 #define ICE_IP_SRC BIT_ULL(60)
36 #define ICE_IP_DST BIT_ULL(59)
37 #define ICE_IP_PROTO BIT_ULL(58)
38 #define ICE_IP_TTL BIT_ULL(57)
39 #define ICE_IP_TOS BIT_ULL(56)
40 #define ICE_SPORT BIT_ULL(55)
41 #define ICE_DPORT BIT_ULL(54)
42 #define ICE_ICMP_TYPE BIT_ULL(53)
43 #define ICE_ICMP_CODE BIT_ULL(52)
44 #define ICE_VXLAN_VNI BIT_ULL(51)
45 #define ICE_NVGRE_TNI BIT_ULL(50)
46 #define ICE_GTPU_TEID BIT_ULL(49)
47 #define ICE_GTPU_QFI BIT_ULL(48)
48 #define ICE_PPPOE_SESSION BIT_ULL(47)
49 #define ICE_PPPOE_PROTO BIT_ULL(46)
50 #define ICE_ESP_SPI BIT_ULL(45)
51 #define ICE_AH_SPI BIT_ULL(44)
52 #define ICE_L2TPV3OIP_SESSION_ID BIT_ULL(43)
53 #define ICE_PFCP_SEID BIT_ULL(42)
54 #define ICE_PFCP_S_FIELD BIT_ULL(41)
58 #define ICE_INSET_NONE 0ULL
60 #define ICE_INSET_SMAC (ICE_SMAC)
61 #define ICE_INSET_DMAC (ICE_DMAC)
62 #define ICE_INSET_VLAN (ICE_PROT_VLAN)
63 #define ICE_INSET_VLAN_INNER (ICE_PROT_VLAN)
64 #define ICE_INSET_VLAN_OUTER (ICE_PROT_VLAN)
65 #define ICE_INSET_ETHERTYPE (ICE_ETHERTYPE)
67 #define ICE_INSET_IPV4_SRC (ICE_PROT_IPV4 | ICE_IP_SRC)
68 #define ICE_INSET_IPV4_DST (ICE_PROT_IPV4 | ICE_IP_DST)
69 #define ICE_INSET_IPV4_TOS (ICE_PROT_IPV4 | ICE_IP_TOS)
70 #define ICE_INSET_IPV4_PROTO (ICE_PROT_IPV4 | ICE_IP_PROTO)
71 #define ICE_INSET_IPV4_TTL (ICE_PROT_IPV4 | ICE_IP_TTL)
72 #define ICE_INSET_IPV6_SRC (ICE_PROT_IPV6 | ICE_IP_SRC)
73 #define ICE_INSET_IPV6_DST (ICE_PROT_IPV6 | ICE_IP_DST)
74 #define ICE_INSET_IPV6_NEXT_HDR (ICE_PROT_IPV6 | ICE_IP_PROTO)
75 #define ICE_INSET_IPV6_HOP_LIMIT (ICE_PROT_IPV6 | ICE_IP_TTL)
76 #define ICE_INSET_IPV6_TC (ICE_PROT_IPV6 | ICE_IP_TOS)
78 #define ICE_INSET_TCP_SRC_PORT (ICE_PROT_TCP | ICE_SPORT)
79 #define ICE_INSET_TCP_DST_PORT (ICE_PROT_TCP | ICE_DPORT)
80 #define ICE_INSET_UDP_SRC_PORT (ICE_PROT_UDP | ICE_SPORT)
81 #define ICE_INSET_UDP_DST_PORT (ICE_PROT_UDP | ICE_DPORT)
82 #define ICE_INSET_SCTP_SRC_PORT (ICE_PROT_SCTP | ICE_SPORT)
83 #define ICE_INSET_SCTP_DST_PORT (ICE_PROT_SCTP | ICE_DPORT)
84 #define ICE_INSET_ICMP4_SRC_PORT (ICE_PROT_ICMP4 | ICE_SPORT)
85 #define ICE_INSET_ICMP4_DST_PORT (ICE_PROT_ICMP4 | ICE_DPORT)
86 #define ICE_INSET_ICMP6_SRC_PORT (ICE_PROT_ICMP6 | ICE_SPORT)
87 #define ICE_INSET_ICMP6_DST_PORT (ICE_PROT_ICMP6 | ICE_DPORT)
88 #define ICE_INSET_ICMP4_TYPE (ICE_PROT_ICMP4 | ICE_ICMP_TYPE)
89 #define ICE_INSET_ICMP4_CODE (ICE_PROT_ICMP4 | ICE_ICMP_CODE)
90 #define ICE_INSET_ICMP6_TYPE (ICE_PROT_ICMP6 | ICE_ICMP_TYPE)
91 #define ICE_INSET_ICMP6_CODE (ICE_PROT_ICMP6 | ICE_ICMP_CODE)
95 #define ICE_INSET_TUN_SMAC \
96 (ICE_PROT_MAC | ICE_SMAC)
97 #define ICE_INSET_TUN_DMAC \
98 (ICE_PROT_MAC | ICE_DMAC)
100 #define ICE_INSET_TUN_IPV4_SRC \
101 (ICE_PROT_IPV4 | ICE_IP_SRC)
102 #define ICE_INSET_TUN_IPV4_DST \
103 (ICE_PROT_IPV4 | ICE_IP_DST)
104 #define ICE_INSET_TUN_IPV4_TTL \
105 (ICE_PROT_IPV4 | ICE_IP_TTL)
106 #define ICE_INSET_TUN_IPV4_PROTO \
107 (ICE_PROT_IPV4 | ICE_IP_PROTO)
108 #define ICE_INSET_TUN_IPV4_TOS \
109 (ICE_PROT_IPV4 | ICE_IP_TOS)
110 #define ICE_INSET_TUN_IPV6_SRC \
111 (ICE_PROT_IPV6 | ICE_IP_SRC)
112 #define ICE_INSET_TUN_IPV6_DST \
113 (ICE_PROT_IPV6 | ICE_IP_DST)
114 #define ICE_INSET_TUN_IPV6_HOP_LIMIT \
115 (ICE_PROT_IPV6 | ICE_IP_TTL)
116 #define ICE_INSET_TUN_IPV6_NEXT_HDR \
117 (ICE_PROT_IPV6 | ICE_IP_PROTO)
118 #define ICE_INSET_TUN_IPV6_TC \
119 (ICE_PROT_IPV6 | ICE_IP_TOS)
121 #define ICE_INSET_TUN_TCP_SRC_PORT \
122 (ICE_PROT_TCP | ICE_SPORT)
123 #define ICE_INSET_TUN_TCP_DST_PORT \
124 (ICE_PROT_TCP | ICE_DPORT)
125 #define ICE_INSET_TUN_UDP_SRC_PORT \
126 (ICE_PROT_UDP | ICE_SPORT)
127 #define ICE_INSET_TUN_UDP_DST_PORT \
128 (ICE_PROT_UDP | ICE_DPORT)
129 #define ICE_INSET_TUN_SCTP_SRC_PORT \
130 (ICE_PROT_SCTP | ICE_SPORT)
131 #define ICE_INSET_TUN_SCTP_DST_PORT \
132 (ICE_PROT_SCTP | ICE_DPORT)
133 #define ICE_INSET_TUN_ICMP4_SRC_PORT \
134 (ICE_PROT_ICMP4 | ICE_SPORT)
135 #define ICE_INSET_TUN_ICMP4_DST_PORT \
136 (ICE_PROT_ICMP4 | ICE_DPORT)
137 #define ICE_INSET_TUN_ICMP6_SRC_PORT \
138 (ICE_PROT_ICMP6 | ICE_SPORT)
139 #define ICE_INSET_TUN_ICMP6_DST_PORT \
140 (ICE_PROT_ICMP6 | ICE_DPORT)
141 #define ICE_INSET_TUN_ICMP4_TYPE \
142 (ICE_PROT_ICMP4 | ICE_ICMP_TYPE)
143 #define ICE_INSET_TUN_ICMP4_CODE \
144 (ICE_PROT_ICMP4 | ICE_ICMP_CODE)
145 #define ICE_INSET_TUN_ICMP6_TYPE \
146 (ICE_PROT_ICMP6 | ICE_ICMP_TYPE)
147 #define ICE_INSET_TUN_ICMP6_CODE \
148 (ICE_PROT_ICMP6 | ICE_ICMP_CODE)
150 #define ICE_INSET_TUN_VXLAN_VNI \
151 (ICE_PROT_VXLAN | ICE_VXLAN_VNI)
152 #define ICE_INSET_TUN_NVGRE_TNI \
153 (ICE_PROT_NVGRE | ICE_NVGRE_TNI)
154 #define ICE_INSET_GTPU_TEID \
155 (ICE_PROT_GTPU | ICE_GTPU_TEID)
156 #define ICE_INSET_GTPU_QFI \
157 (ICE_PROT_GTPU | ICE_GTPU_QFI)
158 #define ICE_INSET_PPPOE_SESSION \
159 (ICE_PROT_PPPOE_S | ICE_PPPOE_SESSION)
160 #define ICE_INSET_PPPOE_PROTO \
161 (ICE_PROT_PPPOE_S | ICE_PPPOE_PROTO)
162 #define ICE_INSET_ESP_SPI \
163 (ICE_PROT_ESP | ICE_ESP_SPI)
164 #define ICE_INSET_AH_SPI \
165 (ICE_PROT_AH | ICE_AH_SPI)
166 #define ICE_INSET_L2TPV3OIP_SESSION_ID \
167 (ICE_PROT_L2TPV3OIP | ICE_L2TPV3OIP_SESSION_ID)
168 #define ICE_INSET_PFCP_S_FIELD \
169 (ICE_PROT_PFCP | ICE_PFCP_S_FIELD)
170 #define ICE_INSET_PFCP_SEID \
171 (ICE_PROT_PFCP | ICE_PFCP_S_FIELD | ICE_PFCP_SEID)
174 extern enum rte_flow_item_type pattern_empty[];
177 extern enum rte_flow_item_type pattern_ethertype[];
178 extern enum rte_flow_item_type pattern_ethertype_vlan[];
179 extern enum rte_flow_item_type pattern_ethertype_qinq[];
182 extern enum rte_flow_item_type pattern_eth_arp[];
184 /* non-tunnel IPv4 */
185 extern enum rte_flow_item_type pattern_eth_ipv4[];
186 extern enum rte_flow_item_type pattern_eth_vlan_ipv4[];
187 extern enum rte_flow_item_type pattern_eth_qinq_ipv4[];
188 extern enum rte_flow_item_type pattern_eth_ipv4_udp[];
189 extern enum rte_flow_item_type pattern_eth_vlan_ipv4_udp[];
190 extern enum rte_flow_item_type pattern_eth_qinq_ipv4_udp[];
191 extern enum rte_flow_item_type pattern_eth_ipv4_tcp[];
192 extern enum rte_flow_item_type pattern_eth_vlan_ipv4_tcp[];
193 extern enum rte_flow_item_type pattern_eth_qinq_ipv4_tcp[];
194 extern enum rte_flow_item_type pattern_eth_ipv4_sctp[];
195 extern enum rte_flow_item_type pattern_eth_vlan_ipv4_sctp[];
196 extern enum rte_flow_item_type pattern_eth_qinq_ipv4_sctp[];
197 extern enum rte_flow_item_type pattern_eth_ipv4_icmp[];
198 extern enum rte_flow_item_type pattern_eth_vlan_ipv4_icmp[];
199 extern enum rte_flow_item_type pattern_eth_qinq_ipv4_icmp[];
201 /* non-tunnel IPv6 */
202 extern enum rte_flow_item_type pattern_eth_ipv6[];
203 extern enum rte_flow_item_type pattern_eth_vlan_ipv6[];
204 extern enum rte_flow_item_type pattern_eth_qinq_ipv6[];
205 extern enum rte_flow_item_type pattern_eth_ipv6_udp[];
206 extern enum rte_flow_item_type pattern_eth_vlan_ipv6_udp[];
207 extern enum rte_flow_item_type pattern_eth_qinq_ipv6_udp[];
208 extern enum rte_flow_item_type pattern_eth_ipv6_tcp[];
209 extern enum rte_flow_item_type pattern_eth_vlan_ipv6_tcp[];
210 extern enum rte_flow_item_type pattern_eth_qinq_ipv6_tcp[];
211 extern enum rte_flow_item_type pattern_eth_ipv6_sctp[];
212 extern enum rte_flow_item_type pattern_eth_vlan_ipv6_sctp[];
213 extern enum rte_flow_item_type pattern_eth_qinq_ipv6_sctp[];
214 extern enum rte_flow_item_type pattern_eth_ipv6_icmp6[];
215 extern enum rte_flow_item_type pattern_eth_vlan_ipv6_icmp6[];
216 extern enum rte_flow_item_type pattern_eth_qinq_ipv6_icmp6[];
218 /* IPv4 VXLAN IPv4 */
219 extern enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_ipv4[];
220 extern enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_ipv4_udp[];
221 extern enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_ipv4_tcp[];
222 extern enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_ipv4_sctp[];
223 extern enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_ipv4_icmp[];
225 /* IPv4 VXLAN MAC IPv4 */
226 extern enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_eth_ipv4[];
227 extern enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_eth_ipv4_udp[];
228 extern enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_eth_ipv4_tcp[];
229 extern enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_eth_ipv4_sctp[];
230 extern enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_eth_ipv4_icmp[];
232 /* IPv6 VXLAN IPv4 */
233 extern enum rte_flow_item_type pattern_eth_ipv6_udp_vxlan_ipv4[];
234 extern enum rte_flow_item_type pattern_eth_ipv6_udp_vxlan_ipv4_tcp[];
235 extern enum rte_flow_item_type pattern_eth_ipv6_udp_vxlan_ipv4_udp[];
236 extern enum rte_flow_item_type pattern_eth_ipv6_udp_vxlan_ipv4_sctp[];
237 extern enum rte_flow_item_type pattern_eth_ipv6_udp_vxlan_ipv4_icmp[];
239 /* IPv6 VXLAN MAC IPv4 */
240 extern enum rte_flow_item_type pattern_eth_ipv6_udp_vxlan_eth_ipv4[];
241 extern enum rte_flow_item_type pattern_eth_ipv6_udp_vxlan_eth_ipv4_tcp[];
242 extern enum rte_flow_item_type pattern_eth_ipv6_udp_vxlan_eth_ipv4_udp[];
243 extern enum rte_flow_item_type pattern_eth_ipv6_udp_vxlan_eth_ipv4_sctp[];
244 extern enum rte_flow_item_type pattern_eth_ipv6_udp_vxlan_eth_ipv4_icmp[];
246 /* IPv4 VXLAN IPv6 */
247 extern enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_ipv6[];
248 extern enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_ipv6_udp[];
249 extern enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_ipv6_tcp[];
250 extern enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_ipv6_sctp[];
251 extern enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_ipv6_icmp6[];
253 /* IPv4 VXLAN MAC IPv6 */
254 extern enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_eth_ipv6[];
255 extern enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_eth_ipv6_udp[];
256 extern enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_eth_ipv6_tcp[];
257 extern enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_eth_ipv6_sctp[];
258 extern enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_eth_ipv6_icmp6[];
260 /* IPv6 VXLAN IPv6 */
261 extern enum rte_flow_item_type pattern_eth_ipv6_udp_vxlan_ipv6[];
262 extern enum rte_flow_item_type pattern_eth_ipv6_udp_vxlan_ipv6_tcp[];
263 extern enum rte_flow_item_type pattern_eth_ipv6_udp_vxlan_ipv6_udp[];
264 extern enum rte_flow_item_type pattern_eth_ipv6_udp_vxlan_ipv6_sctp[];
265 extern enum rte_flow_item_type pattern_eth_ipv6_udp_vxlan_ipv6_icmp6[];
267 /* IPv6 VXLAN MAC IPv6 */
268 extern enum rte_flow_item_type pattern_eth_ipv6_udp_vxlan_eth_ipv6[];
269 extern enum rte_flow_item_type pattern_eth_ipv6_udp_vxlan_eth_ipv6_tcp[];
270 extern enum rte_flow_item_type pattern_eth_ipv6_udp_vxlan_eth_ipv6_udp[];
271 extern enum rte_flow_item_type pattern_eth_ipv6_udp_vxlan_eth_ipv6_sctp[];
272 extern enum rte_flow_item_type pattern_eth_ipv6_udp_vxlan_eth_ipv6_icmp6[];
274 /* IPv4 NVGRE IPv4 */
275 extern enum rte_flow_item_type pattern_eth_ipv4_nvgre_ipv4[];
276 extern enum rte_flow_item_type pattern_eth_ipv4_nvgre_ipv4_udp[];
277 extern enum rte_flow_item_type pattern_eth_ipv4_nvgre_ipv4_tcp[];
278 extern enum rte_flow_item_type pattern_eth_ipv4_nvgre_ipv4_sctp[];
279 extern enum rte_flow_item_type pattern_eth_ipv4_nvgre_ipv4_icmp[];
281 /* IPv4 NVGRE MAC IPv4 */
282 extern enum rte_flow_item_type pattern_eth_ipv4_nvgre_eth_ipv4[];
283 extern enum rte_flow_item_type pattern_eth_ipv4_nvgre_eth_ipv4_udp[];
284 extern enum rte_flow_item_type pattern_eth_ipv4_nvgre_eth_ipv4_tcp[];
285 extern enum rte_flow_item_type pattern_eth_ipv4_nvgre_eth_ipv4_sctp[];
286 extern enum rte_flow_item_type pattern_eth_ipv4_nvgre_eth_ipv4_icmp[];
288 /* IPv6 NVGRE IPv4 */
289 extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_ipv4[];
290 extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_ipv4_tcp[];
291 extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_ipv4_udp[];
292 extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_ipv4_sctp[];
293 extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_ipv4_icmp[];
295 /* IPv6 NVGRE MAC IPv4 */
296 extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_eth_ipv4[];
297 extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_eth_ipv4_tcp[];
298 extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_eth_ipv4_udp[];
299 extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_eth_ipv4_sctp[];
300 extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_eth_ipv4_icmp[];
302 /* IPv4 NVGRE IPv6 */
303 extern enum rte_flow_item_type pattern_eth_ipv4_nvgre_ipv6[];
304 extern enum rte_flow_item_type pattern_eth_ipv4_nvgre_ipv6_udp[];
305 extern enum rte_flow_item_type pattern_eth_ipv4_nvgre_ipv6_tcp[];
306 extern enum rte_flow_item_type pattern_eth_ipv4_nvgre_ipv6_sctp[];
307 extern enum rte_flow_item_type pattern_eth_ipv4_nvgre_ipv6_icmp6[];
309 /* IPv4 NVGRE MAC IPv6 */
310 extern enum rte_flow_item_type pattern_eth_ipv4_nvgre_eth_ipv6[];
311 extern enum rte_flow_item_type pattern_eth_ipv4_nvgre_eth_ipv6_udp[];
312 extern enum rte_flow_item_type pattern_eth_ipv4_nvgre_eth_ipv6_tcp[];
313 extern enum rte_flow_item_type pattern_eth_ipv4_nvgre_eth_ipv6_sctp[];
314 extern enum rte_flow_item_type pattern_eth_ipv4_nvgre_eth_ipv6_icmp6[];
316 /* IPv6 NVGRE IPv6 */
317 extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_ipv6[];
318 extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_ipv6_tcp[];
319 extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_ipv6_udp[];
320 extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_ipv6_sctp[];
321 extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_ipv6_icmp6[];
323 /* IPv6 NVGRE MAC IPv6 */
324 extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_eth_ipv6[];
325 extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_eth_ipv6_tcp[];
326 extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_eth_ipv6_udp[];
327 extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_eth_ipv6_sctp[];
328 extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_eth_ipv6_icmp6[];
331 extern enum rte_flow_item_type pattern_eth_ipv4_gtpu[];
332 extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_eh[];
335 extern enum rte_flow_item_type pattern_eth_ipv6_gtpu[];
336 extern enum rte_flow_item_type pattern_eth_ipv6_gtpu_eh[];
339 extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_ipv4[];
340 extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_ipv4_udp[];
341 extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_ipv4_tcp[];
342 extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_ipv4_icmp[];
345 extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_ipv6[];
346 extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_ipv6_udp[];
347 extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_ipv6_tcp[];
348 extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_ipv6_icmp[];
351 extern enum rte_flow_item_type pattern_eth_ipv6_gtpu_ipv4[];
352 extern enum rte_flow_item_type pattern_eth_ipv6_gtpu_ipv4_udp[];
353 extern enum rte_flow_item_type pattern_eth_ipv6_gtpu_ipv4_tcp[];
354 extern enum rte_flow_item_type pattern_eth_ipv6_gtpu_ipv4_icmp[];
357 extern enum rte_flow_item_type pattern_eth_ipv6_gtpu_ipv6[];
358 extern enum rte_flow_item_type pattern_eth_ipv6_gtpu_ipv6_udp[];
359 extern enum rte_flow_item_type pattern_eth_ipv6_gtpu_ipv6_tcp[];
360 extern enum rte_flow_item_type pattern_eth_ipv6_gtpu_ipv6_icmp[];
362 /* IPv4 GTPU EH IPv4 */
363 extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_eh_ipv4[];
364 extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_eh_ipv4_udp[];
365 extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_eh_ipv4_tcp[];
366 extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_eh_ipv4_icmp[];
368 /* IPv4 GTPU EH IPv6 */
369 extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_eh_ipv6[];
370 extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_eh_ipv6_udp[];
371 extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_eh_ipv6_tcp[];
372 extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_eh_ipv6_icmp[];
374 /* IPv6 GTPU EH IPv4 */
375 extern enum rte_flow_item_type pattern_eth_ipv6_gtpu_eh_ipv4[];
376 extern enum rte_flow_item_type pattern_eth_ipv6_gtpu_eh_ipv4_udp[];
377 extern enum rte_flow_item_type pattern_eth_ipv6_gtpu_eh_ipv4_tcp[];
378 extern enum rte_flow_item_type pattern_eth_ipv6_gtpu_eh_ipv4_icmp[];
380 /* IPv6 GTPU EH IPv6 */
381 extern enum rte_flow_item_type pattern_eth_ipv6_gtpu_eh_ipv6[];
382 extern enum rte_flow_item_type pattern_eth_ipv6_gtpu_eh_ipv6_udp[];
383 extern enum rte_flow_item_type pattern_eth_ipv6_gtpu_eh_ipv6_tcp[];
384 extern enum rte_flow_item_type pattern_eth_ipv6_gtpu_eh_ipv6_icmp[];
387 extern enum rte_flow_item_type pattern_eth_pppoed[];
388 extern enum rte_flow_item_type pattern_eth_vlan_pppoed[];
389 extern enum rte_flow_item_type pattern_eth_qinq_pppoed[];
390 extern enum rte_flow_item_type pattern_eth_pppoes[];
391 extern enum rte_flow_item_type pattern_eth_pppoes_proto[];
392 extern enum rte_flow_item_type pattern_eth_vlan_pppoes[];
393 extern enum rte_flow_item_type pattern_eth_vlan_pppoes_proto[];
394 extern enum rte_flow_item_type pattern_eth_qinq_pppoes[];
395 extern enum rte_flow_item_type pattern_eth_qinq_pppoes_proto[];
396 extern enum rte_flow_item_type pattern_eth_pppoes_ipv4[];
397 extern enum rte_flow_item_type pattern_eth_vlan_pppoes_ipv4[];
398 extern enum rte_flow_item_type pattern_eth_qinq_pppoes_ipv4[];
399 extern enum rte_flow_item_type pattern_eth_pppoes_ipv4_udp[];
400 extern enum rte_flow_item_type pattern_eth_vlan_pppoes_ipv4_udp[];
401 extern enum rte_flow_item_type pattern_eth_qinq_pppoes_ipv4_udp[];
402 extern enum rte_flow_item_type pattern_eth_pppoes_ipv4_tcp[];
403 extern enum rte_flow_item_type pattern_eth_vlan_pppoes_ipv4_tcp[];
404 extern enum rte_flow_item_type pattern_eth_qinq_pppoes_ipv4_tcp[];
405 extern enum rte_flow_item_type pattern_eth_pppoes_ipv4_sctp[];
406 extern enum rte_flow_item_type pattern_eth_vlan_pppoes_ipv4_sctp[];
407 extern enum rte_flow_item_type pattern_eth_qinq_pppoes_ipv4_sctp[];
408 extern enum rte_flow_item_type pattern_eth_pppoes_ipv4_icmp[];
409 extern enum rte_flow_item_type pattern_eth_vlan_pppoes_ipv4_icmp[];
410 extern enum rte_flow_item_type pattern_eth_qinq_pppoes_ipv4_icmp[];
411 extern enum rte_flow_item_type pattern_eth_pppoes_ipv6[];
412 extern enum rte_flow_item_type pattern_eth_vlan_pppoes_ipv6[];
413 extern enum rte_flow_item_type pattern_eth_qinq_pppoes_ipv6[];
414 extern enum rte_flow_item_type pattern_eth_pppoes_ipv6_udp[];
415 extern enum rte_flow_item_type pattern_eth_vlan_pppoes_ipv6_udp[];
416 extern enum rte_flow_item_type pattern_eth_qinq_pppoes_ipv6_udp[];
417 extern enum rte_flow_item_type pattern_eth_pppoes_ipv6_tcp[];
418 extern enum rte_flow_item_type pattern_eth_vlan_pppoes_ipv6_tcp[];
419 extern enum rte_flow_item_type pattern_eth_qinq_pppoes_ipv6_tcp[];
420 extern enum rte_flow_item_type pattern_eth_pppoes_ipv6_sctp[];
421 extern enum rte_flow_item_type pattern_eth_vlan_pppoes_ipv6_sctp[];
422 extern enum rte_flow_item_type pattern_eth_qinq_pppoes_ipv6_sctp[];
423 extern enum rte_flow_item_type pattern_eth_pppoes_ipv6_icmp6[];
424 extern enum rte_flow_item_type pattern_eth_vlan_pppoes_ipv6_icmp6[];
425 extern enum rte_flow_item_type pattern_eth_qinq_pppoes_ipv6_icmp6[];
428 extern enum rte_flow_item_type pattern_eth_ipv4_esp[];
429 extern enum rte_flow_item_type pattern_eth_ipv4_udp_esp[];
430 extern enum rte_flow_item_type pattern_eth_ipv6_esp[];
431 extern enum rte_flow_item_type pattern_eth_ipv6_udp_esp[];
434 extern enum rte_flow_item_type pattern_eth_ipv4_ah[];
435 extern enum rte_flow_item_type pattern_eth_ipv6_ah[];
436 extern enum rte_flow_item_type pattern_eth_ipv6_udp_ah[];
439 extern enum rte_flow_item_type pattern_eth_ipv4_l2tp[];
440 extern enum rte_flow_item_type pattern_eth_ipv6_l2tp[];
443 extern enum rte_flow_item_type pattern_eth_ipv4_pfcp[];
444 extern enum rte_flow_item_type pattern_eth_ipv6_pfcp[];
448 extern const struct rte_flow_ops ice_flow_ops;
451 enum ice_flow_engine_type {
452 ICE_FLOW_ENGINE_NONE = 0,
453 ICE_FLOW_ENGINE_FDIR,
454 ICE_FLOW_ENGINE_SWITCH,
455 ICE_FLOW_ENGINE_HASH,
461 * classification stages.
462 * for non-pipeline mode, we have two classification stages: Distributor/RSS
463 * for pipeline-mode we have three classification stages:
464 * Permission/Distributor/RSS
466 enum ice_flow_classification_stage {
467 ICE_FLOW_STAGE_NONE = 0,
469 ICE_FLOW_STAGE_PERMISSION,
470 ICE_FLOW_STAGE_DISTRIBUTOR,
473 /* pattern structure */
474 struct ice_pattern_match_item {
475 enum rte_flow_item_type *pattern_list;
476 uint64_t input_set_mask_o; /* used for tunnel outer or non tunnel fields */
477 /* pattern_list must end with RTE_FLOW_ITEM_TYPE_END */
478 uint64_t input_set_mask_i; /* only used for tunnel inner fields */
482 enum ice_flow_redirect_type {
483 ICE_FLOW_REDIRECT_VSI,
486 struct ice_flow_redirect {
487 enum ice_flow_redirect_type type;
491 uint16_t new_vsi_num;
496 typedef int (*engine_init_t)(struct ice_adapter *ad);
497 typedef void (*engine_uninit_t)(struct ice_adapter *ad);
498 typedef int (*engine_create_t)(struct ice_adapter *ad,
499 struct rte_flow *flow,
501 struct rte_flow_error *error);
502 typedef int (*engine_destroy_t)(struct ice_adapter *ad,
503 struct rte_flow *flow,
504 struct rte_flow_error *error);
505 typedef int (*engine_query_t)(struct ice_adapter *ad,
506 struct rte_flow *flow,
507 struct rte_flow_query_count *count,
508 struct rte_flow_error *error);
509 typedef int(*engine_redirect_t)(struct ice_adapter *ad,
510 struct rte_flow *flow,
511 struct ice_flow_redirect *redirect);
512 typedef void (*engine_free_t) (struct rte_flow *flow);
513 typedef int (*parse_pattern_action_t)(struct ice_adapter *ad,
514 struct ice_pattern_match_item *array,
516 const struct rte_flow_item pattern[],
517 const struct rte_flow_action actions[],
519 struct rte_flow_error *error);
521 /* Struct to store engine created. */
522 struct ice_flow_engine {
523 TAILQ_ENTRY(ice_flow_engine) node;
525 engine_uninit_t uninit;
526 engine_create_t create;
527 engine_destroy_t destroy;
528 engine_query_t query_count;
529 engine_redirect_t redirect;
531 enum ice_flow_engine_type type;
533 TAILQ_HEAD(ice_engine_list, ice_flow_engine);
535 /* Struct to store flow created. */
537 TAILQ_ENTRY(rte_flow) node;
538 struct ice_flow_engine *engine;
542 struct ice_flow_parser {
543 struct ice_flow_engine *engine;
544 struct ice_pattern_match_item *array;
546 parse_pattern_action_t parse_pattern_action;
547 enum ice_flow_classification_stage stage;
550 /* Struct to store parser created. */
551 struct ice_flow_parser_node {
552 TAILQ_ENTRY(ice_flow_parser_node) node;
553 struct ice_flow_parser *parser;
556 void ice_register_flow_engine(struct ice_flow_engine *engine);
557 int ice_flow_init(struct ice_adapter *ad);
558 void ice_flow_uninit(struct ice_adapter *ad);
559 int ice_register_parser(struct ice_flow_parser *parser,
560 struct ice_adapter *ad);
561 void ice_unregister_parser(struct ice_flow_parser *parser,
562 struct ice_adapter *ad);
563 struct ice_pattern_match_item *
564 ice_search_pattern_match_item(struct ice_adapter *ad,
565 const struct rte_flow_item pattern[],
566 struct ice_pattern_match_item *array,
568 struct rte_flow_error *error);
570 ice_flow_redirect(struct ice_adapter *ad,
571 struct ice_flow_redirect *rd);