net/mlx5: add VLAN push/pop DR commands to glue
[dpdk.git] / drivers / net / ice / ice_generic_flow.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2019 Intel Corporation
3  */
4
5 #ifndef _ICE_GENERIC_FLOW_H_
6 #define _ICE_GENERIC_FLOW_H_
7
8 #include <rte_flow_driver.h>
9
10 struct ice_flow_pattern {
11         enum rte_flow_item_type *items;
12         uint64_t sw_fields;
13 };
14
15 #define ICE_INSET_NONE            0x00000000000000000ULL
16
17 /* bit0 ~ bit 7 */
18 #define ICE_INSET_SMAC            0x0000000000000001ULL
19 #define ICE_INSET_DMAC            0x0000000000000002ULL
20 #define ICE_INSET_ETHERTYPE       0x0000000000000020ULL
21
22 /* bit 8 ~ bit 15 */
23 #define ICE_INSET_IPV4_SRC        0x0000000000000100ULL
24 #define ICE_INSET_IPV4_DST        0x0000000000000200ULL
25 #define ICE_INSET_IPV6_SRC        0x0000000000000400ULL
26 #define ICE_INSET_IPV6_DST        0x0000000000000800ULL
27 #define ICE_INSET_SRC_PORT        0x0000000000001000ULL
28 #define ICE_INSET_DST_PORT        0x0000000000002000ULL
29 #define ICE_INSET_ARP             0x0000000000004000ULL
30
31 /* bit 16 ~ bit 31 */
32 #define ICE_INSET_IPV4_TOS        0x0000000000010000ULL
33 #define ICE_INSET_IPV4_PROTO      0x0000000000020000ULL
34 #define ICE_INSET_IPV4_TTL        0x0000000000040000ULL
35 #define ICE_INSET_IPV6_TOS        0x0000000000100000ULL
36 #define ICE_INSET_IPV6_PROTO      0x0000000000200000ULL
37 #define ICE_INSET_IPV6_HOP_LIMIT  0x0000000000400000ULL
38 #define ICE_INSET_ICMP            0x0000000001000000ULL
39 #define ICE_INSET_ICMP6           0x0000000002000000ULL
40
41 /* bit 32 ~ bit 47, tunnel fields */
42 #define ICE_INSET_TUN_SMAC           0x0000000100000000ULL
43 #define ICE_INSET_TUN_DMAC           0x0000000200000000ULL
44 #define ICE_INSET_TUN_IPV4_SRC       0x0000000400000000ULL
45 #define ICE_INSET_TUN_IPV4_DST       0x0000000800000000ULL
46 #define ICE_INSET_TUN_IPV4_TTL       0x0000001000000000ULL
47 #define ICE_INSET_TUN_IPV4_PROTO     0x0000002000000000ULL
48 #define ICE_INSET_TUN_IPV6_SRC       0x0000004000000000ULL
49 #define ICE_INSET_TUN_IPV6_DST       0x0000008000000000ULL
50 #define ICE_INSET_TUN_IPV6_TTL       0x0000010000000000ULL
51 #define ICE_INSET_TUN_IPV6_PROTO     0x0000020000000000ULL
52 #define ICE_INSET_TUN_SRC_PORT       0x0000040000000000ULL
53 #define ICE_INSET_TUN_DST_PORT       0x0000080000000000ULL
54 #define ICE_INSET_TUN_ID             0x0000100000000000ULL
55
56 /* bit 48 ~ bit 55 */
57 #define ICE_INSET_LAST_ETHER_TYPE 0x0001000000000000ULL
58
59 #define ICE_FLAG_VLAN_INNER  0x00000001ULL
60 #define ICE_FLAG_VLAN_OUTER  0x00000002ULL
61
62 #define INSET_ETHER ( \
63         ICE_INSET_DMAC | ICE_INSET_SMAC | ICE_INSET_ETHERTYPE)
64 #define INSET_MAC_IPV4 ( \
65         ICE_INSET_DMAC | ICE_INSET_IPV4_DST | ICE_INSET_IPV4_SRC | \
66         ICE_INSET_IPV4_TTL | ICE_INSET_IPV4_TOS)
67 #define INSET_MAC_IPV4_L4 ( \
68         ICE_INSET_DMAC | ICE_INSET_IPV4_DST | ICE_INSET_IPV4_SRC | \
69         ICE_INSET_IPV4_TTL | ICE_INSET_IPV4_TOS | ICE_INSET_DST_PORT | \
70         ICE_INSET_SRC_PORT)
71 #define INSET_MAC_IPV4_ICMP ( \
72         ICE_INSET_DMAC | ICE_INSET_IPV4_DST | ICE_INSET_IPV4_SRC | \
73         ICE_INSET_IPV4_TTL | ICE_INSET_IPV4_TOS | ICE_INSET_ICMP)
74 #define INSET_MAC_IPV6 ( \
75         ICE_INSET_DMAC | ICE_INSET_IPV6_DST | ICE_INSET_IPV6_SRC | \
76         ICE_INSET_IPV6_TOS | ICE_INSET_IPV6_HOP_LIMIT)
77 #define INSET_MAC_IPV6_L4 ( \
78         ICE_INSET_DMAC | ICE_INSET_IPV6_DST | ICE_INSET_IPV6_SRC | \
79         ICE_INSET_IPV6_HOP_LIMIT | ICE_INSET_IPV6_TOS | \
80         ICE_INSET_DST_PORT | ICE_INSET_SRC_PORT)
81 #define INSET_MAC_IPV6_ICMP ( \
82         ICE_INSET_DMAC | ICE_INSET_IPV6_DST | ICE_INSET_IPV6_SRC | \
83         ICE_INSET_IPV6_HOP_LIMIT | ICE_INSET_IPV6_TOS | ICE_INSET_ICMP6)
84 #define INSET_TUNNEL_IPV4_TYPE1 ( \
85         ICE_INSET_TUN_IPV4_SRC | ICE_INSET_TUN_IPV4_DST | \
86         ICE_INSET_TUN_IPV4_TTL | ICE_INSET_TUN_IPV4_PROTO | \
87         ICE_INSET_TUN_ID)
88 #define INSET_TUNNEL_IPV4_TYPE2 ( \
89         ICE_INSET_TUN_IPV4_SRC | ICE_INSET_TUN_IPV4_DST | \
90         ICE_INSET_TUN_IPV4_TTL | ICE_INSET_TUN_IPV4_PROTO | \
91         ICE_INSET_TUN_SRC_PORT | ICE_INSET_TUN_DST_PORT | \
92         ICE_INSET_TUN_ID)
93 #define INSET_TUNNEL_IPV4_TYPE3 ( \
94         ICE_INSET_TUN_IPV4_SRC | ICE_INSET_TUN_IPV4_DST | \
95         ICE_INSET_TUN_IPV4_TTL | ICE_INSET_ICMP | \
96         ICE_INSET_TUN_ID)
97 #define INSET_TUNNEL_IPV6_TYPE1 ( \
98         ICE_INSET_TUN_IPV6_SRC | ICE_INSET_TUN_IPV6_DST | \
99         ICE_INSET_TUN_IPV6_TTL | ICE_INSET_TUN_IPV6_PROTO | \
100         ICE_INSET_TUN_ID)
101 #define INSET_TUNNEL_IPV6_TYPE2 ( \
102         ICE_INSET_TUN_IPV6_SRC | ICE_INSET_TUN_IPV6_DST | \
103         ICE_INSET_TUN_IPV6_TTL | ICE_INSET_TUN_IPV6_PROTO | \
104         ICE_INSET_TUN_SRC_PORT | ICE_INSET_TUN_DST_PORT | \
105         ICE_INSET_TUN_ID)
106 #define INSET_TUNNEL_IPV6_TYPE3 ( \
107         ICE_INSET_TUN_IPV6_SRC | ICE_INSET_TUN_IPV6_DST | \
108         ICE_INSET_TUN_IPV6_TTL | ICE_INSET_ICMP6 | \
109         ICE_INSET_TUN_ID)
110
111 /* L2 */
112 static enum rte_flow_item_type pattern_ethertype[] = {
113         RTE_FLOW_ITEM_TYPE_ETH,
114         RTE_FLOW_ITEM_TYPE_END,
115 };
116
117 /* non-tunnel IPv4 */
118 static enum rte_flow_item_type pattern_ipv4[] = {
119         RTE_FLOW_ITEM_TYPE_ETH,
120         RTE_FLOW_ITEM_TYPE_IPV4,
121         RTE_FLOW_ITEM_TYPE_END,
122 };
123
124 static enum rte_flow_item_type pattern_ipv4_udp[] = {
125         RTE_FLOW_ITEM_TYPE_ETH,
126         RTE_FLOW_ITEM_TYPE_IPV4,
127         RTE_FLOW_ITEM_TYPE_UDP,
128         RTE_FLOW_ITEM_TYPE_END,
129 };
130
131 static enum rte_flow_item_type pattern_ipv4_tcp[] = {
132         RTE_FLOW_ITEM_TYPE_ETH,
133         RTE_FLOW_ITEM_TYPE_IPV4,
134         RTE_FLOW_ITEM_TYPE_TCP,
135         RTE_FLOW_ITEM_TYPE_END,
136 };
137
138 static enum rte_flow_item_type pattern_ipv4_sctp[] = {
139         RTE_FLOW_ITEM_TYPE_ETH,
140         RTE_FLOW_ITEM_TYPE_IPV4,
141         RTE_FLOW_ITEM_TYPE_SCTP,
142         RTE_FLOW_ITEM_TYPE_END,
143 };
144
145 static enum rte_flow_item_type pattern_ipv4_icmp[] = {
146         RTE_FLOW_ITEM_TYPE_ETH,
147         RTE_FLOW_ITEM_TYPE_IPV4,
148         RTE_FLOW_ITEM_TYPE_ICMP,
149         RTE_FLOW_ITEM_TYPE_END,
150 };
151
152 /* non-tunnel IPv6 */
153 static enum rte_flow_item_type pattern_ipv6[] = {
154         RTE_FLOW_ITEM_TYPE_ETH,
155         RTE_FLOW_ITEM_TYPE_IPV6,
156         RTE_FLOW_ITEM_TYPE_END,
157 };
158
159 static enum rte_flow_item_type pattern_ipv6_udp[] = {
160         RTE_FLOW_ITEM_TYPE_ETH,
161         RTE_FLOW_ITEM_TYPE_IPV6,
162         RTE_FLOW_ITEM_TYPE_UDP,
163         RTE_FLOW_ITEM_TYPE_END,
164 };
165
166 static enum rte_flow_item_type pattern_ipv6_tcp[] = {
167         RTE_FLOW_ITEM_TYPE_ETH,
168         RTE_FLOW_ITEM_TYPE_IPV6,
169         RTE_FLOW_ITEM_TYPE_TCP,
170         RTE_FLOW_ITEM_TYPE_END,
171 };
172
173 static enum rte_flow_item_type pattern_ipv6_sctp[] = {
174         RTE_FLOW_ITEM_TYPE_ETH,
175         RTE_FLOW_ITEM_TYPE_IPV6,
176         RTE_FLOW_ITEM_TYPE_SCTP,
177         RTE_FLOW_ITEM_TYPE_END,
178 };
179
180 static enum rte_flow_item_type pattern_ipv6_icmp6[] = {
181         RTE_FLOW_ITEM_TYPE_ETH,
182         RTE_FLOW_ITEM_TYPE_IPV6,
183         RTE_FLOW_ITEM_TYPE_ICMP6,
184         RTE_FLOW_ITEM_TYPE_END,
185 };
186
187 /* IPv4 VXLAN IPv4 */
188 static enum rte_flow_item_type pattern_ipv4_vxlan_ipv4[] = {
189         RTE_FLOW_ITEM_TYPE_ETH,
190         RTE_FLOW_ITEM_TYPE_IPV4,
191         RTE_FLOW_ITEM_TYPE_UDP,
192         RTE_FLOW_ITEM_TYPE_VXLAN,
193         RTE_FLOW_ITEM_TYPE_IPV4,
194         RTE_FLOW_ITEM_TYPE_END,
195 };
196
197 static enum rte_flow_item_type pattern_ipv4_vxlan_ipv4_udp[] = {
198         RTE_FLOW_ITEM_TYPE_ETH,
199         RTE_FLOW_ITEM_TYPE_IPV4,
200         RTE_FLOW_ITEM_TYPE_UDP,
201         RTE_FLOW_ITEM_TYPE_VXLAN,
202         RTE_FLOW_ITEM_TYPE_IPV4,
203         RTE_FLOW_ITEM_TYPE_UDP,
204         RTE_FLOW_ITEM_TYPE_END,
205 };
206
207 static enum rte_flow_item_type pattern_ipv4_vxlan_ipv4_tcp[] = {
208         RTE_FLOW_ITEM_TYPE_ETH,
209         RTE_FLOW_ITEM_TYPE_IPV4,
210         RTE_FLOW_ITEM_TYPE_UDP,
211         RTE_FLOW_ITEM_TYPE_VXLAN,
212         RTE_FLOW_ITEM_TYPE_IPV4,
213         RTE_FLOW_ITEM_TYPE_TCP,
214         RTE_FLOW_ITEM_TYPE_END,
215 };
216
217 static enum rte_flow_item_type pattern_ipv4_vxlan_ipv4_sctp[] = {
218         RTE_FLOW_ITEM_TYPE_ETH,
219         RTE_FLOW_ITEM_TYPE_IPV4,
220         RTE_FLOW_ITEM_TYPE_UDP,
221         RTE_FLOW_ITEM_TYPE_VXLAN,
222         RTE_FLOW_ITEM_TYPE_IPV4,
223         RTE_FLOW_ITEM_TYPE_SCTP,
224         RTE_FLOW_ITEM_TYPE_END,
225 };
226
227 static enum rte_flow_item_type pattern_ipv4_vxlan_ipv4_icmp[] = {
228         RTE_FLOW_ITEM_TYPE_ETH,
229         RTE_FLOW_ITEM_TYPE_IPV4,
230         RTE_FLOW_ITEM_TYPE_UDP,
231         RTE_FLOW_ITEM_TYPE_VXLAN,
232         RTE_FLOW_ITEM_TYPE_IPV4,
233         RTE_FLOW_ITEM_TYPE_ICMP,
234         RTE_FLOW_ITEM_TYPE_END,
235 };
236
237 /* IPv4 VXLAN MAC IPv4 */
238 static enum rte_flow_item_type pattern_ipv4_vxlan_eth_ipv4[] = {
239         RTE_FLOW_ITEM_TYPE_ETH,
240         RTE_FLOW_ITEM_TYPE_IPV4,
241         RTE_FLOW_ITEM_TYPE_UDP,
242         RTE_FLOW_ITEM_TYPE_VXLAN,
243         RTE_FLOW_ITEM_TYPE_ETH,
244         RTE_FLOW_ITEM_TYPE_IPV4,
245         RTE_FLOW_ITEM_TYPE_END,
246 };
247
248 static enum rte_flow_item_type pattern_ipv4_vxlan_eth_ipv4_udp[] = {
249         RTE_FLOW_ITEM_TYPE_ETH,
250         RTE_FLOW_ITEM_TYPE_IPV4,
251         RTE_FLOW_ITEM_TYPE_UDP,
252         RTE_FLOW_ITEM_TYPE_VXLAN,
253         RTE_FLOW_ITEM_TYPE_ETH,
254         RTE_FLOW_ITEM_TYPE_IPV4,
255         RTE_FLOW_ITEM_TYPE_UDP,
256         RTE_FLOW_ITEM_TYPE_END,
257 };
258
259 static enum rte_flow_item_type pattern_ipv4_vxlan_eth_ipv4_tcp[] = {
260         RTE_FLOW_ITEM_TYPE_ETH,
261         RTE_FLOW_ITEM_TYPE_IPV4,
262         RTE_FLOW_ITEM_TYPE_UDP,
263         RTE_FLOW_ITEM_TYPE_VXLAN,
264         RTE_FLOW_ITEM_TYPE_ETH,
265         RTE_FLOW_ITEM_TYPE_IPV4,
266         RTE_FLOW_ITEM_TYPE_TCP,
267         RTE_FLOW_ITEM_TYPE_END,
268 };
269
270 static enum rte_flow_item_type pattern_ipv4_vxlan_eth_ipv4_sctp[] = {
271         RTE_FLOW_ITEM_TYPE_ETH,
272         RTE_FLOW_ITEM_TYPE_IPV4,
273         RTE_FLOW_ITEM_TYPE_UDP,
274         RTE_FLOW_ITEM_TYPE_VXLAN,
275         RTE_FLOW_ITEM_TYPE_ETH,
276         RTE_FLOW_ITEM_TYPE_IPV4,
277         RTE_FLOW_ITEM_TYPE_SCTP,
278         RTE_FLOW_ITEM_TYPE_END,
279 };
280
281 static enum rte_flow_item_type pattern_ipv4_vxlan_eth_ipv4_icmp[] = {
282         RTE_FLOW_ITEM_TYPE_ETH,
283         RTE_FLOW_ITEM_TYPE_IPV4,
284         RTE_FLOW_ITEM_TYPE_UDP,
285         RTE_FLOW_ITEM_TYPE_VXLAN,
286         RTE_FLOW_ITEM_TYPE_ETH,
287         RTE_FLOW_ITEM_TYPE_IPV4,
288         RTE_FLOW_ITEM_TYPE_ICMP,
289         RTE_FLOW_ITEM_TYPE_END,
290 };
291
292 /* IPv4 VXLAN IPv6 */
293 static enum rte_flow_item_type pattern_ipv4_vxlan_ipv6[] = {
294         RTE_FLOW_ITEM_TYPE_ETH,
295         RTE_FLOW_ITEM_TYPE_IPV4,
296         RTE_FLOW_ITEM_TYPE_UDP,
297         RTE_FLOW_ITEM_TYPE_VXLAN,
298         RTE_FLOW_ITEM_TYPE_IPV6,
299         RTE_FLOW_ITEM_TYPE_END,
300 };
301
302 static enum rte_flow_item_type pattern_ipv4_vxlan_ipv6_udp[] = {
303         RTE_FLOW_ITEM_TYPE_ETH,
304         RTE_FLOW_ITEM_TYPE_IPV4,
305         RTE_FLOW_ITEM_TYPE_UDP,
306         RTE_FLOW_ITEM_TYPE_VXLAN,
307         RTE_FLOW_ITEM_TYPE_IPV6,
308         RTE_FLOW_ITEM_TYPE_UDP,
309         RTE_FLOW_ITEM_TYPE_END,
310 };
311
312 static enum rte_flow_item_type pattern_ipv4_vxlan_ipv6_tcp[] = {
313         RTE_FLOW_ITEM_TYPE_ETH,
314         RTE_FLOW_ITEM_TYPE_IPV4,
315         RTE_FLOW_ITEM_TYPE_UDP,
316         RTE_FLOW_ITEM_TYPE_VXLAN,
317         RTE_FLOW_ITEM_TYPE_IPV6,
318         RTE_FLOW_ITEM_TYPE_TCP,
319         RTE_FLOW_ITEM_TYPE_END,
320 };
321
322 static enum rte_flow_item_type pattern_ipv4_vxlan_ipv6_sctp[] = {
323         RTE_FLOW_ITEM_TYPE_ETH,
324         RTE_FLOW_ITEM_TYPE_IPV4,
325         RTE_FLOW_ITEM_TYPE_UDP,
326         RTE_FLOW_ITEM_TYPE_VXLAN,
327         RTE_FLOW_ITEM_TYPE_IPV6,
328         RTE_FLOW_ITEM_TYPE_SCTP,
329         RTE_FLOW_ITEM_TYPE_END,
330 };
331
332 static enum rte_flow_item_type pattern_ipv4_vxlan_ipv6_icmp[] = {
333         RTE_FLOW_ITEM_TYPE_ETH,
334         RTE_FLOW_ITEM_TYPE_IPV4,
335         RTE_FLOW_ITEM_TYPE_UDP,
336         RTE_FLOW_ITEM_TYPE_VXLAN,
337         RTE_FLOW_ITEM_TYPE_IPV6,
338         RTE_FLOW_ITEM_TYPE_ICMP,
339         RTE_FLOW_ITEM_TYPE_END,
340 };
341
342 /* IPv4 VXLAN MAC IPv6 */
343 static enum rte_flow_item_type pattern_ipv4_vxlan_eth_ipv6[] = {
344         RTE_FLOW_ITEM_TYPE_ETH,
345         RTE_FLOW_ITEM_TYPE_IPV4,
346         RTE_FLOW_ITEM_TYPE_UDP,
347         RTE_FLOW_ITEM_TYPE_VXLAN,
348         RTE_FLOW_ITEM_TYPE_ETH,
349         RTE_FLOW_ITEM_TYPE_IPV6,
350         RTE_FLOW_ITEM_TYPE_END,
351 };
352
353 static enum rte_flow_item_type pattern_ipv4_vxlan_eth_ipv6_udp[] = {
354         RTE_FLOW_ITEM_TYPE_ETH,
355         RTE_FLOW_ITEM_TYPE_IPV4,
356         RTE_FLOW_ITEM_TYPE_UDP,
357         RTE_FLOW_ITEM_TYPE_VXLAN,
358         RTE_FLOW_ITEM_TYPE_ETH,
359         RTE_FLOW_ITEM_TYPE_IPV6,
360         RTE_FLOW_ITEM_TYPE_UDP,
361         RTE_FLOW_ITEM_TYPE_END,
362 };
363
364 static enum rte_flow_item_type pattern_ipv4_vxlan_eth_ipv6_tcp[] = {
365         RTE_FLOW_ITEM_TYPE_ETH,
366         RTE_FLOW_ITEM_TYPE_IPV4,
367         RTE_FLOW_ITEM_TYPE_UDP,
368         RTE_FLOW_ITEM_TYPE_VXLAN,
369         RTE_FLOW_ITEM_TYPE_ETH,
370         RTE_FLOW_ITEM_TYPE_IPV6,
371         RTE_FLOW_ITEM_TYPE_TCP,
372         RTE_FLOW_ITEM_TYPE_END,
373 };
374
375 static enum rte_flow_item_type pattern_ipv4_vxlan_eth_ipv6_sctp[] = {
376         RTE_FLOW_ITEM_TYPE_ETH,
377         RTE_FLOW_ITEM_TYPE_IPV4,
378         RTE_FLOW_ITEM_TYPE_UDP,
379         RTE_FLOW_ITEM_TYPE_VXLAN,
380         RTE_FLOW_ITEM_TYPE_ETH,
381         RTE_FLOW_ITEM_TYPE_IPV6,
382         RTE_FLOW_ITEM_TYPE_SCTP,
383         RTE_FLOW_ITEM_TYPE_END,
384 };
385
386 static enum rte_flow_item_type pattern_ipv4_vxlan_eth_ipv6_icmp[] = {
387         RTE_FLOW_ITEM_TYPE_ETH,
388         RTE_FLOW_ITEM_TYPE_IPV4,
389         RTE_FLOW_ITEM_TYPE_UDP,
390         RTE_FLOW_ITEM_TYPE_VXLAN,
391         RTE_FLOW_ITEM_TYPE_ETH,
392         RTE_FLOW_ITEM_TYPE_IPV6,
393         RTE_FLOW_ITEM_TYPE_ICMP,
394         RTE_FLOW_ITEM_TYPE_END,
395 };
396
397 /* IPv4 NVGRE IPv4 */
398 static enum rte_flow_item_type pattern_ipv4_nvgre_ipv4[] = {
399         RTE_FLOW_ITEM_TYPE_ETH,
400         RTE_FLOW_ITEM_TYPE_IPV4,
401         RTE_FLOW_ITEM_TYPE_NVGRE,
402         RTE_FLOW_ITEM_TYPE_IPV4,
403         RTE_FLOW_ITEM_TYPE_END,
404 };
405
406 static enum rte_flow_item_type pattern_ipv4_nvgre_ipv4_udp[] = {
407         RTE_FLOW_ITEM_TYPE_ETH,
408         RTE_FLOW_ITEM_TYPE_IPV4,
409         RTE_FLOW_ITEM_TYPE_NVGRE,
410         RTE_FLOW_ITEM_TYPE_IPV4,
411         RTE_FLOW_ITEM_TYPE_UDP,
412         RTE_FLOW_ITEM_TYPE_END,
413 };
414
415 static enum rte_flow_item_type pattern_ipv4_nvgre_ipv4_tcp[] = {
416         RTE_FLOW_ITEM_TYPE_ETH,
417         RTE_FLOW_ITEM_TYPE_IPV4,
418         RTE_FLOW_ITEM_TYPE_NVGRE,
419         RTE_FLOW_ITEM_TYPE_IPV4,
420         RTE_FLOW_ITEM_TYPE_TCP,
421         RTE_FLOW_ITEM_TYPE_END,
422 };
423
424 static enum rte_flow_item_type pattern_ipv4_nvgre_ipv4_sctp[] = {
425         RTE_FLOW_ITEM_TYPE_ETH,
426         RTE_FLOW_ITEM_TYPE_IPV4,
427         RTE_FLOW_ITEM_TYPE_NVGRE,
428         RTE_FLOW_ITEM_TYPE_IPV4,
429         RTE_FLOW_ITEM_TYPE_SCTP,
430         RTE_FLOW_ITEM_TYPE_END,
431 };
432
433 static enum rte_flow_item_type pattern_ipv4_nvgre_ipv4_icmp[] = {
434         RTE_FLOW_ITEM_TYPE_ETH,
435         RTE_FLOW_ITEM_TYPE_IPV4,
436         RTE_FLOW_ITEM_TYPE_NVGRE,
437         RTE_FLOW_ITEM_TYPE_IPV4,
438         RTE_FLOW_ITEM_TYPE_ICMP,
439         RTE_FLOW_ITEM_TYPE_END,
440 };
441
442 /* IPv4 NVGRE MAC IPv4 */
443 static enum rte_flow_item_type pattern_ipv4_nvgre_eth_ipv4[] = {
444         RTE_FLOW_ITEM_TYPE_ETH,
445         RTE_FLOW_ITEM_TYPE_IPV4,
446         RTE_FLOW_ITEM_TYPE_NVGRE,
447         RTE_FLOW_ITEM_TYPE_ETH,
448         RTE_FLOW_ITEM_TYPE_IPV4,
449         RTE_FLOW_ITEM_TYPE_END,
450 };
451
452 static enum rte_flow_item_type pattern_ipv4_nvgre_eth_ipv4_udp[] = {
453         RTE_FLOW_ITEM_TYPE_ETH,
454         RTE_FLOW_ITEM_TYPE_IPV4,
455         RTE_FLOW_ITEM_TYPE_NVGRE,
456         RTE_FLOW_ITEM_TYPE_ETH,
457         RTE_FLOW_ITEM_TYPE_IPV4,
458         RTE_FLOW_ITEM_TYPE_UDP,
459         RTE_FLOW_ITEM_TYPE_END,
460 };
461
462 static enum rte_flow_item_type pattern_ipv4_nvgre_eth_ipv4_tcp[] = {
463         RTE_FLOW_ITEM_TYPE_ETH,
464         RTE_FLOW_ITEM_TYPE_IPV4,
465         RTE_FLOW_ITEM_TYPE_NVGRE,
466         RTE_FLOW_ITEM_TYPE_ETH,
467         RTE_FLOW_ITEM_TYPE_IPV4,
468         RTE_FLOW_ITEM_TYPE_TCP,
469         RTE_FLOW_ITEM_TYPE_END,
470 };
471
472 static enum rte_flow_item_type pattern_ipv4_nvgre_eth_ipv4_sctp[] = {
473         RTE_FLOW_ITEM_TYPE_ETH,
474         RTE_FLOW_ITEM_TYPE_IPV4,
475         RTE_FLOW_ITEM_TYPE_NVGRE,
476         RTE_FLOW_ITEM_TYPE_ETH,
477         RTE_FLOW_ITEM_TYPE_IPV4,
478         RTE_FLOW_ITEM_TYPE_SCTP,
479         RTE_FLOW_ITEM_TYPE_END,
480 };
481
482 static enum rte_flow_item_type pattern_ipv4_nvgre_eth_ipv4_icmp[] = {
483         RTE_FLOW_ITEM_TYPE_ETH,
484         RTE_FLOW_ITEM_TYPE_IPV4,
485         RTE_FLOW_ITEM_TYPE_NVGRE,
486         RTE_FLOW_ITEM_TYPE_ETH,
487         RTE_FLOW_ITEM_TYPE_IPV4,
488         RTE_FLOW_ITEM_TYPE_ICMP,
489         RTE_FLOW_ITEM_TYPE_END,
490 };
491
492 /* IPv4 NVGRE IPv6 */
493 static enum rte_flow_item_type pattern_ipv4_nvgre_ipv6[] = {
494         RTE_FLOW_ITEM_TYPE_ETH,
495         RTE_FLOW_ITEM_TYPE_IPV4,
496         RTE_FLOW_ITEM_TYPE_NVGRE,
497         RTE_FLOW_ITEM_TYPE_IPV6,
498         RTE_FLOW_ITEM_TYPE_END,
499 };
500
501 static enum rte_flow_item_type pattern_ipv4_nvgre_ipv6_udp[] = {
502         RTE_FLOW_ITEM_TYPE_ETH,
503         RTE_FLOW_ITEM_TYPE_IPV4,
504         RTE_FLOW_ITEM_TYPE_NVGRE,
505         RTE_FLOW_ITEM_TYPE_IPV6,
506         RTE_FLOW_ITEM_TYPE_UDP,
507         RTE_FLOW_ITEM_TYPE_END,
508 };
509
510 static enum rte_flow_item_type pattern_ipv4_nvgre_ipv6_tcp[] = {
511         RTE_FLOW_ITEM_TYPE_ETH,
512         RTE_FLOW_ITEM_TYPE_IPV4,
513         RTE_FLOW_ITEM_TYPE_NVGRE,
514         RTE_FLOW_ITEM_TYPE_IPV6,
515         RTE_FLOW_ITEM_TYPE_TCP,
516         RTE_FLOW_ITEM_TYPE_END,
517 };
518
519 static enum rte_flow_item_type pattern_ipv4_nvgre_ipv6_sctp[] = {
520         RTE_FLOW_ITEM_TYPE_ETH,
521         RTE_FLOW_ITEM_TYPE_IPV4,
522         RTE_FLOW_ITEM_TYPE_NVGRE,
523         RTE_FLOW_ITEM_TYPE_IPV6,
524         RTE_FLOW_ITEM_TYPE_SCTP,
525         RTE_FLOW_ITEM_TYPE_END,
526 };
527
528
529 /* IPv4 NVGRE MAC IPv6 */
530 static enum rte_flow_item_type pattern_ipv4_nvgre_eth_ipv6[] = {
531         RTE_FLOW_ITEM_TYPE_ETH,
532         RTE_FLOW_ITEM_TYPE_IPV4,
533         RTE_FLOW_ITEM_TYPE_NVGRE,
534         RTE_FLOW_ITEM_TYPE_ETH,
535         RTE_FLOW_ITEM_TYPE_IPV6,
536         RTE_FLOW_ITEM_TYPE_END,
537 };
538
539 static enum rte_flow_item_type pattern_ipv4_nvgre_eth_ipv6_udp[] = {
540         RTE_FLOW_ITEM_TYPE_ETH,
541         RTE_FLOW_ITEM_TYPE_IPV4,
542         RTE_FLOW_ITEM_TYPE_NVGRE,
543         RTE_FLOW_ITEM_TYPE_ETH,
544         RTE_FLOW_ITEM_TYPE_IPV6,
545         RTE_FLOW_ITEM_TYPE_UDP,
546         RTE_FLOW_ITEM_TYPE_END,
547 };
548
549 static enum rte_flow_item_type pattern_ipv4_nvgre_eth_ipv6_tcp[] = {
550         RTE_FLOW_ITEM_TYPE_ETH,
551         RTE_FLOW_ITEM_TYPE_IPV4,
552         RTE_FLOW_ITEM_TYPE_NVGRE,
553         RTE_FLOW_ITEM_TYPE_ETH,
554         RTE_FLOW_ITEM_TYPE_IPV6,
555         RTE_FLOW_ITEM_TYPE_TCP,
556         RTE_FLOW_ITEM_TYPE_END,
557 };
558
559 static enum rte_flow_item_type pattern_ipv4_nvgre_eth_ipv6_sctp[] = {
560         RTE_FLOW_ITEM_TYPE_ETH,
561         RTE_FLOW_ITEM_TYPE_IPV4,
562         RTE_FLOW_ITEM_TYPE_NVGRE,
563         RTE_FLOW_ITEM_TYPE_ETH,
564         RTE_FLOW_ITEM_TYPE_IPV6,
565         RTE_FLOW_ITEM_TYPE_SCTP,
566         RTE_FLOW_ITEM_TYPE_END,
567 };
568
569 static struct ice_flow_pattern ice_supported_patterns[] = {
570         {pattern_ethertype, INSET_ETHER},
571         {pattern_ipv4, INSET_MAC_IPV4},
572         {pattern_ipv4_udp, INSET_MAC_IPV4_L4},
573         {pattern_ipv4_sctp, INSET_MAC_IPV4_L4},
574         {pattern_ipv4_tcp, INSET_MAC_IPV4_L4},
575         {pattern_ipv4_icmp, INSET_MAC_IPV4_ICMP},
576         {pattern_ipv6, INSET_MAC_IPV6},
577         {pattern_ipv6_udp, INSET_MAC_IPV6_L4},
578         {pattern_ipv6_sctp, INSET_MAC_IPV6_L4},
579         {pattern_ipv6_tcp, INSET_MAC_IPV6_L4},
580         {pattern_ipv6_icmp6, INSET_MAC_IPV6_ICMP},
581         {pattern_ipv4_vxlan_ipv4, INSET_TUNNEL_IPV4_TYPE1},
582         {pattern_ipv4_vxlan_ipv4_udp, INSET_TUNNEL_IPV4_TYPE2},
583         {pattern_ipv4_vxlan_ipv4_tcp, INSET_TUNNEL_IPV4_TYPE2},
584         {pattern_ipv4_vxlan_ipv4_sctp, INSET_TUNNEL_IPV4_TYPE2},
585         {pattern_ipv4_vxlan_ipv4_icmp, INSET_TUNNEL_IPV4_TYPE3},
586         {pattern_ipv4_vxlan_eth_ipv4, INSET_TUNNEL_IPV4_TYPE1},
587         {pattern_ipv4_vxlan_eth_ipv4_udp, INSET_TUNNEL_IPV4_TYPE2},
588         {pattern_ipv4_vxlan_eth_ipv4_tcp, INSET_TUNNEL_IPV4_TYPE2},
589         {pattern_ipv4_vxlan_eth_ipv4_sctp, INSET_TUNNEL_IPV4_TYPE2},
590         {pattern_ipv4_vxlan_eth_ipv4_icmp, INSET_TUNNEL_IPV4_TYPE3},
591         {pattern_ipv4_vxlan_ipv6, INSET_TUNNEL_IPV6_TYPE1},
592         {pattern_ipv4_vxlan_ipv6_udp, INSET_TUNNEL_IPV6_TYPE2},
593         {pattern_ipv4_vxlan_ipv6_tcp, INSET_TUNNEL_IPV6_TYPE2},
594         {pattern_ipv4_vxlan_ipv6_sctp, INSET_TUNNEL_IPV6_TYPE2},
595         {pattern_ipv4_vxlan_ipv6_icmp, INSET_TUNNEL_IPV6_TYPE3},
596         {pattern_ipv4_vxlan_eth_ipv6, INSET_TUNNEL_IPV6_TYPE1},
597         {pattern_ipv4_vxlan_eth_ipv6_udp, INSET_TUNNEL_IPV6_TYPE2},
598         {pattern_ipv4_vxlan_eth_ipv6_tcp, INSET_TUNNEL_IPV6_TYPE2},
599         {pattern_ipv4_vxlan_eth_ipv6_sctp, INSET_TUNNEL_IPV6_TYPE2},
600         {pattern_ipv4_vxlan_eth_ipv6_icmp, INSET_TUNNEL_IPV6_TYPE3},
601         {pattern_ipv4_nvgre_ipv4, INSET_TUNNEL_IPV4_TYPE1},
602         {pattern_ipv4_nvgre_ipv4_udp, INSET_TUNNEL_IPV4_TYPE2},
603         {pattern_ipv4_nvgre_ipv4_tcp, INSET_TUNNEL_IPV4_TYPE2},
604         {pattern_ipv4_nvgre_ipv4_sctp, INSET_TUNNEL_IPV4_TYPE2},
605         {pattern_ipv4_nvgre_ipv4_icmp, INSET_TUNNEL_IPV4_TYPE3},
606         {pattern_ipv4_nvgre_eth_ipv4, INSET_TUNNEL_IPV4_TYPE1},
607         {pattern_ipv4_nvgre_eth_ipv4_udp, INSET_TUNNEL_IPV4_TYPE2},
608         {pattern_ipv4_nvgre_eth_ipv4_tcp, INSET_TUNNEL_IPV4_TYPE2},
609         {pattern_ipv4_nvgre_eth_ipv4_sctp, INSET_TUNNEL_IPV4_TYPE2},
610         {pattern_ipv4_nvgre_eth_ipv4_icmp, INSET_TUNNEL_IPV4_TYPE3},
611         {pattern_ipv4_nvgre_ipv6, INSET_TUNNEL_IPV6_TYPE1},
612         {pattern_ipv4_nvgre_ipv6_udp, INSET_TUNNEL_IPV6_TYPE2},
613         {pattern_ipv4_nvgre_ipv6_tcp, INSET_TUNNEL_IPV6_TYPE2},
614         {pattern_ipv4_nvgre_ipv6_sctp, INSET_TUNNEL_IPV6_TYPE2},
615         {pattern_ipv4_nvgre_eth_ipv6, INSET_TUNNEL_IPV6_TYPE1},
616         {pattern_ipv4_nvgre_eth_ipv6_udp, INSET_TUNNEL_IPV6_TYPE2},
617         {pattern_ipv4_nvgre_eth_ipv6_tcp, INSET_TUNNEL_IPV6_TYPE2},
618         {pattern_ipv4_nvgre_eth_ipv6_sctp, INSET_TUNNEL_IPV6_TYPE2},
619 };
620
621 #endif