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_INNER (1ULL << 1)
13 #define ICE_PROT_MAC_OUTER (1ULL << 2)
14 #define ICE_PROT_VLAN_INNER (1ULL << 3)
15 #define ICE_PROT_VLAN_OUTER (1ULL << 4)
16 #define ICE_PROT_IPV4_INNER (1ULL << 5)
17 #define ICE_PROT_IPV4_OUTER (1ULL << 6)
18 #define ICE_PROT_IPV6_INNER (1ULL << 7)
19 #define ICE_PROT_IPV6_OUTER (1ULL << 8)
20 #define ICE_PROT_TCP_INNER (1ULL << 9)
21 #define ICE_PROT_TCP_OUTER (1ULL << 10)
22 #define ICE_PROT_UDP_INNER (1ULL << 11)
23 #define ICE_PROT_UDP_OUTER (1ULL << 12)
24 #define ICE_PROT_SCTP_INNER (1ULL << 13)
25 #define ICE_PROT_SCTP_OUTER (1ULL << 14)
26 #define ICE_PROT_ICMP4_INNER (1ULL << 15)
27 #define ICE_PROT_ICMP4_OUTER (1ULL << 16)
28 #define ICE_PROT_ICMP6_INNER (1ULL << 17)
29 #define ICE_PROT_ICMP6_OUTER (1ULL << 18)
30 #define ICE_PROT_VXLAN (1ULL << 19)
31 #define ICE_PROT_NVGRE (1ULL << 20)
32 #define ICE_PROT_GTPU (1ULL << 21)
33 #define ICE_PROT_PPPOE_S (1ULL << 22)
34 #define ICE_PROT_ESP (1ULL << 23)
35 #define ICE_PROT_AH (1ULL << 24)
36 #define ICE_PROT_L2TPV3OIP (1ULL << 25)
37 #define ICE_PROT_PFCP (1ULL << 26)
41 #define ICE_SMAC (1ULL << 63)
42 #define ICE_DMAC (1ULL << 62)
43 #define ICE_ETHERTYPE (1ULL << 61)
44 #define ICE_IP_SRC (1ULL << 60)
45 #define ICE_IP_DST (1ULL << 59)
46 #define ICE_IP_PROTO (1ULL << 58)
47 #define ICE_IP_TTL (1ULL << 57)
48 #define ICE_IP_TOS (1ULL << 56)
49 #define ICE_SPORT (1ULL << 55)
50 #define ICE_DPORT (1ULL << 54)
51 #define ICE_ICMP_TYPE (1ULL << 53)
52 #define ICE_ICMP_CODE (1ULL << 52)
53 #define ICE_VXLAN_VNI (1ULL << 51)
54 #define ICE_NVGRE_TNI (1ULL << 50)
55 #define ICE_GTPU_TEID (1ULL << 49)
56 #define ICE_GTPU_QFI (1ULL << 48)
57 #define ICE_PPPOE_SESSION (1ULL << 47)
58 #define ICE_PPPOE_PROTO (1ULL << 46)
59 #define ICE_ESP_SPI (1ULL << 45)
60 #define ICE_AH_SPI (1ULL << 44)
61 #define ICE_L2TPV3OIP_SESSION_ID (1ULL << 43)
62 #define ICE_PFCP_SEID (1ULL << 42)
63 #define ICE_PFCP_S_FIELD (1ULL << 41)
67 #define ICE_INSET_NONE 0ULL
71 #define ICE_INSET_SMAC (ICE_PROT_MAC_OUTER | ICE_SMAC)
72 #define ICE_INSET_DMAC (ICE_PROT_MAC_OUTER | ICE_DMAC)
73 #define ICE_INSET_VLAN_INNER (ICE_PROT_VLAN_INNER)
74 #define ICE_INSET_VLAN_OUTER (ICE_PROT_VLAN_OUTER)
75 #define ICE_INSET_ETHERTYPE (ICE_ETHERTYPE)
77 #define ICE_INSET_IPV4_SRC \
78 (ICE_PROT_IPV4_OUTER | ICE_IP_SRC)
79 #define ICE_INSET_IPV4_DST \
80 (ICE_PROT_IPV4_OUTER | ICE_IP_DST)
81 #define ICE_INSET_IPV4_TOS \
82 (ICE_PROT_IPV4_OUTER | ICE_IP_TOS)
83 #define ICE_INSET_IPV4_PROTO \
84 (ICE_PROT_IPV4_OUTER | ICE_IP_PROTO)
85 #define ICE_INSET_IPV4_TTL \
86 (ICE_PROT_IPV4_OUTER | ICE_IP_TTL)
87 #define ICE_INSET_IPV6_SRC \
88 (ICE_PROT_IPV6_OUTER | ICE_IP_SRC)
89 #define ICE_INSET_IPV6_DST \
90 (ICE_PROT_IPV6_OUTER | ICE_IP_DST)
91 #define ICE_INSET_IPV6_NEXT_HDR \
92 (ICE_PROT_IPV6_OUTER | ICE_IP_PROTO)
93 #define ICE_INSET_IPV6_HOP_LIMIT \
94 (ICE_PROT_IPV6_OUTER | ICE_IP_TTL)
95 #define ICE_INSET_IPV6_TC \
96 (ICE_PROT_IPV6_OUTER | ICE_IP_TOS)
98 #define ICE_INSET_TCP_SRC_PORT \
99 (ICE_PROT_TCP_OUTER | ICE_SPORT)
100 #define ICE_INSET_TCP_DST_PORT \
101 (ICE_PROT_TCP_OUTER | ICE_DPORT)
102 #define ICE_INSET_UDP_SRC_PORT \
103 (ICE_PROT_UDP_OUTER | ICE_SPORT)
104 #define ICE_INSET_UDP_DST_PORT \
105 (ICE_PROT_UDP_OUTER | ICE_DPORT)
106 #define ICE_INSET_SCTP_SRC_PORT \
107 (ICE_PROT_SCTP_OUTER | ICE_SPORT)
108 #define ICE_INSET_SCTP_DST_PORT \
109 (ICE_PROT_SCTP_OUTER | ICE_DPORT)
110 #define ICE_INSET_ICMP4_SRC_PORT \
111 (ICE_PROT_ICMP4_OUTER | ICE_SPORT)
112 #define ICE_INSET_ICMP4_DST_PORT \
113 (ICE_PROT_ICMP4_OUTER | ICE_DPORT)
114 #define ICE_INSET_ICMP6_SRC_PORT \
115 (ICE_PROT_ICMP6_OUTER | ICE_SPORT)
116 #define ICE_INSET_ICMP6_DST_PORT \
117 (ICE_PROT_ICMP6_OUTER | ICE_DPORT)
118 #define ICE_INSET_ICMP4_TYPE \
119 (ICE_PROT_ICMP4_OUTER | ICE_ICMP_TYPE)
120 #define ICE_INSET_ICMP4_CODE \
121 (ICE_PROT_ICMP4_OUTER | ICE_ICMP_CODE)
122 #define ICE_INSET_ICMP6_TYPE \
123 (ICE_PROT_ICMP6_OUTER | ICE_ICMP_TYPE)
124 #define ICE_INSET_ICMP6_CODE \
125 (ICE_PROT_ICMP6_OUTER | ICE_ICMP_CODE)
129 #define ICE_INSET_TUN_SMAC \
130 (ICE_PROT_MAC_INNER | ICE_SMAC)
131 #define ICE_INSET_TUN_DMAC \
132 (ICE_PROT_MAC_INNER | ICE_DMAC)
134 #define ICE_INSET_TUN_IPV4_SRC \
135 (ICE_PROT_IPV4_INNER | ICE_IP_SRC)
136 #define ICE_INSET_TUN_IPV4_DST \
137 (ICE_PROT_IPV4_INNER | ICE_IP_DST)
138 #define ICE_INSET_TUN_IPV4_TTL \
139 (ICE_PROT_IPV4_INNER | ICE_IP_TTL)
140 #define ICE_INSET_TUN_IPV4_PROTO \
141 (ICE_PROT_IPV4_INNER | ICE_IP_PROTO)
142 #define ICE_INSET_TUN_IPV4_TOS \
143 (ICE_PROT_IPV4_INNER | ICE_IP_TOS)
144 #define ICE_INSET_TUN_IPV6_SRC \
145 (ICE_PROT_IPV6_INNER | ICE_IP_SRC)
146 #define ICE_INSET_TUN_IPV6_DST \
147 (ICE_PROT_IPV6_INNER | ICE_IP_DST)
148 #define ICE_INSET_TUN_IPV6_HOP_LIMIT \
149 (ICE_PROT_IPV6_INNER | ICE_IP_TTL)
150 #define ICE_INSET_TUN_IPV6_NEXT_HDR \
151 (ICE_PROT_IPV6_INNER | ICE_IP_PROTO)
152 #define ICE_INSET_TUN_IPV6_TC \
153 (ICE_PROT_IPV6_INNER | ICE_IP_TOS)
155 #define ICE_INSET_TUN_TCP_SRC_PORT \
156 (ICE_PROT_TCP_INNER | ICE_SPORT)
157 #define ICE_INSET_TUN_TCP_DST_PORT \
158 (ICE_PROT_TCP_INNER | ICE_DPORT)
159 #define ICE_INSET_TUN_UDP_SRC_PORT \
160 (ICE_PROT_UDP_INNER | ICE_SPORT)
161 #define ICE_INSET_TUN_UDP_DST_PORT \
162 (ICE_PROT_UDP_INNER | ICE_DPORT)
163 #define ICE_INSET_TUN_SCTP_SRC_PORT \
164 (ICE_PROT_SCTP_INNER | ICE_SPORT)
165 #define ICE_INSET_TUN_SCTP_DST_PORT \
166 (ICE_PROT_SCTP_INNER | ICE_DPORT)
167 #define ICE_INSET_TUN_ICMP4_SRC_PORT \
168 (ICE_PROT_ICMP4_INNER | ICE_SPORT)
169 #define ICE_INSET_TUN_ICMP4_DST_PORT \
170 (ICE_PROT_ICMP4_INNER | ICE_DPORT)
171 #define ICE_INSET_TUN_ICMP6_SRC_PORT \
172 (ICE_PROT_ICMP6_INNER | ICE_SPORT)
173 #define ICE_INSET_TUN_ICMP6_DST_PORT \
174 (ICE_PROT_ICMP6_INNER | ICE_DPORT)
175 #define ICE_INSET_TUN_ICMP4_TYPE \
176 (ICE_PROT_ICMP4_INNER | ICE_ICMP_TYPE)
177 #define ICE_INSET_TUN_ICMP4_CODE \
178 (ICE_PROT_ICMP4_INNER | ICE_ICMP_CODE)
179 #define ICE_INSET_TUN_ICMP6_TYPE \
180 (ICE_PROT_ICMP6_INNER | ICE_ICMP_TYPE)
181 #define ICE_INSET_TUN_ICMP6_CODE \
182 (ICE_PROT_ICMP6_INNER | ICE_ICMP_CODE)
184 #define ICE_INSET_TUN_VXLAN_VNI \
185 (ICE_PROT_VXLAN | ICE_VXLAN_VNI)
186 #define ICE_INSET_TUN_NVGRE_TNI \
187 (ICE_PROT_NVGRE | ICE_NVGRE_TNI)
188 #define ICE_INSET_GTPU_TEID \
189 (ICE_PROT_GTPU | ICE_GTPU_TEID)
190 #define ICE_INSET_GTPU_QFI \
191 (ICE_PROT_GTPU | ICE_GTPU_QFI)
192 #define ICE_INSET_PPPOE_SESSION \
193 (ICE_PROT_PPPOE_S | ICE_PPPOE_SESSION)
194 #define ICE_INSET_PPPOE_PROTO \
195 (ICE_PROT_PPPOE_S | ICE_PPPOE_PROTO)
196 #define ICE_INSET_ESP_SPI \
197 (ICE_PROT_ESP | ICE_ESP_SPI)
198 #define ICE_INSET_AH_SPI \
199 (ICE_PROT_AH | ICE_AH_SPI)
200 #define ICE_INSET_L2TPV3OIP_SESSION_ID \
201 (ICE_PROT_L2TPV3OIP | ICE_L2TPV3OIP_SESSION_ID)
202 #define ICE_INSET_PFCP_S_FIELD \
203 (ICE_PROT_PFCP | ICE_PFCP_S_FIELD)
204 #define ICE_INSET_PFCP_SEID \
205 (ICE_PROT_PFCP | ICE_PFCP_S_FIELD | ICE_PFCP_SEID)
208 extern enum rte_flow_item_type pattern_empty[];
211 extern enum rte_flow_item_type pattern_ethertype[];
212 extern enum rte_flow_item_type pattern_ethertype_vlan[];
213 extern enum rte_flow_item_type pattern_ethertype_qinq[];
216 extern enum rte_flow_item_type pattern_eth_arp[];
218 /* non-tunnel IPv4 */
219 extern enum rte_flow_item_type pattern_eth_ipv4[];
220 extern enum rte_flow_item_type pattern_eth_vlan_ipv4[];
221 extern enum rte_flow_item_type pattern_eth_qinq_ipv4[];
222 extern enum rte_flow_item_type pattern_eth_ipv4_udp[];
223 extern enum rte_flow_item_type pattern_eth_vlan_ipv4_udp[];
224 extern enum rte_flow_item_type pattern_eth_qinq_ipv4_udp[];
225 extern enum rte_flow_item_type pattern_eth_ipv4_tcp[];
226 extern enum rte_flow_item_type pattern_eth_vlan_ipv4_tcp[];
227 extern enum rte_flow_item_type pattern_eth_qinq_ipv4_tcp[];
228 extern enum rte_flow_item_type pattern_eth_ipv4_sctp[];
229 extern enum rte_flow_item_type pattern_eth_vlan_ipv4_sctp[];
230 extern enum rte_flow_item_type pattern_eth_qinq_ipv4_sctp[];
231 extern enum rte_flow_item_type pattern_eth_ipv4_icmp[];
232 extern enum rte_flow_item_type pattern_eth_vlan_ipv4_icmp[];
233 extern enum rte_flow_item_type pattern_eth_qinq_ipv4_icmp[];
235 /* non-tunnel IPv6 */
236 extern enum rte_flow_item_type pattern_eth_ipv6[];
237 extern enum rte_flow_item_type pattern_eth_vlan_ipv6[];
238 extern enum rte_flow_item_type pattern_eth_qinq_ipv6[];
239 extern enum rte_flow_item_type pattern_eth_ipv6_udp[];
240 extern enum rte_flow_item_type pattern_eth_vlan_ipv6_udp[];
241 extern enum rte_flow_item_type pattern_eth_qinq_ipv6_udp[];
242 extern enum rte_flow_item_type pattern_eth_ipv6_tcp[];
243 extern enum rte_flow_item_type pattern_eth_vlan_ipv6_tcp[];
244 extern enum rte_flow_item_type pattern_eth_qinq_ipv6_tcp[];
245 extern enum rte_flow_item_type pattern_eth_ipv6_sctp[];
246 extern enum rte_flow_item_type pattern_eth_vlan_ipv6_sctp[];
247 extern enum rte_flow_item_type pattern_eth_qinq_ipv6_sctp[];
248 extern enum rte_flow_item_type pattern_eth_ipv6_icmp6[];
249 extern enum rte_flow_item_type pattern_eth_vlan_ipv6_icmp6[];
250 extern enum rte_flow_item_type pattern_eth_qinq_ipv6_icmp6[];
252 /* IPv4 VXLAN IPv4 */
253 extern enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_ipv4[];
254 extern enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_ipv4_udp[];
255 extern enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_ipv4_tcp[];
256 extern enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_ipv4_sctp[];
257 extern enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_ipv4_icmp[];
259 /* IPv4 VXLAN MAC IPv4 */
260 extern enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_eth_ipv4[];
261 extern enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_eth_ipv4_udp[];
262 extern enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_eth_ipv4_tcp[];
263 extern enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_eth_ipv4_sctp[];
264 extern enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_eth_ipv4_icmp[];
266 /* IPv6 VXLAN IPv4 */
267 extern enum rte_flow_item_type pattern_eth_ipv6_udp_vxlan_ipv4[];
268 extern enum rte_flow_item_type pattern_eth_ipv6_udp_vxlan_ipv4_tcp[];
269 extern enum rte_flow_item_type pattern_eth_ipv6_udp_vxlan_ipv4_udp[];
270 extern enum rte_flow_item_type pattern_eth_ipv6_udp_vxlan_ipv4_sctp[];
271 extern enum rte_flow_item_type pattern_eth_ipv6_udp_vxlan_ipv4_icmp[];
273 /* IPv6 VXLAN MAC IPv4 */
274 extern enum rte_flow_item_type pattern_eth_ipv6_udp_vxlan_eth_ipv4[];
275 extern enum rte_flow_item_type pattern_eth_ipv6_udp_vxlan_eth_ipv4_tcp[];
276 extern enum rte_flow_item_type pattern_eth_ipv6_udp_vxlan_eth_ipv4_udp[];
277 extern enum rte_flow_item_type pattern_eth_ipv6_udp_vxlan_eth_ipv4_sctp[];
278 extern enum rte_flow_item_type pattern_eth_ipv6_udp_vxlan_eth_ipv4_icmp[];
280 /* IPv4 VXLAN IPv6 */
281 extern enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_ipv6[];
282 extern enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_ipv6_udp[];
283 extern enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_ipv6_tcp[];
284 extern enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_ipv6_sctp[];
285 extern enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_ipv6_icmp6[];
287 /* IPv4 VXLAN MAC IPv6 */
288 extern enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_eth_ipv6[];
289 extern enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_eth_ipv6_udp[];
290 extern enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_eth_ipv6_tcp[];
291 extern enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_eth_ipv6_sctp[];
292 extern enum rte_flow_item_type pattern_eth_ipv4_udp_vxlan_eth_ipv6_icmp6[];
294 /* IPv6 VXLAN IPv6 */
295 extern enum rte_flow_item_type pattern_eth_ipv6_udp_vxlan_ipv6[];
296 extern enum rte_flow_item_type pattern_eth_ipv6_udp_vxlan_ipv6_tcp[];
297 extern enum rte_flow_item_type pattern_eth_ipv6_udp_vxlan_ipv6_udp[];
298 extern enum rte_flow_item_type pattern_eth_ipv6_udp_vxlan_ipv6_sctp[];
299 extern enum rte_flow_item_type pattern_eth_ipv6_udp_vxlan_ipv6_icmp6[];
301 /* IPv6 VXLAN MAC IPv6 */
302 extern enum rte_flow_item_type pattern_eth_ipv6_udp_vxlan_eth_ipv6[];
303 extern enum rte_flow_item_type pattern_eth_ipv6_udp_vxlan_eth_ipv6_tcp[];
304 extern enum rte_flow_item_type pattern_eth_ipv6_udp_vxlan_eth_ipv6_udp[];
305 extern enum rte_flow_item_type pattern_eth_ipv6_udp_vxlan_eth_ipv6_sctp[];
306 extern enum rte_flow_item_type pattern_eth_ipv6_udp_vxlan_eth_ipv6_icmp6[];
308 /* IPv4 NVGRE IPv4 */
309 extern enum rte_flow_item_type pattern_eth_ipv4_nvgre_ipv4[];
310 extern enum rte_flow_item_type pattern_eth_ipv4_nvgre_ipv4_udp[];
311 extern enum rte_flow_item_type pattern_eth_ipv4_nvgre_ipv4_tcp[];
312 extern enum rte_flow_item_type pattern_eth_ipv4_nvgre_ipv4_sctp[];
313 extern enum rte_flow_item_type pattern_eth_ipv4_nvgre_ipv4_icmp[];
315 /* IPv4 NVGRE MAC IPv4 */
316 extern enum rte_flow_item_type pattern_eth_ipv4_nvgre_eth_ipv4[];
317 extern enum rte_flow_item_type pattern_eth_ipv4_nvgre_eth_ipv4_udp[];
318 extern enum rte_flow_item_type pattern_eth_ipv4_nvgre_eth_ipv4_tcp[];
319 extern enum rte_flow_item_type pattern_eth_ipv4_nvgre_eth_ipv4_sctp[];
320 extern enum rte_flow_item_type pattern_eth_ipv4_nvgre_eth_ipv4_icmp[];
322 /* IPv6 NVGRE IPv4 */
323 extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_ipv4[];
324 extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_ipv4_tcp[];
325 extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_ipv4_udp[];
326 extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_ipv4_sctp[];
327 extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_ipv4_icmp[];
329 /* IPv6 NVGRE MAC IPv4 */
330 extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_eth_ipv4[];
331 extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_eth_ipv4_tcp[];
332 extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_eth_ipv4_udp[];
333 extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_eth_ipv4_sctp[];
334 extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_eth_ipv4_icmp[];
336 /* IPv4 NVGRE IPv6 */
337 extern enum rte_flow_item_type pattern_eth_ipv4_nvgre_ipv6[];
338 extern enum rte_flow_item_type pattern_eth_ipv4_nvgre_ipv6_udp[];
339 extern enum rte_flow_item_type pattern_eth_ipv4_nvgre_ipv6_tcp[];
340 extern enum rte_flow_item_type pattern_eth_ipv4_nvgre_ipv6_sctp[];
341 extern enum rte_flow_item_type pattern_eth_ipv4_nvgre_ipv6_icmp6[];
343 /* IPv4 NVGRE MAC IPv6 */
344 extern enum rte_flow_item_type pattern_eth_ipv4_nvgre_eth_ipv6[];
345 extern enum rte_flow_item_type pattern_eth_ipv4_nvgre_eth_ipv6_udp[];
346 extern enum rte_flow_item_type pattern_eth_ipv4_nvgre_eth_ipv6_tcp[];
347 extern enum rte_flow_item_type pattern_eth_ipv4_nvgre_eth_ipv6_sctp[];
348 extern enum rte_flow_item_type pattern_eth_ipv4_nvgre_eth_ipv6_icmp6[];
350 /* IPv6 NVGRE IPv6 */
351 extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_ipv6[];
352 extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_ipv6_tcp[];
353 extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_ipv6_udp[];
354 extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_ipv6_sctp[];
355 extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_ipv6_icmp6[];
357 /* IPv6 NVGRE MAC IPv6 */
358 extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_eth_ipv6[];
359 extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_eth_ipv6_tcp[];
360 extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_eth_ipv6_udp[];
361 extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_eth_ipv6_sctp[];
362 extern enum rte_flow_item_type pattern_eth_ipv6_nvgre_eth_ipv6_icmp6[];
365 extern enum rte_flow_item_type pattern_eth_ipv4_gtpu[];
366 extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_eh[];
369 extern enum rte_flow_item_type pattern_eth_ipv6_gtpu[];
370 extern enum rte_flow_item_type pattern_eth_ipv6_gtpu_eh[];
373 extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_ipv4[];
374 extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_ipv4_udp[];
375 extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_ipv4_tcp[];
376 extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_ipv4_icmp[];
379 extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_ipv6[];
380 extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_ipv6_udp[];
381 extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_ipv6_tcp[];
382 extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_ipv6_icmp[];
385 extern enum rte_flow_item_type pattern_eth_ipv6_gtpu_ipv4[];
386 extern enum rte_flow_item_type pattern_eth_ipv6_gtpu_ipv4_udp[];
387 extern enum rte_flow_item_type pattern_eth_ipv6_gtpu_ipv4_tcp[];
388 extern enum rte_flow_item_type pattern_eth_ipv6_gtpu_ipv4_icmp[];
391 extern enum rte_flow_item_type pattern_eth_ipv6_gtpu_ipv6[];
392 extern enum rte_flow_item_type pattern_eth_ipv6_gtpu_ipv6_udp[];
393 extern enum rte_flow_item_type pattern_eth_ipv6_gtpu_ipv6_tcp[];
394 extern enum rte_flow_item_type pattern_eth_ipv6_gtpu_ipv6_icmp[];
396 /* IPv4 GTPU EH IPv4 */
397 extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_eh_ipv4[];
398 extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_eh_ipv4_udp[];
399 extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_eh_ipv4_tcp[];
400 extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_eh_ipv4_icmp[];
402 /* IPv4 GTPU EH IPv6 */
403 extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_eh_ipv6[];
404 extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_eh_ipv6_udp[];
405 extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_eh_ipv6_tcp[];
406 extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_eh_ipv6_icmp[];
408 /* IPv6 GTPU EH IPv4 */
409 extern enum rte_flow_item_type pattern_eth_ipv6_gtpu_eh_ipv4[];
410 extern enum rte_flow_item_type pattern_eth_ipv6_gtpu_eh_ipv4_udp[];
411 extern enum rte_flow_item_type pattern_eth_ipv6_gtpu_eh_ipv4_tcp[];
412 extern enum rte_flow_item_type pattern_eth_ipv6_gtpu_eh_ipv4_icmp[];
414 /* IPv6 GTPU EH IPv6 */
415 extern enum rte_flow_item_type pattern_eth_ipv6_gtpu_eh_ipv6[];
416 extern enum rte_flow_item_type pattern_eth_ipv6_gtpu_eh_ipv6_udp[];
417 extern enum rte_flow_item_type pattern_eth_ipv6_gtpu_eh_ipv6_tcp[];
418 extern enum rte_flow_item_type pattern_eth_ipv6_gtpu_eh_ipv6_icmp[];
421 extern enum rte_flow_item_type pattern_eth_pppoed[];
422 extern enum rte_flow_item_type pattern_eth_vlan_pppoed[];
423 extern enum rte_flow_item_type pattern_eth_qinq_pppoed[];
424 extern enum rte_flow_item_type pattern_eth_pppoes[];
425 extern enum rte_flow_item_type pattern_eth_pppoes_proto[];
426 extern enum rte_flow_item_type pattern_eth_vlan_pppoes[];
427 extern enum rte_flow_item_type pattern_eth_vlan_pppoes_proto[];
428 extern enum rte_flow_item_type pattern_eth_qinq_pppoes[];
429 extern enum rte_flow_item_type pattern_eth_pppoes_ipv4[];
430 extern enum rte_flow_item_type pattern_eth_vlan_pppoes_ipv4[];
431 extern enum rte_flow_item_type pattern_eth_qinq_pppoes_ipv4[];
432 extern enum rte_flow_item_type pattern_eth_pppoes_ipv4_udp[];
433 extern enum rte_flow_item_type pattern_eth_vlan_pppoes_ipv4_udp[];
434 extern enum rte_flow_item_type pattern_eth_qinq_pppoes_ipv4_udp[];
435 extern enum rte_flow_item_type pattern_eth_pppoes_ipv4_tcp[];
436 extern enum rte_flow_item_type pattern_eth_vlan_pppoes_ipv4_tcp[];
437 extern enum rte_flow_item_type pattern_eth_qinq_pppoes_ipv4_tcp[];
438 extern enum rte_flow_item_type pattern_eth_pppoes_ipv4_sctp[];
439 extern enum rte_flow_item_type pattern_eth_vlan_pppoes_ipv4_sctp[];
440 extern enum rte_flow_item_type pattern_eth_qinq_pppoes_ipv4_sctp[];
441 extern enum rte_flow_item_type pattern_eth_pppoes_ipv4_icmp[];
442 extern enum rte_flow_item_type pattern_eth_vlan_pppoes_ipv4_icmp[];
443 extern enum rte_flow_item_type pattern_eth_qinq_pppoes_ipv4_icmp[];
444 extern enum rte_flow_item_type pattern_eth_pppoes_ipv6[];
445 extern enum rte_flow_item_type pattern_eth_vlan_pppoes_ipv6[];
446 extern enum rte_flow_item_type pattern_eth_qinq_pppoes_ipv6[];
447 extern enum rte_flow_item_type pattern_eth_pppoes_ipv6_udp[];
448 extern enum rte_flow_item_type pattern_eth_vlan_pppoes_ipv6_udp[];
449 extern enum rte_flow_item_type pattern_eth_qinq_pppoes_ipv6_udp[];
450 extern enum rte_flow_item_type pattern_eth_pppoes_ipv6_tcp[];
451 extern enum rte_flow_item_type pattern_eth_vlan_pppoes_ipv6_tcp[];
452 extern enum rte_flow_item_type pattern_eth_qinq_pppoes_ipv6_tcp[];
453 extern enum rte_flow_item_type pattern_eth_pppoes_ipv6_sctp[];
454 extern enum rte_flow_item_type pattern_eth_vlan_pppoes_ipv6_sctp[];
455 extern enum rte_flow_item_type pattern_eth_qinq_pppoes_ipv6_sctp[];
456 extern enum rte_flow_item_type pattern_eth_pppoes_ipv6_icmp6[];
457 extern enum rte_flow_item_type pattern_eth_vlan_pppoes_ipv6_icmp6[];
458 extern enum rte_flow_item_type pattern_eth_qinq_pppoes_ipv6_icmp6[];
461 extern enum rte_flow_item_type pattern_eth_ipv4_esp[];
462 extern enum rte_flow_item_type pattern_eth_ipv4_udp_esp[];
463 extern enum rte_flow_item_type pattern_eth_ipv6_esp[];
464 extern enum rte_flow_item_type pattern_eth_ipv6_udp_esp[];
467 extern enum rte_flow_item_type pattern_eth_ipv4_ah[];
468 extern enum rte_flow_item_type pattern_eth_ipv6_ah[];
469 extern enum rte_flow_item_type pattern_eth_ipv6_udp_ah[];
472 extern enum rte_flow_item_type pattern_eth_ipv4_l2tp[];
473 extern enum rte_flow_item_type pattern_eth_ipv6_l2tp[];
476 extern enum rte_flow_item_type pattern_eth_ipv4_pfcp[];
477 extern enum rte_flow_item_type pattern_eth_ipv6_pfcp[];
481 extern const struct rte_flow_ops ice_flow_ops;
484 enum ice_flow_engine_type {
485 ICE_FLOW_ENGINE_NONE = 0,
486 ICE_FLOW_ENGINE_FDIR,
487 ICE_FLOW_ENGINE_SWITCH,
488 ICE_FLOW_ENGINE_HASH,
494 * classification stages.
495 * for non-pipeline mode, we have two classification stages: Distributor/RSS
496 * for pipeline-mode we have three classification stages:
497 * Permission/Distributor/RSS
499 enum ice_flow_classification_stage {
500 ICE_FLOW_STAGE_NONE = 0,
502 ICE_FLOW_STAGE_PERMISSION,
503 ICE_FLOW_STAGE_DISTRIBUTOR,
506 /* pattern structure */
507 struct ice_pattern_match_item {
508 enum rte_flow_item_type *pattern_list;
509 /* pattern_list must end with RTE_FLOW_ITEM_TYPE_END */
510 uint64_t input_set_mask;
514 enum ice_flow_redirect_type {
515 ICE_FLOW_REDIRECT_VSI,
518 struct ice_flow_redirect {
519 enum ice_flow_redirect_type type;
523 uint16_t new_vsi_num;
528 typedef int (*engine_init_t)(struct ice_adapter *ad);
529 typedef void (*engine_uninit_t)(struct ice_adapter *ad);
530 typedef int (*engine_create_t)(struct ice_adapter *ad,
531 struct rte_flow *flow,
533 struct rte_flow_error *error);
534 typedef int (*engine_destroy_t)(struct ice_adapter *ad,
535 struct rte_flow *flow,
536 struct rte_flow_error *error);
537 typedef int (*engine_query_t)(struct ice_adapter *ad,
538 struct rte_flow *flow,
539 struct rte_flow_query_count *count,
540 struct rte_flow_error *error);
541 typedef int(*engine_redirect_t)(struct ice_adapter *ad,
542 struct rte_flow *flow,
543 struct ice_flow_redirect *redirect);
544 typedef void (*engine_free_t) (struct rte_flow *flow);
545 typedef int (*parse_pattern_action_t)(struct ice_adapter *ad,
546 struct ice_pattern_match_item *array,
548 const struct rte_flow_item pattern[],
549 const struct rte_flow_action actions[],
551 struct rte_flow_error *error);
553 /* Struct to store engine created. */
554 struct ice_flow_engine {
555 TAILQ_ENTRY(ice_flow_engine) node;
557 engine_uninit_t uninit;
558 engine_create_t create;
559 engine_destroy_t destroy;
560 engine_query_t query_count;
561 engine_redirect_t redirect;
563 enum ice_flow_engine_type type;
565 TAILQ_HEAD(ice_engine_list, ice_flow_engine);
567 /* Struct to store flow created. */
569 TAILQ_ENTRY(rte_flow) node;
570 struct ice_flow_engine *engine;
574 struct ice_flow_parser {
575 struct ice_flow_engine *engine;
576 struct ice_pattern_match_item *array;
578 parse_pattern_action_t parse_pattern_action;
579 enum ice_flow_classification_stage stage;
582 /* Struct to store parser created. */
583 struct ice_flow_parser_node {
584 TAILQ_ENTRY(ice_flow_parser_node) node;
585 struct ice_flow_parser *parser;
588 void ice_register_flow_engine(struct ice_flow_engine *engine);
589 int ice_flow_init(struct ice_adapter *ad);
590 void ice_flow_uninit(struct ice_adapter *ad);
591 int ice_register_parser(struct ice_flow_parser *parser,
592 struct ice_adapter *ad);
593 void ice_unregister_parser(struct ice_flow_parser *parser,
594 struct ice_adapter *ad);
595 struct ice_pattern_match_item *
596 ice_search_pattern_match_item(struct ice_adapter *ad,
597 const struct rte_flow_item pattern[],
598 struct ice_pattern_match_item *array,
600 struct rte_flow_error *error);
602 ice_flow_redirect(struct ice_adapter *ad,
603 struct ice_flow_redirect *rd);