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_ipv4[];
367 extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_eh[];
368 extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_eh_ipv4[];
369 extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_eh_ipv4_udp[];
370 extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_eh_ipv4_tcp[];
371 extern enum rte_flow_item_type pattern_eth_ipv4_gtpu_eh_ipv4_icmp[];
374 extern enum rte_flow_item_type pattern_eth_pppoed[];
375 extern enum rte_flow_item_type pattern_eth_vlan_pppoed[];
376 extern enum rte_flow_item_type pattern_eth_qinq_pppoed[];
377 extern enum rte_flow_item_type pattern_eth_pppoes[];
378 extern enum rte_flow_item_type pattern_eth_pppoes_proto[];
379 extern enum rte_flow_item_type pattern_eth_vlan_pppoes[];
380 extern enum rte_flow_item_type pattern_eth_vlan_pppoes_proto[];
381 extern enum rte_flow_item_type pattern_eth_qinq_pppoes[];
382 extern enum rte_flow_item_type pattern_eth_pppoes_ipv4[];
383 extern enum rte_flow_item_type pattern_eth_vlan_pppoes_ipv4[];
384 extern enum rte_flow_item_type pattern_eth_qinq_pppoes_ipv4[];
385 extern enum rte_flow_item_type pattern_eth_pppoes_ipv4_udp[];
386 extern enum rte_flow_item_type pattern_eth_vlan_pppoes_ipv4_udp[];
387 extern enum rte_flow_item_type pattern_eth_qinq_pppoes_ipv4_udp[];
388 extern enum rte_flow_item_type pattern_eth_pppoes_ipv4_tcp[];
389 extern enum rte_flow_item_type pattern_eth_vlan_pppoes_ipv4_tcp[];
390 extern enum rte_flow_item_type pattern_eth_qinq_pppoes_ipv4_tcp[];
391 extern enum rte_flow_item_type pattern_eth_pppoes_ipv4_sctp[];
392 extern enum rte_flow_item_type pattern_eth_vlan_pppoes_ipv4_sctp[];
393 extern enum rte_flow_item_type pattern_eth_qinq_pppoes_ipv4_sctp[];
394 extern enum rte_flow_item_type pattern_eth_pppoes_ipv4_icmp[];
395 extern enum rte_flow_item_type pattern_eth_vlan_pppoes_ipv4_icmp[];
396 extern enum rte_flow_item_type pattern_eth_qinq_pppoes_ipv4_icmp[];
397 extern enum rte_flow_item_type pattern_eth_pppoes_ipv6[];
398 extern enum rte_flow_item_type pattern_eth_vlan_pppoes_ipv6[];
399 extern enum rte_flow_item_type pattern_eth_qinq_pppoes_ipv6[];
400 extern enum rte_flow_item_type pattern_eth_pppoes_ipv6_udp[];
401 extern enum rte_flow_item_type pattern_eth_vlan_pppoes_ipv6_udp[];
402 extern enum rte_flow_item_type pattern_eth_qinq_pppoes_ipv6_udp[];
403 extern enum rte_flow_item_type pattern_eth_pppoes_ipv6_tcp[];
404 extern enum rte_flow_item_type pattern_eth_vlan_pppoes_ipv6_tcp[];
405 extern enum rte_flow_item_type pattern_eth_qinq_pppoes_ipv6_tcp[];
406 extern enum rte_flow_item_type pattern_eth_pppoes_ipv6_sctp[];
407 extern enum rte_flow_item_type pattern_eth_vlan_pppoes_ipv6_sctp[];
408 extern enum rte_flow_item_type pattern_eth_qinq_pppoes_ipv6_sctp[];
409 extern enum rte_flow_item_type pattern_eth_pppoes_ipv6_icmp6[];
410 extern enum rte_flow_item_type pattern_eth_vlan_pppoes_ipv6_icmp6[];
411 extern enum rte_flow_item_type pattern_eth_qinq_pppoes_ipv6_icmp6[];
414 extern enum rte_flow_item_type pattern_eth_ipv4_esp[];
415 extern enum rte_flow_item_type pattern_eth_ipv4_udp_esp[];
416 extern enum rte_flow_item_type pattern_eth_ipv6_esp[];
417 extern enum rte_flow_item_type pattern_eth_ipv6_udp_esp[];
420 extern enum rte_flow_item_type pattern_eth_ipv4_ah[];
421 extern enum rte_flow_item_type pattern_eth_ipv6_ah[];
422 extern enum rte_flow_item_type pattern_eth_ipv6_udp_ah[];
425 extern enum rte_flow_item_type pattern_eth_ipv4_l2tp[];
426 extern enum rte_flow_item_type pattern_eth_ipv6_l2tp[];
429 extern enum rte_flow_item_type pattern_eth_ipv4_pfcp[];
430 extern enum rte_flow_item_type pattern_eth_ipv6_pfcp[];
434 extern const struct rte_flow_ops ice_flow_ops;
437 enum ice_flow_engine_type {
438 ICE_FLOW_ENGINE_NONE = 0,
439 ICE_FLOW_ENGINE_FDIR,
440 ICE_FLOW_ENGINE_SWITCH,
441 ICE_FLOW_ENGINE_HASH,
447 * classification stages.
448 * for non-pipeline mode, we have two classification stages: Distributor/RSS
449 * for pipeline-mode we have three classification stages:
450 * Permission/Distributor/RSS
452 enum ice_flow_classification_stage {
453 ICE_FLOW_STAGE_NONE = 0,
455 ICE_FLOW_STAGE_PERMISSION,
456 ICE_FLOW_STAGE_DISTRIBUTOR,
459 /* pattern structure */
460 struct ice_pattern_match_item {
461 enum rte_flow_item_type *pattern_list;
462 /* pattern_list must end with RTE_FLOW_ITEM_TYPE_END */
463 uint64_t input_set_mask;
467 enum ice_flow_redirect_type {
468 ICE_FLOW_REDIRECT_VSI,
471 struct ice_flow_redirect {
472 enum ice_flow_redirect_type type;
476 uint16_t new_vsi_num;
481 typedef int (*engine_init_t)(struct ice_adapter *ad);
482 typedef void (*engine_uninit_t)(struct ice_adapter *ad);
483 typedef int (*engine_create_t)(struct ice_adapter *ad,
484 struct rte_flow *flow,
486 struct rte_flow_error *error);
487 typedef int (*engine_destroy_t)(struct ice_adapter *ad,
488 struct rte_flow *flow,
489 struct rte_flow_error *error);
490 typedef int (*engine_query_t)(struct ice_adapter *ad,
491 struct rte_flow *flow,
492 struct rte_flow_query_count *count,
493 struct rte_flow_error *error);
494 typedef int(*engine_redirect_t)(struct ice_adapter *ad,
495 struct rte_flow *flow,
496 struct ice_flow_redirect *redirect);
497 typedef void (*engine_free_t) (struct rte_flow *flow);
498 typedef int (*parse_pattern_action_t)(struct ice_adapter *ad,
499 struct ice_pattern_match_item *array,
501 const struct rte_flow_item pattern[],
502 const struct rte_flow_action actions[],
504 struct rte_flow_error *error);
506 /* Struct to store engine created. */
507 struct ice_flow_engine {
508 TAILQ_ENTRY(ice_flow_engine) node;
510 engine_uninit_t uninit;
511 engine_create_t create;
512 engine_destroy_t destroy;
513 engine_query_t query_count;
514 engine_redirect_t redirect;
516 enum ice_flow_engine_type type;
518 TAILQ_HEAD(ice_engine_list, ice_flow_engine);
520 /* Struct to store flow created. */
522 TAILQ_ENTRY(rte_flow) node;
523 struct ice_flow_engine *engine;
527 struct ice_flow_parser {
528 struct ice_flow_engine *engine;
529 struct ice_pattern_match_item *array;
531 parse_pattern_action_t parse_pattern_action;
532 enum ice_flow_classification_stage stage;
535 /* Struct to store parser created. */
536 struct ice_flow_parser_node {
537 TAILQ_ENTRY(ice_flow_parser_node) node;
538 struct ice_flow_parser *parser;
541 void ice_register_flow_engine(struct ice_flow_engine *engine);
542 int ice_flow_init(struct ice_adapter *ad);
543 void ice_flow_uninit(struct ice_adapter *ad);
544 int ice_register_parser(struct ice_flow_parser *parser,
545 struct ice_adapter *ad);
546 void ice_unregister_parser(struct ice_flow_parser *parser,
547 struct ice_adapter *ad);
548 struct ice_pattern_match_item *
549 ice_search_pattern_match_item(const struct rte_flow_item pattern[],
550 struct ice_pattern_match_item *array,
552 struct rte_flow_error *error);
554 ice_flow_redirect(struct ice_adapter *ad,
555 struct ice_flow_redirect *rd);