1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2019 Intel Corporation
13 #include <rte_ether.h>
14 #include <ethdev_driver.h>
15 #include <rte_malloc.h>
16 #include <rte_tailq.h>
19 #include "iavf_generic_flow.h"
21 static struct iavf_engine_list engine_list =
22 TAILQ_HEAD_INITIALIZER(engine_list);
24 static int iavf_flow_validate(struct rte_eth_dev *dev,
25 const struct rte_flow_attr *attr,
26 const struct rte_flow_item pattern[],
27 const struct rte_flow_action actions[],
28 struct rte_flow_error *error);
29 static struct rte_flow *iavf_flow_create(struct rte_eth_dev *dev,
30 const struct rte_flow_attr *attr,
31 const struct rte_flow_item pattern[],
32 const struct rte_flow_action actions[],
33 struct rte_flow_error *error);
34 static int iavf_flow_destroy(struct rte_eth_dev *dev,
35 struct rte_flow *flow,
36 struct rte_flow_error *error);
37 static int iavf_flow_query(struct rte_eth_dev *dev,
38 struct rte_flow *flow,
39 const struct rte_flow_action *actions,
41 struct rte_flow_error *error);
43 const struct rte_flow_ops iavf_flow_ops = {
44 .validate = iavf_flow_validate,
45 .create = iavf_flow_create,
46 .destroy = iavf_flow_destroy,
47 .flush = iavf_flow_flush,
48 .query = iavf_flow_query,
52 enum rte_flow_item_type iavf_pattern_empty[] = {
53 RTE_FLOW_ITEM_TYPE_END,
57 enum rte_flow_item_type iavf_pattern_ethertype[] = {
58 RTE_FLOW_ITEM_TYPE_ETH,
59 RTE_FLOW_ITEM_TYPE_END,
62 enum rte_flow_item_type iavf_pattern_ethertype_vlan[] = {
63 RTE_FLOW_ITEM_TYPE_ETH,
64 RTE_FLOW_ITEM_TYPE_VLAN,
65 RTE_FLOW_ITEM_TYPE_END,
68 enum rte_flow_item_type iavf_pattern_ethertype_qinq[] = {
69 RTE_FLOW_ITEM_TYPE_ETH,
70 RTE_FLOW_ITEM_TYPE_VLAN,
71 RTE_FLOW_ITEM_TYPE_VLAN,
72 RTE_FLOW_ITEM_TYPE_END,
76 enum rte_flow_item_type iavf_pattern_eth_arp[] = {
77 RTE_FLOW_ITEM_TYPE_ETH,
78 RTE_FLOW_ITEM_TYPE_ARP_ETH_IPV4,
79 RTE_FLOW_ITEM_TYPE_END,
83 enum rte_flow_item_type iavf_pattern_eth_ipv4[] = {
84 RTE_FLOW_ITEM_TYPE_ETH,
85 RTE_FLOW_ITEM_TYPE_IPV4,
86 RTE_FLOW_ITEM_TYPE_END,
89 enum rte_flow_item_type iavf_pattern_eth_vlan_ipv4[] = {
90 RTE_FLOW_ITEM_TYPE_ETH,
91 RTE_FLOW_ITEM_TYPE_VLAN,
92 RTE_FLOW_ITEM_TYPE_IPV4,
93 RTE_FLOW_ITEM_TYPE_END,
96 enum rte_flow_item_type iavf_pattern_eth_qinq_ipv4[] = {
97 RTE_FLOW_ITEM_TYPE_ETH,
98 RTE_FLOW_ITEM_TYPE_VLAN,
99 RTE_FLOW_ITEM_TYPE_VLAN,
100 RTE_FLOW_ITEM_TYPE_IPV4,
101 RTE_FLOW_ITEM_TYPE_END,
104 enum rte_flow_item_type iavf_pattern_eth_ipv4_udp[] = {
105 RTE_FLOW_ITEM_TYPE_ETH,
106 RTE_FLOW_ITEM_TYPE_IPV4,
107 RTE_FLOW_ITEM_TYPE_UDP,
108 RTE_FLOW_ITEM_TYPE_END,
111 enum rte_flow_item_type iavf_pattern_eth_vlan_ipv4_udp[] = {
112 RTE_FLOW_ITEM_TYPE_ETH,
113 RTE_FLOW_ITEM_TYPE_VLAN,
114 RTE_FLOW_ITEM_TYPE_IPV4,
115 RTE_FLOW_ITEM_TYPE_UDP,
116 RTE_FLOW_ITEM_TYPE_END,
119 enum rte_flow_item_type iavf_pattern_eth_qinq_ipv4_udp[] = {
120 RTE_FLOW_ITEM_TYPE_ETH,
121 RTE_FLOW_ITEM_TYPE_VLAN,
122 RTE_FLOW_ITEM_TYPE_VLAN,
123 RTE_FLOW_ITEM_TYPE_IPV4,
124 RTE_FLOW_ITEM_TYPE_UDP,
125 RTE_FLOW_ITEM_TYPE_END,
128 enum rte_flow_item_type iavf_pattern_eth_ipv4_tcp[] = {
129 RTE_FLOW_ITEM_TYPE_ETH,
130 RTE_FLOW_ITEM_TYPE_IPV4,
131 RTE_FLOW_ITEM_TYPE_TCP,
132 RTE_FLOW_ITEM_TYPE_END,
135 enum rte_flow_item_type iavf_pattern_eth_vlan_ipv4_tcp[] = {
136 RTE_FLOW_ITEM_TYPE_ETH,
137 RTE_FLOW_ITEM_TYPE_VLAN,
138 RTE_FLOW_ITEM_TYPE_IPV4,
139 RTE_FLOW_ITEM_TYPE_TCP,
140 RTE_FLOW_ITEM_TYPE_END,
143 enum rte_flow_item_type iavf_pattern_eth_qinq_ipv4_tcp[] = {
144 RTE_FLOW_ITEM_TYPE_ETH,
145 RTE_FLOW_ITEM_TYPE_VLAN,
146 RTE_FLOW_ITEM_TYPE_VLAN,
147 RTE_FLOW_ITEM_TYPE_IPV4,
148 RTE_FLOW_ITEM_TYPE_TCP,
149 RTE_FLOW_ITEM_TYPE_END,
152 enum rte_flow_item_type iavf_pattern_eth_ipv4_sctp[] = {
153 RTE_FLOW_ITEM_TYPE_ETH,
154 RTE_FLOW_ITEM_TYPE_IPV4,
155 RTE_FLOW_ITEM_TYPE_SCTP,
156 RTE_FLOW_ITEM_TYPE_END,
159 enum rte_flow_item_type iavf_pattern_eth_vlan_ipv4_sctp[] = {
160 RTE_FLOW_ITEM_TYPE_ETH,
161 RTE_FLOW_ITEM_TYPE_VLAN,
162 RTE_FLOW_ITEM_TYPE_IPV4,
163 RTE_FLOW_ITEM_TYPE_SCTP,
164 RTE_FLOW_ITEM_TYPE_END,
167 enum rte_flow_item_type iavf_pattern_eth_qinq_ipv4_sctp[] = {
168 RTE_FLOW_ITEM_TYPE_ETH,
169 RTE_FLOW_ITEM_TYPE_VLAN,
170 RTE_FLOW_ITEM_TYPE_VLAN,
171 RTE_FLOW_ITEM_TYPE_IPV4,
172 RTE_FLOW_ITEM_TYPE_SCTP,
173 RTE_FLOW_ITEM_TYPE_END,
176 enum rte_flow_item_type iavf_pattern_eth_ipv4_icmp[] = {
177 RTE_FLOW_ITEM_TYPE_ETH,
178 RTE_FLOW_ITEM_TYPE_IPV4,
179 RTE_FLOW_ITEM_TYPE_ICMP,
180 RTE_FLOW_ITEM_TYPE_END,
183 enum rte_flow_item_type iavf_pattern_eth_vlan_ipv4_icmp[] = {
184 RTE_FLOW_ITEM_TYPE_ETH,
185 RTE_FLOW_ITEM_TYPE_VLAN,
186 RTE_FLOW_ITEM_TYPE_IPV4,
187 RTE_FLOW_ITEM_TYPE_ICMP,
188 RTE_FLOW_ITEM_TYPE_END,
191 enum rte_flow_item_type iavf_pattern_eth_qinq_ipv4_icmp[] = {
192 RTE_FLOW_ITEM_TYPE_ETH,
193 RTE_FLOW_ITEM_TYPE_VLAN,
194 RTE_FLOW_ITEM_TYPE_VLAN,
195 RTE_FLOW_ITEM_TYPE_IPV4,
196 RTE_FLOW_ITEM_TYPE_ICMP,
197 RTE_FLOW_ITEM_TYPE_END,
200 /* non-tunnel IPv6 */
201 enum rte_flow_item_type iavf_pattern_eth_ipv6[] = {
202 RTE_FLOW_ITEM_TYPE_ETH,
203 RTE_FLOW_ITEM_TYPE_IPV6,
204 RTE_FLOW_ITEM_TYPE_END,
207 enum rte_flow_item_type iavf_pattern_eth_vlan_ipv6[] = {
208 RTE_FLOW_ITEM_TYPE_ETH,
209 RTE_FLOW_ITEM_TYPE_VLAN,
210 RTE_FLOW_ITEM_TYPE_IPV6,
211 RTE_FLOW_ITEM_TYPE_END,
214 enum rte_flow_item_type iavf_pattern_eth_qinq_ipv6[] = {
215 RTE_FLOW_ITEM_TYPE_ETH,
216 RTE_FLOW_ITEM_TYPE_VLAN,
217 RTE_FLOW_ITEM_TYPE_VLAN,
218 RTE_FLOW_ITEM_TYPE_IPV6,
219 RTE_FLOW_ITEM_TYPE_END,
222 enum rte_flow_item_type iavf_pattern_eth_ipv6_frag_ext[] = {
223 RTE_FLOW_ITEM_TYPE_ETH,
224 RTE_FLOW_ITEM_TYPE_IPV6,
225 RTE_FLOW_ITEM_TYPE_IPV6_FRAG_EXT,
226 RTE_FLOW_ITEM_TYPE_END,
229 enum rte_flow_item_type iavf_pattern_eth_vlan_ipv6_frag_ext[] = {
230 RTE_FLOW_ITEM_TYPE_ETH,
231 RTE_FLOW_ITEM_TYPE_VLAN,
232 RTE_FLOW_ITEM_TYPE_IPV6,
233 RTE_FLOW_ITEM_TYPE_IPV6_FRAG_EXT,
234 RTE_FLOW_ITEM_TYPE_END,
237 enum rte_flow_item_type iavf_pattern_eth_qinq_ipv6_frag_ext[] = {
238 RTE_FLOW_ITEM_TYPE_ETH,
239 RTE_FLOW_ITEM_TYPE_VLAN,
240 RTE_FLOW_ITEM_TYPE_VLAN,
241 RTE_FLOW_ITEM_TYPE_IPV6,
242 RTE_FLOW_ITEM_TYPE_IPV6_FRAG_EXT,
243 RTE_FLOW_ITEM_TYPE_END,
246 enum rte_flow_item_type iavf_pattern_eth_ipv6_udp[] = {
247 RTE_FLOW_ITEM_TYPE_ETH,
248 RTE_FLOW_ITEM_TYPE_IPV6,
249 RTE_FLOW_ITEM_TYPE_UDP,
250 RTE_FLOW_ITEM_TYPE_END,
253 enum rte_flow_item_type iavf_pattern_eth_vlan_ipv6_udp[] = {
254 RTE_FLOW_ITEM_TYPE_ETH,
255 RTE_FLOW_ITEM_TYPE_VLAN,
256 RTE_FLOW_ITEM_TYPE_IPV6,
257 RTE_FLOW_ITEM_TYPE_UDP,
258 RTE_FLOW_ITEM_TYPE_END,
261 enum rte_flow_item_type iavf_pattern_eth_qinq_ipv6_udp[] = {
262 RTE_FLOW_ITEM_TYPE_ETH,
263 RTE_FLOW_ITEM_TYPE_VLAN,
264 RTE_FLOW_ITEM_TYPE_VLAN,
265 RTE_FLOW_ITEM_TYPE_IPV6,
266 RTE_FLOW_ITEM_TYPE_UDP,
267 RTE_FLOW_ITEM_TYPE_END,
270 enum rte_flow_item_type iavf_pattern_eth_ipv6_tcp[] = {
271 RTE_FLOW_ITEM_TYPE_ETH,
272 RTE_FLOW_ITEM_TYPE_IPV6,
273 RTE_FLOW_ITEM_TYPE_TCP,
274 RTE_FLOW_ITEM_TYPE_END,
277 enum rte_flow_item_type iavf_pattern_eth_vlan_ipv6_tcp[] = {
278 RTE_FLOW_ITEM_TYPE_ETH,
279 RTE_FLOW_ITEM_TYPE_VLAN,
280 RTE_FLOW_ITEM_TYPE_IPV6,
281 RTE_FLOW_ITEM_TYPE_TCP,
282 RTE_FLOW_ITEM_TYPE_END,
285 enum rte_flow_item_type iavf_pattern_eth_qinq_ipv6_tcp[] = {
286 RTE_FLOW_ITEM_TYPE_ETH,
287 RTE_FLOW_ITEM_TYPE_VLAN,
288 RTE_FLOW_ITEM_TYPE_VLAN,
289 RTE_FLOW_ITEM_TYPE_IPV6,
290 RTE_FLOW_ITEM_TYPE_TCP,
291 RTE_FLOW_ITEM_TYPE_END,
294 enum rte_flow_item_type iavf_pattern_eth_ipv6_sctp[] = {
295 RTE_FLOW_ITEM_TYPE_ETH,
296 RTE_FLOW_ITEM_TYPE_IPV6,
297 RTE_FLOW_ITEM_TYPE_SCTP,
298 RTE_FLOW_ITEM_TYPE_END,
301 enum rte_flow_item_type iavf_pattern_eth_vlan_ipv6_sctp[] = {
302 RTE_FLOW_ITEM_TYPE_ETH,
303 RTE_FLOW_ITEM_TYPE_VLAN,
304 RTE_FLOW_ITEM_TYPE_IPV6,
305 RTE_FLOW_ITEM_TYPE_SCTP,
306 RTE_FLOW_ITEM_TYPE_END,
309 enum rte_flow_item_type iavf_pattern_eth_qinq_ipv6_sctp[] = {
310 RTE_FLOW_ITEM_TYPE_ETH,
311 RTE_FLOW_ITEM_TYPE_VLAN,
312 RTE_FLOW_ITEM_TYPE_VLAN,
313 RTE_FLOW_ITEM_TYPE_IPV6,
314 RTE_FLOW_ITEM_TYPE_SCTP,
315 RTE_FLOW_ITEM_TYPE_END,
318 enum rte_flow_item_type iavf_pattern_eth_ipv6_icmp6[] = {
319 RTE_FLOW_ITEM_TYPE_ETH,
320 RTE_FLOW_ITEM_TYPE_IPV6,
321 RTE_FLOW_ITEM_TYPE_ICMP6,
322 RTE_FLOW_ITEM_TYPE_END,
325 enum rte_flow_item_type iavf_pattern_eth_vlan_ipv6_icmp6[] = {
326 RTE_FLOW_ITEM_TYPE_ETH,
327 RTE_FLOW_ITEM_TYPE_VLAN,
328 RTE_FLOW_ITEM_TYPE_IPV6,
329 RTE_FLOW_ITEM_TYPE_ICMP6,
330 RTE_FLOW_ITEM_TYPE_END,
333 enum rte_flow_item_type iavf_pattern_eth_qinq_ipv6_icmp6[] = {
334 RTE_FLOW_ITEM_TYPE_ETH,
335 RTE_FLOW_ITEM_TYPE_VLAN,
336 RTE_FLOW_ITEM_TYPE_VLAN,
337 RTE_FLOW_ITEM_TYPE_IPV6,
338 RTE_FLOW_ITEM_TYPE_ICMP6,
339 RTE_FLOW_ITEM_TYPE_END,
343 enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpc[] = {
344 RTE_FLOW_ITEM_TYPE_ETH,
345 RTE_FLOW_ITEM_TYPE_IPV4,
346 RTE_FLOW_ITEM_TYPE_UDP,
347 RTE_FLOW_ITEM_TYPE_GTPC,
348 RTE_FLOW_ITEM_TYPE_END,
352 enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpu[] = {
353 RTE_FLOW_ITEM_TYPE_ETH,
354 RTE_FLOW_ITEM_TYPE_IPV4,
355 RTE_FLOW_ITEM_TYPE_UDP,
356 RTE_FLOW_ITEM_TYPE_GTPU,
357 RTE_FLOW_ITEM_TYPE_END,
360 enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpu_eh[] = {
361 RTE_FLOW_ITEM_TYPE_ETH,
362 RTE_FLOW_ITEM_TYPE_IPV4,
363 RTE_FLOW_ITEM_TYPE_UDP,
364 RTE_FLOW_ITEM_TYPE_GTPU,
365 RTE_FLOW_ITEM_TYPE_GTP_PSC,
366 RTE_FLOW_ITEM_TYPE_END,
370 enum rte_flow_item_type iavf_pattern_eth_ipv6_gtpc[] = {
371 RTE_FLOW_ITEM_TYPE_ETH,
372 RTE_FLOW_ITEM_TYPE_IPV6,
373 RTE_FLOW_ITEM_TYPE_UDP,
374 RTE_FLOW_ITEM_TYPE_GTPC,
375 RTE_FLOW_ITEM_TYPE_END,
379 enum rte_flow_item_type iavf_pattern_eth_ipv6_gtpu[] = {
380 RTE_FLOW_ITEM_TYPE_ETH,
381 RTE_FLOW_ITEM_TYPE_IPV6,
382 RTE_FLOW_ITEM_TYPE_UDP,
383 RTE_FLOW_ITEM_TYPE_GTPU,
384 RTE_FLOW_ITEM_TYPE_END,
387 enum rte_flow_item_type iavf_pattern_eth_ipv6_gtpu_eh[] = {
388 RTE_FLOW_ITEM_TYPE_ETH,
389 RTE_FLOW_ITEM_TYPE_IPV6,
390 RTE_FLOW_ITEM_TYPE_UDP,
391 RTE_FLOW_ITEM_TYPE_GTPU,
392 RTE_FLOW_ITEM_TYPE_GTP_PSC,
393 RTE_FLOW_ITEM_TYPE_END,
397 enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpu_ipv4[] = {
398 RTE_FLOW_ITEM_TYPE_ETH,
399 RTE_FLOW_ITEM_TYPE_IPV4,
400 RTE_FLOW_ITEM_TYPE_UDP,
401 RTE_FLOW_ITEM_TYPE_GTPU,
402 RTE_FLOW_ITEM_TYPE_IPV4,
403 RTE_FLOW_ITEM_TYPE_END,
406 enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpu_ipv4_udp[] = {
407 RTE_FLOW_ITEM_TYPE_ETH,
408 RTE_FLOW_ITEM_TYPE_IPV4,
409 RTE_FLOW_ITEM_TYPE_UDP,
410 RTE_FLOW_ITEM_TYPE_GTPU,
411 RTE_FLOW_ITEM_TYPE_IPV4,
412 RTE_FLOW_ITEM_TYPE_UDP,
413 RTE_FLOW_ITEM_TYPE_END,
416 enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpu_ipv4_tcp[] = {
417 RTE_FLOW_ITEM_TYPE_ETH,
418 RTE_FLOW_ITEM_TYPE_IPV4,
419 RTE_FLOW_ITEM_TYPE_UDP,
420 RTE_FLOW_ITEM_TYPE_GTPU,
421 RTE_FLOW_ITEM_TYPE_IPV4,
422 RTE_FLOW_ITEM_TYPE_TCP,
423 RTE_FLOW_ITEM_TYPE_END,
426 enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpu_ipv4_icmp[] = {
427 RTE_FLOW_ITEM_TYPE_ETH,
428 RTE_FLOW_ITEM_TYPE_IPV4,
429 RTE_FLOW_ITEM_TYPE_UDP,
430 RTE_FLOW_ITEM_TYPE_GTPU,
431 RTE_FLOW_ITEM_TYPE_IPV4,
432 RTE_FLOW_ITEM_TYPE_ICMP,
433 RTE_FLOW_ITEM_TYPE_END,
436 enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv4_gtpu[] = {
437 RTE_FLOW_ITEM_TYPE_ETH,
438 RTE_FLOW_ITEM_TYPE_IPV4,
439 RTE_FLOW_ITEM_TYPE_GRE,
440 RTE_FLOW_ITEM_TYPE_IPV4,
441 RTE_FLOW_ITEM_TYPE_UDP,
442 RTE_FLOW_ITEM_TYPE_GTPU,
443 RTE_FLOW_ITEM_TYPE_END,
446 /* IPV4 GRE IPv4 UDP GTPU IPv4*/
447 enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv4_gtpu_ipv4[] = {
448 RTE_FLOW_ITEM_TYPE_ETH,
449 RTE_FLOW_ITEM_TYPE_IPV4,
450 RTE_FLOW_ITEM_TYPE_GRE,
451 RTE_FLOW_ITEM_TYPE_IPV4,
452 RTE_FLOW_ITEM_TYPE_UDP,
453 RTE_FLOW_ITEM_TYPE_GTPU,
454 RTE_FLOW_ITEM_TYPE_IPV4,
455 RTE_FLOW_ITEM_TYPE_END,
458 enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv4_gtpu_ipv4_udp[] = {
459 RTE_FLOW_ITEM_TYPE_ETH,
460 RTE_FLOW_ITEM_TYPE_IPV4,
461 RTE_FLOW_ITEM_TYPE_GRE,
462 RTE_FLOW_ITEM_TYPE_IPV4,
463 RTE_FLOW_ITEM_TYPE_UDP,
464 RTE_FLOW_ITEM_TYPE_GTPU,
465 RTE_FLOW_ITEM_TYPE_IPV4,
466 RTE_FLOW_ITEM_TYPE_UDP,
467 RTE_FLOW_ITEM_TYPE_END,
470 enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv4_gtpu_ipv4_tcp[] = {
471 RTE_FLOW_ITEM_TYPE_ETH,
472 RTE_FLOW_ITEM_TYPE_IPV4,
473 RTE_FLOW_ITEM_TYPE_GRE,
474 RTE_FLOW_ITEM_TYPE_IPV4,
475 RTE_FLOW_ITEM_TYPE_UDP,
476 RTE_FLOW_ITEM_TYPE_GTPU,
477 RTE_FLOW_ITEM_TYPE_IPV4,
478 RTE_FLOW_ITEM_TYPE_TCP,
479 RTE_FLOW_ITEM_TYPE_END,
482 /* IPV4 GRE IPv4 UDP GTPU IPv6*/
483 enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv4_gtpu_ipv6[] = {
484 RTE_FLOW_ITEM_TYPE_ETH,
485 RTE_FLOW_ITEM_TYPE_IPV4,
486 RTE_FLOW_ITEM_TYPE_GRE,
487 RTE_FLOW_ITEM_TYPE_IPV4,
488 RTE_FLOW_ITEM_TYPE_UDP,
489 RTE_FLOW_ITEM_TYPE_GTPU,
490 RTE_FLOW_ITEM_TYPE_IPV6,
491 RTE_FLOW_ITEM_TYPE_END,
494 enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv4_gtpu_ipv6_udp[] = {
495 RTE_FLOW_ITEM_TYPE_ETH,
496 RTE_FLOW_ITEM_TYPE_IPV4,
497 RTE_FLOW_ITEM_TYPE_GRE,
498 RTE_FLOW_ITEM_TYPE_IPV4,
499 RTE_FLOW_ITEM_TYPE_UDP,
500 RTE_FLOW_ITEM_TYPE_GTPU,
501 RTE_FLOW_ITEM_TYPE_IPV6,
502 RTE_FLOW_ITEM_TYPE_UDP,
503 RTE_FLOW_ITEM_TYPE_END,
506 enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv4_gtpu_ipv6_tcp[] = {
507 RTE_FLOW_ITEM_TYPE_ETH,
508 RTE_FLOW_ITEM_TYPE_IPV4,
509 RTE_FLOW_ITEM_TYPE_GRE,
510 RTE_FLOW_ITEM_TYPE_IPV4,
511 RTE_FLOW_ITEM_TYPE_UDP,
512 RTE_FLOW_ITEM_TYPE_GTPU,
513 RTE_FLOW_ITEM_TYPE_IPV6,
514 RTE_FLOW_ITEM_TYPE_TCP,
515 RTE_FLOW_ITEM_TYPE_END,
518 enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv6_gtpu[] = {
519 RTE_FLOW_ITEM_TYPE_ETH,
520 RTE_FLOW_ITEM_TYPE_IPV4,
521 RTE_FLOW_ITEM_TYPE_GRE,
522 RTE_FLOW_ITEM_TYPE_IPV6,
523 RTE_FLOW_ITEM_TYPE_UDP,
524 RTE_FLOW_ITEM_TYPE_GTPU,
525 RTE_FLOW_ITEM_TYPE_END,
528 /* IPV4 GRE IPv6 UDP GTPU IPv4*/
529 enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv6_gtpu_ipv4[] = {
530 RTE_FLOW_ITEM_TYPE_ETH,
531 RTE_FLOW_ITEM_TYPE_IPV4,
532 RTE_FLOW_ITEM_TYPE_GRE,
533 RTE_FLOW_ITEM_TYPE_IPV6,
534 RTE_FLOW_ITEM_TYPE_UDP,
535 RTE_FLOW_ITEM_TYPE_GTPU,
536 RTE_FLOW_ITEM_TYPE_IPV4,
537 RTE_FLOW_ITEM_TYPE_END,
540 enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv6_gtpu_ipv4_udp[] = {
541 RTE_FLOW_ITEM_TYPE_ETH,
542 RTE_FLOW_ITEM_TYPE_IPV4,
543 RTE_FLOW_ITEM_TYPE_GRE,
544 RTE_FLOW_ITEM_TYPE_IPV6,
545 RTE_FLOW_ITEM_TYPE_UDP,
546 RTE_FLOW_ITEM_TYPE_GTPU,
547 RTE_FLOW_ITEM_TYPE_IPV4,
548 RTE_FLOW_ITEM_TYPE_UDP,
549 RTE_FLOW_ITEM_TYPE_END,
552 enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv6_gtpu_ipv4_tcp[] = {
553 RTE_FLOW_ITEM_TYPE_ETH,
554 RTE_FLOW_ITEM_TYPE_IPV4,
555 RTE_FLOW_ITEM_TYPE_GRE,
556 RTE_FLOW_ITEM_TYPE_IPV6,
557 RTE_FLOW_ITEM_TYPE_UDP,
558 RTE_FLOW_ITEM_TYPE_GTPU,
559 RTE_FLOW_ITEM_TYPE_IPV4,
560 RTE_FLOW_ITEM_TYPE_TCP,
561 RTE_FLOW_ITEM_TYPE_END,
564 /* IPV4 GRE IPv6 UDP GTPU IPv6*/
565 enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv6_gtpu_ipv6[] = {
566 RTE_FLOW_ITEM_TYPE_ETH,
567 RTE_FLOW_ITEM_TYPE_IPV4,
568 RTE_FLOW_ITEM_TYPE_GRE,
569 RTE_FLOW_ITEM_TYPE_IPV6,
570 RTE_FLOW_ITEM_TYPE_UDP,
571 RTE_FLOW_ITEM_TYPE_GTPU,
572 RTE_FLOW_ITEM_TYPE_IPV6,
573 RTE_FLOW_ITEM_TYPE_END,
576 enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv6_gtpu_ipv6_udp[] = {
577 RTE_FLOW_ITEM_TYPE_ETH,
578 RTE_FLOW_ITEM_TYPE_IPV4,
579 RTE_FLOW_ITEM_TYPE_GRE,
580 RTE_FLOW_ITEM_TYPE_IPV6,
581 RTE_FLOW_ITEM_TYPE_UDP,
582 RTE_FLOW_ITEM_TYPE_GTPU,
583 RTE_FLOW_ITEM_TYPE_IPV6,
584 RTE_FLOW_ITEM_TYPE_UDP,
585 RTE_FLOW_ITEM_TYPE_END,
588 enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv6_gtpu_ipv6_tcp[] = {
589 RTE_FLOW_ITEM_TYPE_ETH,
590 RTE_FLOW_ITEM_TYPE_IPV4,
591 RTE_FLOW_ITEM_TYPE_GRE,
592 RTE_FLOW_ITEM_TYPE_IPV6,
593 RTE_FLOW_ITEM_TYPE_UDP,
594 RTE_FLOW_ITEM_TYPE_GTPU,
595 RTE_FLOW_ITEM_TYPE_IPV6,
596 RTE_FLOW_ITEM_TYPE_TCP,
597 RTE_FLOW_ITEM_TYPE_END,
600 enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv4_gtpu[] = {
601 RTE_FLOW_ITEM_TYPE_ETH,
602 RTE_FLOW_ITEM_TYPE_IPV6,
603 RTE_FLOW_ITEM_TYPE_GRE,
604 RTE_FLOW_ITEM_TYPE_IPV4,
605 RTE_FLOW_ITEM_TYPE_UDP,
606 RTE_FLOW_ITEM_TYPE_GTPU,
607 RTE_FLOW_ITEM_TYPE_END,
610 /* IPV6 GRE IPv4 UDP GTPU IPv4*/
611 enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv4_gtpu_ipv4[] = {
612 RTE_FLOW_ITEM_TYPE_ETH,
613 RTE_FLOW_ITEM_TYPE_IPV6,
614 RTE_FLOW_ITEM_TYPE_GRE,
615 RTE_FLOW_ITEM_TYPE_IPV4,
616 RTE_FLOW_ITEM_TYPE_UDP,
617 RTE_FLOW_ITEM_TYPE_GTPU,
618 RTE_FLOW_ITEM_TYPE_IPV4,
619 RTE_FLOW_ITEM_TYPE_END,
622 enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv4_gtpu_ipv4_udp[] = {
623 RTE_FLOW_ITEM_TYPE_ETH,
624 RTE_FLOW_ITEM_TYPE_IPV6,
625 RTE_FLOW_ITEM_TYPE_GRE,
626 RTE_FLOW_ITEM_TYPE_IPV4,
627 RTE_FLOW_ITEM_TYPE_UDP,
628 RTE_FLOW_ITEM_TYPE_GTPU,
629 RTE_FLOW_ITEM_TYPE_IPV4,
630 RTE_FLOW_ITEM_TYPE_UDP,
631 RTE_FLOW_ITEM_TYPE_END,
634 enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv4_gtpu_ipv4_tcp[] = {
635 RTE_FLOW_ITEM_TYPE_ETH,
636 RTE_FLOW_ITEM_TYPE_IPV6,
637 RTE_FLOW_ITEM_TYPE_GRE,
638 RTE_FLOW_ITEM_TYPE_IPV4,
639 RTE_FLOW_ITEM_TYPE_UDP,
640 RTE_FLOW_ITEM_TYPE_GTPU,
641 RTE_FLOW_ITEM_TYPE_IPV4,
642 RTE_FLOW_ITEM_TYPE_TCP,
643 RTE_FLOW_ITEM_TYPE_END,
646 /* IPV4 GRE IPv4 UDP GTPU IPv6*/
647 enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv4_gtpu_ipv6[] = {
648 RTE_FLOW_ITEM_TYPE_ETH,
649 RTE_FLOW_ITEM_TYPE_IPV6,
650 RTE_FLOW_ITEM_TYPE_GRE,
651 RTE_FLOW_ITEM_TYPE_IPV4,
652 RTE_FLOW_ITEM_TYPE_UDP,
653 RTE_FLOW_ITEM_TYPE_GTPU,
654 RTE_FLOW_ITEM_TYPE_IPV6,
655 RTE_FLOW_ITEM_TYPE_END,
658 enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv4_gtpu_ipv6_udp[] = {
659 RTE_FLOW_ITEM_TYPE_ETH,
660 RTE_FLOW_ITEM_TYPE_IPV6,
661 RTE_FLOW_ITEM_TYPE_GRE,
662 RTE_FLOW_ITEM_TYPE_IPV4,
663 RTE_FLOW_ITEM_TYPE_UDP,
664 RTE_FLOW_ITEM_TYPE_GTPU,
665 RTE_FLOW_ITEM_TYPE_IPV6,
666 RTE_FLOW_ITEM_TYPE_UDP,
667 RTE_FLOW_ITEM_TYPE_END,
670 enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv4_gtpu_ipv6_tcp[] = {
671 RTE_FLOW_ITEM_TYPE_ETH,
672 RTE_FLOW_ITEM_TYPE_IPV6,
673 RTE_FLOW_ITEM_TYPE_GRE,
674 RTE_FLOW_ITEM_TYPE_IPV4,
675 RTE_FLOW_ITEM_TYPE_UDP,
676 RTE_FLOW_ITEM_TYPE_GTPU,
677 RTE_FLOW_ITEM_TYPE_IPV6,
678 RTE_FLOW_ITEM_TYPE_TCP,
679 RTE_FLOW_ITEM_TYPE_END,
682 enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv6_gtpu[] = {
683 RTE_FLOW_ITEM_TYPE_ETH,
684 RTE_FLOW_ITEM_TYPE_IPV6,
685 RTE_FLOW_ITEM_TYPE_GRE,
686 RTE_FLOW_ITEM_TYPE_IPV6,
687 RTE_FLOW_ITEM_TYPE_UDP,
688 RTE_FLOW_ITEM_TYPE_GTPU,
689 RTE_FLOW_ITEM_TYPE_END,
692 /* IPV6 GRE IPv6 UDP GTPU IPv4*/
693 enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv6_gtpu_ipv4[] = {
694 RTE_FLOW_ITEM_TYPE_ETH,
695 RTE_FLOW_ITEM_TYPE_IPV6,
696 RTE_FLOW_ITEM_TYPE_GRE,
697 RTE_FLOW_ITEM_TYPE_IPV6,
698 RTE_FLOW_ITEM_TYPE_UDP,
699 RTE_FLOW_ITEM_TYPE_GTPU,
700 RTE_FLOW_ITEM_TYPE_IPV4,
701 RTE_FLOW_ITEM_TYPE_END,
704 enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv6_gtpu_ipv4_udp[] = {
705 RTE_FLOW_ITEM_TYPE_ETH,
706 RTE_FLOW_ITEM_TYPE_IPV6,
707 RTE_FLOW_ITEM_TYPE_GRE,
708 RTE_FLOW_ITEM_TYPE_IPV6,
709 RTE_FLOW_ITEM_TYPE_UDP,
710 RTE_FLOW_ITEM_TYPE_GTPU,
711 RTE_FLOW_ITEM_TYPE_IPV4,
712 RTE_FLOW_ITEM_TYPE_UDP,
713 RTE_FLOW_ITEM_TYPE_END,
716 enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv6_gtpu_ipv4_tcp[] = {
717 RTE_FLOW_ITEM_TYPE_ETH,
718 RTE_FLOW_ITEM_TYPE_IPV6,
719 RTE_FLOW_ITEM_TYPE_GRE,
720 RTE_FLOW_ITEM_TYPE_IPV6,
721 RTE_FLOW_ITEM_TYPE_UDP,
722 RTE_FLOW_ITEM_TYPE_GTPU,
723 RTE_FLOW_ITEM_TYPE_IPV4,
724 RTE_FLOW_ITEM_TYPE_TCP,
725 RTE_FLOW_ITEM_TYPE_END,
728 /* IPV6 GRE IPv6 UDP GTPU IPv6*/
729 enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv6_gtpu_ipv6[] = {
730 RTE_FLOW_ITEM_TYPE_ETH,
731 RTE_FLOW_ITEM_TYPE_IPV6,
732 RTE_FLOW_ITEM_TYPE_GRE,
733 RTE_FLOW_ITEM_TYPE_IPV6,
734 RTE_FLOW_ITEM_TYPE_UDP,
735 RTE_FLOW_ITEM_TYPE_GTPU,
736 RTE_FLOW_ITEM_TYPE_IPV6,
737 RTE_FLOW_ITEM_TYPE_END,
740 enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv6_gtpu_ipv6_udp[] = {
741 RTE_FLOW_ITEM_TYPE_ETH,
742 RTE_FLOW_ITEM_TYPE_IPV6,
743 RTE_FLOW_ITEM_TYPE_GRE,
744 RTE_FLOW_ITEM_TYPE_IPV6,
745 RTE_FLOW_ITEM_TYPE_UDP,
746 RTE_FLOW_ITEM_TYPE_GTPU,
747 RTE_FLOW_ITEM_TYPE_IPV6,
748 RTE_FLOW_ITEM_TYPE_UDP,
749 RTE_FLOW_ITEM_TYPE_END,
752 enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv6_gtpu_ipv6_tcp[] = {
753 RTE_FLOW_ITEM_TYPE_ETH,
754 RTE_FLOW_ITEM_TYPE_IPV6,
755 RTE_FLOW_ITEM_TYPE_GRE,
756 RTE_FLOW_ITEM_TYPE_IPV6,
757 RTE_FLOW_ITEM_TYPE_UDP,
758 RTE_FLOW_ITEM_TYPE_GTPU,
759 RTE_FLOW_ITEM_TYPE_IPV6,
760 RTE_FLOW_ITEM_TYPE_TCP,
761 RTE_FLOW_ITEM_TYPE_END,
764 enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv4_gtpu_eh[] = {
765 RTE_FLOW_ITEM_TYPE_ETH,
766 RTE_FLOW_ITEM_TYPE_IPV4,
767 RTE_FLOW_ITEM_TYPE_GRE,
768 RTE_FLOW_ITEM_TYPE_IPV4,
769 RTE_FLOW_ITEM_TYPE_UDP,
770 RTE_FLOW_ITEM_TYPE_GTPU,
771 RTE_FLOW_ITEM_TYPE_GTP_PSC,
772 RTE_FLOW_ITEM_TYPE_END,
775 /* IPV4 GRE IPv4 UDP GTPU EH IPv4*/
776 enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv4_gtpu_eh_ipv4[] = {
777 RTE_FLOW_ITEM_TYPE_ETH,
778 RTE_FLOW_ITEM_TYPE_IPV4,
779 RTE_FLOW_ITEM_TYPE_GRE,
780 RTE_FLOW_ITEM_TYPE_IPV4,
781 RTE_FLOW_ITEM_TYPE_UDP,
782 RTE_FLOW_ITEM_TYPE_GTPU,
783 RTE_FLOW_ITEM_TYPE_GTP_PSC,
784 RTE_FLOW_ITEM_TYPE_IPV4,
785 RTE_FLOW_ITEM_TYPE_END,
788 enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv4_gtpu_eh_ipv4_udp[] = {
789 RTE_FLOW_ITEM_TYPE_ETH,
790 RTE_FLOW_ITEM_TYPE_IPV4,
791 RTE_FLOW_ITEM_TYPE_GRE,
792 RTE_FLOW_ITEM_TYPE_IPV4,
793 RTE_FLOW_ITEM_TYPE_UDP,
794 RTE_FLOW_ITEM_TYPE_GTPU,
795 RTE_FLOW_ITEM_TYPE_GTP_PSC,
796 RTE_FLOW_ITEM_TYPE_IPV4,
797 RTE_FLOW_ITEM_TYPE_UDP,
798 RTE_FLOW_ITEM_TYPE_END,
801 enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv4_gtpu_eh_ipv4_tcp[] = {
802 RTE_FLOW_ITEM_TYPE_ETH,
803 RTE_FLOW_ITEM_TYPE_IPV4,
804 RTE_FLOW_ITEM_TYPE_GRE,
805 RTE_FLOW_ITEM_TYPE_IPV4,
806 RTE_FLOW_ITEM_TYPE_UDP,
807 RTE_FLOW_ITEM_TYPE_GTPU,
808 RTE_FLOW_ITEM_TYPE_GTP_PSC,
809 RTE_FLOW_ITEM_TYPE_IPV4,
810 RTE_FLOW_ITEM_TYPE_TCP,
811 RTE_FLOW_ITEM_TYPE_END,
814 /* IPV4 GRE IPv4 UDP GTPU IPv6*/
815 enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv4_gtpu_eh_ipv6[] = {
816 RTE_FLOW_ITEM_TYPE_ETH,
817 RTE_FLOW_ITEM_TYPE_IPV4,
818 RTE_FLOW_ITEM_TYPE_GRE,
819 RTE_FLOW_ITEM_TYPE_IPV4,
820 RTE_FLOW_ITEM_TYPE_UDP,
821 RTE_FLOW_ITEM_TYPE_GTPU,
822 RTE_FLOW_ITEM_TYPE_GTP_PSC,
823 RTE_FLOW_ITEM_TYPE_IPV6,
824 RTE_FLOW_ITEM_TYPE_END,
827 enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv4_gtpu_eh_ipv6_udp[] = {
828 RTE_FLOW_ITEM_TYPE_ETH,
829 RTE_FLOW_ITEM_TYPE_IPV4,
830 RTE_FLOW_ITEM_TYPE_GRE,
831 RTE_FLOW_ITEM_TYPE_IPV4,
832 RTE_FLOW_ITEM_TYPE_UDP,
833 RTE_FLOW_ITEM_TYPE_GTPU,
834 RTE_FLOW_ITEM_TYPE_GTP_PSC,
835 RTE_FLOW_ITEM_TYPE_IPV6,
836 RTE_FLOW_ITEM_TYPE_UDP,
837 RTE_FLOW_ITEM_TYPE_END,
840 enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv4_gtpu_eh_ipv6_tcp[] = {
841 RTE_FLOW_ITEM_TYPE_ETH,
842 RTE_FLOW_ITEM_TYPE_IPV4,
843 RTE_FLOW_ITEM_TYPE_GRE,
844 RTE_FLOW_ITEM_TYPE_IPV4,
845 RTE_FLOW_ITEM_TYPE_UDP,
846 RTE_FLOW_ITEM_TYPE_GTPU,
847 RTE_FLOW_ITEM_TYPE_GTP_PSC,
848 RTE_FLOW_ITEM_TYPE_IPV6,
849 RTE_FLOW_ITEM_TYPE_TCP,
850 RTE_FLOW_ITEM_TYPE_END,
853 enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv6_gtpu_eh[] = {
854 RTE_FLOW_ITEM_TYPE_ETH,
855 RTE_FLOW_ITEM_TYPE_IPV4,
856 RTE_FLOW_ITEM_TYPE_GRE,
857 RTE_FLOW_ITEM_TYPE_IPV6,
858 RTE_FLOW_ITEM_TYPE_UDP,
859 RTE_FLOW_ITEM_TYPE_GTPU,
860 RTE_FLOW_ITEM_TYPE_GTP_PSC,
861 RTE_FLOW_ITEM_TYPE_END,
864 /* IPV4 GRE IPv6 UDP GTPU EH IPv4*/
865 enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv6_gtpu_eh_ipv4[] = {
866 RTE_FLOW_ITEM_TYPE_ETH,
867 RTE_FLOW_ITEM_TYPE_IPV4,
868 RTE_FLOW_ITEM_TYPE_GRE,
869 RTE_FLOW_ITEM_TYPE_IPV6,
870 RTE_FLOW_ITEM_TYPE_UDP,
871 RTE_FLOW_ITEM_TYPE_GTPU,
872 RTE_FLOW_ITEM_TYPE_GTP_PSC,
873 RTE_FLOW_ITEM_TYPE_IPV4,
874 RTE_FLOW_ITEM_TYPE_END,
877 enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv6_gtpu_eh_ipv4_udp[] = {
878 RTE_FLOW_ITEM_TYPE_ETH,
879 RTE_FLOW_ITEM_TYPE_IPV4,
880 RTE_FLOW_ITEM_TYPE_GRE,
881 RTE_FLOW_ITEM_TYPE_IPV6,
882 RTE_FLOW_ITEM_TYPE_UDP,
883 RTE_FLOW_ITEM_TYPE_GTPU,
884 RTE_FLOW_ITEM_TYPE_GTP_PSC,
885 RTE_FLOW_ITEM_TYPE_IPV4,
886 RTE_FLOW_ITEM_TYPE_UDP,
887 RTE_FLOW_ITEM_TYPE_END,
890 enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv6_gtpu_eh_ipv4_tcp[] = {
891 RTE_FLOW_ITEM_TYPE_ETH,
892 RTE_FLOW_ITEM_TYPE_IPV4,
893 RTE_FLOW_ITEM_TYPE_GRE,
894 RTE_FLOW_ITEM_TYPE_IPV6,
895 RTE_FLOW_ITEM_TYPE_UDP,
896 RTE_FLOW_ITEM_TYPE_GTPU,
897 RTE_FLOW_ITEM_TYPE_GTP_PSC,
898 RTE_FLOW_ITEM_TYPE_IPV4,
899 RTE_FLOW_ITEM_TYPE_TCP,
900 RTE_FLOW_ITEM_TYPE_END,
903 /* IPV4 GRE IPv6 UDP GTPU EH IPv6*/
904 enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv6_gtpu_eh_ipv6[] = {
905 RTE_FLOW_ITEM_TYPE_ETH,
906 RTE_FLOW_ITEM_TYPE_IPV4,
907 RTE_FLOW_ITEM_TYPE_GRE,
908 RTE_FLOW_ITEM_TYPE_IPV6,
909 RTE_FLOW_ITEM_TYPE_UDP,
910 RTE_FLOW_ITEM_TYPE_GTPU,
911 RTE_FLOW_ITEM_TYPE_GTP_PSC,
912 RTE_FLOW_ITEM_TYPE_IPV6,
913 RTE_FLOW_ITEM_TYPE_END,
916 enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv6_gtpu_eh_ipv6_udp[] = {
917 RTE_FLOW_ITEM_TYPE_ETH,
918 RTE_FLOW_ITEM_TYPE_IPV4,
919 RTE_FLOW_ITEM_TYPE_GRE,
920 RTE_FLOW_ITEM_TYPE_IPV6,
921 RTE_FLOW_ITEM_TYPE_UDP,
922 RTE_FLOW_ITEM_TYPE_GTPU,
923 RTE_FLOW_ITEM_TYPE_GTP_PSC,
924 RTE_FLOW_ITEM_TYPE_IPV6,
925 RTE_FLOW_ITEM_TYPE_UDP,
926 RTE_FLOW_ITEM_TYPE_END,
929 enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv6_gtpu_eh_ipv6_tcp[] = {
930 RTE_FLOW_ITEM_TYPE_ETH,
931 RTE_FLOW_ITEM_TYPE_IPV4,
932 RTE_FLOW_ITEM_TYPE_GRE,
933 RTE_FLOW_ITEM_TYPE_IPV6,
934 RTE_FLOW_ITEM_TYPE_UDP,
935 RTE_FLOW_ITEM_TYPE_GTPU,
936 RTE_FLOW_ITEM_TYPE_GTP_PSC,
937 RTE_FLOW_ITEM_TYPE_IPV6,
938 RTE_FLOW_ITEM_TYPE_TCP,
939 RTE_FLOW_ITEM_TYPE_END,
942 enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv4_gtpu_eh[] = {
943 RTE_FLOW_ITEM_TYPE_ETH,
944 RTE_FLOW_ITEM_TYPE_IPV6,
945 RTE_FLOW_ITEM_TYPE_GRE,
946 RTE_FLOW_ITEM_TYPE_IPV4,
947 RTE_FLOW_ITEM_TYPE_UDP,
948 RTE_FLOW_ITEM_TYPE_GTPU,
949 RTE_FLOW_ITEM_TYPE_GTP_PSC,
950 RTE_FLOW_ITEM_TYPE_END,
953 /* IPV6 GRE IPv4 UDP GTPU EH IPv4*/
954 enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv4_gtpu_eh_ipv4[] = {
955 RTE_FLOW_ITEM_TYPE_ETH,
956 RTE_FLOW_ITEM_TYPE_IPV6,
957 RTE_FLOW_ITEM_TYPE_GRE,
958 RTE_FLOW_ITEM_TYPE_IPV4,
959 RTE_FLOW_ITEM_TYPE_UDP,
960 RTE_FLOW_ITEM_TYPE_GTPU,
961 RTE_FLOW_ITEM_TYPE_GTP_PSC,
962 RTE_FLOW_ITEM_TYPE_IPV4,
963 RTE_FLOW_ITEM_TYPE_END,
966 enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv4_gtpu_eh_ipv4_udp[] = {
967 RTE_FLOW_ITEM_TYPE_ETH,
968 RTE_FLOW_ITEM_TYPE_IPV6,
969 RTE_FLOW_ITEM_TYPE_GRE,
970 RTE_FLOW_ITEM_TYPE_IPV4,
971 RTE_FLOW_ITEM_TYPE_UDP,
972 RTE_FLOW_ITEM_TYPE_GTPU,
973 RTE_FLOW_ITEM_TYPE_GTP_PSC,
974 RTE_FLOW_ITEM_TYPE_IPV4,
975 RTE_FLOW_ITEM_TYPE_UDP,
976 RTE_FLOW_ITEM_TYPE_END,
979 enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv4_gtpu_eh_ipv4_tcp[] = {
980 RTE_FLOW_ITEM_TYPE_ETH,
981 RTE_FLOW_ITEM_TYPE_IPV6,
982 RTE_FLOW_ITEM_TYPE_GRE,
983 RTE_FLOW_ITEM_TYPE_IPV4,
984 RTE_FLOW_ITEM_TYPE_UDP,
985 RTE_FLOW_ITEM_TYPE_GTPU,
986 RTE_FLOW_ITEM_TYPE_GTP_PSC,
987 RTE_FLOW_ITEM_TYPE_IPV4,
988 RTE_FLOW_ITEM_TYPE_TCP,
989 RTE_FLOW_ITEM_TYPE_END,
992 /* IPV4 GRE IPv4 UDP GTPU EH IPv6*/
993 enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv4_gtpu_eh_ipv6[] = {
994 RTE_FLOW_ITEM_TYPE_ETH,
995 RTE_FLOW_ITEM_TYPE_IPV6,
996 RTE_FLOW_ITEM_TYPE_GRE,
997 RTE_FLOW_ITEM_TYPE_IPV4,
998 RTE_FLOW_ITEM_TYPE_UDP,
999 RTE_FLOW_ITEM_TYPE_GTPU,
1000 RTE_FLOW_ITEM_TYPE_GTP_PSC,
1001 RTE_FLOW_ITEM_TYPE_IPV6,
1002 RTE_FLOW_ITEM_TYPE_END,
1005 enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv4_gtpu_eh_ipv6_udp[] = {
1006 RTE_FLOW_ITEM_TYPE_ETH,
1007 RTE_FLOW_ITEM_TYPE_IPV6,
1008 RTE_FLOW_ITEM_TYPE_GRE,
1009 RTE_FLOW_ITEM_TYPE_IPV4,
1010 RTE_FLOW_ITEM_TYPE_UDP,
1011 RTE_FLOW_ITEM_TYPE_GTPU,
1012 RTE_FLOW_ITEM_TYPE_GTP_PSC,
1013 RTE_FLOW_ITEM_TYPE_IPV6,
1014 RTE_FLOW_ITEM_TYPE_UDP,
1015 RTE_FLOW_ITEM_TYPE_END,
1018 enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv4_gtpu_eh_ipv6_tcp[] = {
1019 RTE_FLOW_ITEM_TYPE_ETH,
1020 RTE_FLOW_ITEM_TYPE_IPV6,
1021 RTE_FLOW_ITEM_TYPE_GRE,
1022 RTE_FLOW_ITEM_TYPE_IPV4,
1023 RTE_FLOW_ITEM_TYPE_UDP,
1024 RTE_FLOW_ITEM_TYPE_GTPU,
1025 RTE_FLOW_ITEM_TYPE_GTP_PSC,
1026 RTE_FLOW_ITEM_TYPE_IPV6,
1027 RTE_FLOW_ITEM_TYPE_TCP,
1028 RTE_FLOW_ITEM_TYPE_END,
1031 enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv6_gtpu_eh[] = {
1032 RTE_FLOW_ITEM_TYPE_ETH,
1033 RTE_FLOW_ITEM_TYPE_IPV6,
1034 RTE_FLOW_ITEM_TYPE_GRE,
1035 RTE_FLOW_ITEM_TYPE_IPV6,
1036 RTE_FLOW_ITEM_TYPE_UDP,
1037 RTE_FLOW_ITEM_TYPE_GTPU,
1038 RTE_FLOW_ITEM_TYPE_GTP_PSC,
1039 RTE_FLOW_ITEM_TYPE_END,
1042 /* IPV6 GRE IPv6 UDP GTPU EH IPv4*/
1043 enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv6_gtpu_eh_ipv4[] = {
1044 RTE_FLOW_ITEM_TYPE_ETH,
1045 RTE_FLOW_ITEM_TYPE_IPV6,
1046 RTE_FLOW_ITEM_TYPE_GRE,
1047 RTE_FLOW_ITEM_TYPE_IPV6,
1048 RTE_FLOW_ITEM_TYPE_UDP,
1049 RTE_FLOW_ITEM_TYPE_GTPU,
1050 RTE_FLOW_ITEM_TYPE_GTP_PSC,
1051 RTE_FLOW_ITEM_TYPE_IPV4,
1052 RTE_FLOW_ITEM_TYPE_END,
1055 enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv6_gtpu_eh_ipv4_udp[] = {
1056 RTE_FLOW_ITEM_TYPE_ETH,
1057 RTE_FLOW_ITEM_TYPE_IPV6,
1058 RTE_FLOW_ITEM_TYPE_GRE,
1059 RTE_FLOW_ITEM_TYPE_IPV6,
1060 RTE_FLOW_ITEM_TYPE_UDP,
1061 RTE_FLOW_ITEM_TYPE_GTPU,
1062 RTE_FLOW_ITEM_TYPE_GTP_PSC,
1063 RTE_FLOW_ITEM_TYPE_IPV4,
1064 RTE_FLOW_ITEM_TYPE_UDP,
1065 RTE_FLOW_ITEM_TYPE_END,
1068 enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv6_gtpu_eh_ipv4_tcp[] = {
1069 RTE_FLOW_ITEM_TYPE_ETH,
1070 RTE_FLOW_ITEM_TYPE_IPV6,
1071 RTE_FLOW_ITEM_TYPE_GRE,
1072 RTE_FLOW_ITEM_TYPE_IPV6,
1073 RTE_FLOW_ITEM_TYPE_UDP,
1074 RTE_FLOW_ITEM_TYPE_GTPU,
1075 RTE_FLOW_ITEM_TYPE_GTP_PSC,
1076 RTE_FLOW_ITEM_TYPE_IPV4,
1077 RTE_FLOW_ITEM_TYPE_TCP,
1078 RTE_FLOW_ITEM_TYPE_END,
1081 /* IPV6 GRE IPv6 UDP GTPU EH IPv6*/
1082 enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv6_gtpu_eh_ipv6[] = {
1083 RTE_FLOW_ITEM_TYPE_ETH,
1084 RTE_FLOW_ITEM_TYPE_IPV6,
1085 RTE_FLOW_ITEM_TYPE_GRE,
1086 RTE_FLOW_ITEM_TYPE_IPV6,
1087 RTE_FLOW_ITEM_TYPE_UDP,
1088 RTE_FLOW_ITEM_TYPE_GTPU,
1089 RTE_FLOW_ITEM_TYPE_GTP_PSC,
1090 RTE_FLOW_ITEM_TYPE_IPV6,
1091 RTE_FLOW_ITEM_TYPE_END,
1094 enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv6_gtpu_eh_ipv6_udp[] = {
1095 RTE_FLOW_ITEM_TYPE_ETH,
1096 RTE_FLOW_ITEM_TYPE_IPV6,
1097 RTE_FLOW_ITEM_TYPE_GRE,
1098 RTE_FLOW_ITEM_TYPE_IPV6,
1099 RTE_FLOW_ITEM_TYPE_UDP,
1100 RTE_FLOW_ITEM_TYPE_GTPU,
1101 RTE_FLOW_ITEM_TYPE_GTP_PSC,
1102 RTE_FLOW_ITEM_TYPE_IPV6,
1103 RTE_FLOW_ITEM_TYPE_UDP,
1104 RTE_FLOW_ITEM_TYPE_END,
1107 enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv6_gtpu_eh_ipv6_tcp[] = {
1108 RTE_FLOW_ITEM_TYPE_ETH,
1109 RTE_FLOW_ITEM_TYPE_IPV6,
1110 RTE_FLOW_ITEM_TYPE_GRE,
1111 RTE_FLOW_ITEM_TYPE_IPV6,
1112 RTE_FLOW_ITEM_TYPE_UDP,
1113 RTE_FLOW_ITEM_TYPE_GTPU,
1114 RTE_FLOW_ITEM_TYPE_GTP_PSC,
1115 RTE_FLOW_ITEM_TYPE_IPV6,
1116 RTE_FLOW_ITEM_TYPE_TCP,
1117 RTE_FLOW_ITEM_TYPE_END,
1120 /* IPV4 GTPU IPv6 */
1121 enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpu_ipv6[] = {
1122 RTE_FLOW_ITEM_TYPE_ETH,
1123 RTE_FLOW_ITEM_TYPE_IPV4,
1124 RTE_FLOW_ITEM_TYPE_UDP,
1125 RTE_FLOW_ITEM_TYPE_GTPU,
1126 RTE_FLOW_ITEM_TYPE_IPV6,
1127 RTE_FLOW_ITEM_TYPE_END,
1130 enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpu_ipv6_udp[] = {
1131 RTE_FLOW_ITEM_TYPE_ETH,
1132 RTE_FLOW_ITEM_TYPE_IPV4,
1133 RTE_FLOW_ITEM_TYPE_UDP,
1134 RTE_FLOW_ITEM_TYPE_GTPU,
1135 RTE_FLOW_ITEM_TYPE_IPV6,
1136 RTE_FLOW_ITEM_TYPE_UDP,
1137 RTE_FLOW_ITEM_TYPE_END,
1140 enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpu_ipv6_tcp[] = {
1141 RTE_FLOW_ITEM_TYPE_ETH,
1142 RTE_FLOW_ITEM_TYPE_IPV4,
1143 RTE_FLOW_ITEM_TYPE_UDP,
1144 RTE_FLOW_ITEM_TYPE_GTPU,
1145 RTE_FLOW_ITEM_TYPE_IPV6,
1146 RTE_FLOW_ITEM_TYPE_TCP,
1147 RTE_FLOW_ITEM_TYPE_END,
1150 enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpu_ipv6_icmp[] = {
1151 RTE_FLOW_ITEM_TYPE_ETH,
1152 RTE_FLOW_ITEM_TYPE_IPV4,
1153 RTE_FLOW_ITEM_TYPE_UDP,
1154 RTE_FLOW_ITEM_TYPE_GTPU,
1155 RTE_FLOW_ITEM_TYPE_IPV6,
1156 RTE_FLOW_ITEM_TYPE_ICMP,
1157 RTE_FLOW_ITEM_TYPE_END,
1160 /* IPV6 GTPU IPv4 */
1161 enum rte_flow_item_type iavf_pattern_eth_ipv6_gtpu_ipv4[] = {
1162 RTE_FLOW_ITEM_TYPE_ETH,
1163 RTE_FLOW_ITEM_TYPE_IPV6,
1164 RTE_FLOW_ITEM_TYPE_UDP,
1165 RTE_FLOW_ITEM_TYPE_GTPU,
1166 RTE_FLOW_ITEM_TYPE_IPV4,
1167 RTE_FLOW_ITEM_TYPE_END,
1170 enum rte_flow_item_type iavf_pattern_eth_ipv6_gtpu_ipv4_udp[] = {
1171 RTE_FLOW_ITEM_TYPE_ETH,
1172 RTE_FLOW_ITEM_TYPE_IPV6,
1173 RTE_FLOW_ITEM_TYPE_UDP,
1174 RTE_FLOW_ITEM_TYPE_GTPU,
1175 RTE_FLOW_ITEM_TYPE_IPV4,
1176 RTE_FLOW_ITEM_TYPE_UDP,
1177 RTE_FLOW_ITEM_TYPE_END,
1180 enum rte_flow_item_type iavf_pattern_eth_ipv6_gtpu_ipv4_tcp[] = {
1181 RTE_FLOW_ITEM_TYPE_ETH,
1182 RTE_FLOW_ITEM_TYPE_IPV6,
1183 RTE_FLOW_ITEM_TYPE_UDP,
1184 RTE_FLOW_ITEM_TYPE_GTPU,
1185 RTE_FLOW_ITEM_TYPE_IPV4,
1186 RTE_FLOW_ITEM_TYPE_TCP,
1187 RTE_FLOW_ITEM_TYPE_END,
1190 enum rte_flow_item_type iavf_pattern_eth_ipv6_gtpu_ipv4_icmp[] = {
1191 RTE_FLOW_ITEM_TYPE_ETH,
1192 RTE_FLOW_ITEM_TYPE_IPV6,
1193 RTE_FLOW_ITEM_TYPE_UDP,
1194 RTE_FLOW_ITEM_TYPE_GTPU,
1195 RTE_FLOW_ITEM_TYPE_IPV4,
1196 RTE_FLOW_ITEM_TYPE_ICMP,
1197 RTE_FLOW_ITEM_TYPE_END,
1200 /* IPV6 GTPU IPv6 */
1201 enum rte_flow_item_type iavf_pattern_eth_ipv6_gtpu_ipv6[] = {
1202 RTE_FLOW_ITEM_TYPE_ETH,
1203 RTE_FLOW_ITEM_TYPE_IPV6,
1204 RTE_FLOW_ITEM_TYPE_UDP,
1205 RTE_FLOW_ITEM_TYPE_GTPU,
1206 RTE_FLOW_ITEM_TYPE_IPV6,
1207 RTE_FLOW_ITEM_TYPE_END,
1210 enum rte_flow_item_type iavf_pattern_eth_ipv6_gtpu_ipv6_udp[] = {
1211 RTE_FLOW_ITEM_TYPE_ETH,
1212 RTE_FLOW_ITEM_TYPE_IPV6,
1213 RTE_FLOW_ITEM_TYPE_UDP,
1214 RTE_FLOW_ITEM_TYPE_GTPU,
1215 RTE_FLOW_ITEM_TYPE_IPV6,
1216 RTE_FLOW_ITEM_TYPE_UDP,
1217 RTE_FLOW_ITEM_TYPE_END,
1220 enum rte_flow_item_type iavf_pattern_eth_ipv6_gtpu_ipv6_tcp[] = {
1221 RTE_FLOW_ITEM_TYPE_ETH,
1222 RTE_FLOW_ITEM_TYPE_IPV6,
1223 RTE_FLOW_ITEM_TYPE_UDP,
1224 RTE_FLOW_ITEM_TYPE_GTPU,
1225 RTE_FLOW_ITEM_TYPE_IPV6,
1226 RTE_FLOW_ITEM_TYPE_TCP,
1227 RTE_FLOW_ITEM_TYPE_END,
1230 enum rte_flow_item_type iavf_pattern_eth_ipv6_gtpu_ipv6_icmp[] = {
1231 RTE_FLOW_ITEM_TYPE_ETH,
1232 RTE_FLOW_ITEM_TYPE_IPV6,
1233 RTE_FLOW_ITEM_TYPE_UDP,
1234 RTE_FLOW_ITEM_TYPE_GTPU,
1235 RTE_FLOW_ITEM_TYPE_IPV6,
1236 RTE_FLOW_ITEM_TYPE_ICMP,
1237 RTE_FLOW_ITEM_TYPE_END,
1240 /* IPV4 GTPU EH IPv4 */
1241 enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpu_eh_ipv4[] = {
1242 RTE_FLOW_ITEM_TYPE_ETH,
1243 RTE_FLOW_ITEM_TYPE_IPV4,
1244 RTE_FLOW_ITEM_TYPE_UDP,
1245 RTE_FLOW_ITEM_TYPE_GTPU,
1246 RTE_FLOW_ITEM_TYPE_GTP_PSC,
1247 RTE_FLOW_ITEM_TYPE_IPV4,
1248 RTE_FLOW_ITEM_TYPE_END,
1251 enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpu_eh_ipv4_udp[] = {
1252 RTE_FLOW_ITEM_TYPE_ETH,
1253 RTE_FLOW_ITEM_TYPE_IPV4,
1254 RTE_FLOW_ITEM_TYPE_UDP,
1255 RTE_FLOW_ITEM_TYPE_GTPU,
1256 RTE_FLOW_ITEM_TYPE_GTP_PSC,
1257 RTE_FLOW_ITEM_TYPE_IPV4,
1258 RTE_FLOW_ITEM_TYPE_UDP,
1259 RTE_FLOW_ITEM_TYPE_END,
1262 enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpu_eh_ipv4_tcp[] = {
1263 RTE_FLOW_ITEM_TYPE_ETH,
1264 RTE_FLOW_ITEM_TYPE_IPV4,
1265 RTE_FLOW_ITEM_TYPE_UDP,
1266 RTE_FLOW_ITEM_TYPE_GTPU,
1267 RTE_FLOW_ITEM_TYPE_GTP_PSC,
1268 RTE_FLOW_ITEM_TYPE_IPV4,
1269 RTE_FLOW_ITEM_TYPE_TCP,
1270 RTE_FLOW_ITEM_TYPE_END,
1273 enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpu_eh_ipv4_icmp[] = {
1274 RTE_FLOW_ITEM_TYPE_ETH,
1275 RTE_FLOW_ITEM_TYPE_IPV4,
1276 RTE_FLOW_ITEM_TYPE_UDP,
1277 RTE_FLOW_ITEM_TYPE_GTPU,
1278 RTE_FLOW_ITEM_TYPE_GTP_PSC,
1279 RTE_FLOW_ITEM_TYPE_IPV4,
1280 RTE_FLOW_ITEM_TYPE_ICMP,
1281 RTE_FLOW_ITEM_TYPE_END,
1284 /* IPV4 GTPU EH IPv6 */
1285 enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpu_eh_ipv6[] = {
1286 RTE_FLOW_ITEM_TYPE_ETH,
1287 RTE_FLOW_ITEM_TYPE_IPV4,
1288 RTE_FLOW_ITEM_TYPE_UDP,
1289 RTE_FLOW_ITEM_TYPE_GTPU,
1290 RTE_FLOW_ITEM_TYPE_GTP_PSC,
1291 RTE_FLOW_ITEM_TYPE_IPV6,
1292 RTE_FLOW_ITEM_TYPE_END,
1295 enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpu_eh_ipv6_udp[] = {
1296 RTE_FLOW_ITEM_TYPE_ETH,
1297 RTE_FLOW_ITEM_TYPE_IPV4,
1298 RTE_FLOW_ITEM_TYPE_UDP,
1299 RTE_FLOW_ITEM_TYPE_GTPU,
1300 RTE_FLOW_ITEM_TYPE_GTP_PSC,
1301 RTE_FLOW_ITEM_TYPE_IPV6,
1302 RTE_FLOW_ITEM_TYPE_UDP,
1303 RTE_FLOW_ITEM_TYPE_END,
1306 enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpu_eh_ipv6_tcp[] = {
1307 RTE_FLOW_ITEM_TYPE_ETH,
1308 RTE_FLOW_ITEM_TYPE_IPV4,
1309 RTE_FLOW_ITEM_TYPE_UDP,
1310 RTE_FLOW_ITEM_TYPE_GTPU,
1311 RTE_FLOW_ITEM_TYPE_GTP_PSC,
1312 RTE_FLOW_ITEM_TYPE_IPV6,
1313 RTE_FLOW_ITEM_TYPE_TCP,
1314 RTE_FLOW_ITEM_TYPE_END,
1317 enum rte_flow_item_type iavf_pattern_eth_ipv4_gtpu_eh_ipv6_icmp[] = {
1318 RTE_FLOW_ITEM_TYPE_ETH,
1319 RTE_FLOW_ITEM_TYPE_IPV4,
1320 RTE_FLOW_ITEM_TYPE_UDP,
1321 RTE_FLOW_ITEM_TYPE_GTPU,
1322 RTE_FLOW_ITEM_TYPE_GTP_PSC,
1323 RTE_FLOW_ITEM_TYPE_IPV6,
1324 RTE_FLOW_ITEM_TYPE_ICMP,
1325 RTE_FLOW_ITEM_TYPE_END,
1328 /* IPV6 GTPU EH IPv4 */
1329 enum rte_flow_item_type iavf_pattern_eth_ipv6_gtpu_eh_ipv4[] = {
1330 RTE_FLOW_ITEM_TYPE_ETH,
1331 RTE_FLOW_ITEM_TYPE_IPV6,
1332 RTE_FLOW_ITEM_TYPE_UDP,
1333 RTE_FLOW_ITEM_TYPE_GTPU,
1334 RTE_FLOW_ITEM_TYPE_GTP_PSC,
1335 RTE_FLOW_ITEM_TYPE_IPV4,
1336 RTE_FLOW_ITEM_TYPE_END,
1339 enum rte_flow_item_type iavf_pattern_eth_ipv6_gtpu_eh_ipv4_udp[] = {
1340 RTE_FLOW_ITEM_TYPE_ETH,
1341 RTE_FLOW_ITEM_TYPE_IPV6,
1342 RTE_FLOW_ITEM_TYPE_UDP,
1343 RTE_FLOW_ITEM_TYPE_GTPU,
1344 RTE_FLOW_ITEM_TYPE_GTP_PSC,
1345 RTE_FLOW_ITEM_TYPE_IPV4,
1346 RTE_FLOW_ITEM_TYPE_UDP,
1347 RTE_FLOW_ITEM_TYPE_END,
1350 enum rte_flow_item_type iavf_pattern_eth_ipv6_gtpu_eh_ipv4_tcp[] = {
1351 RTE_FLOW_ITEM_TYPE_ETH,
1352 RTE_FLOW_ITEM_TYPE_IPV6,
1353 RTE_FLOW_ITEM_TYPE_UDP,
1354 RTE_FLOW_ITEM_TYPE_GTPU,
1355 RTE_FLOW_ITEM_TYPE_GTP_PSC,
1356 RTE_FLOW_ITEM_TYPE_IPV4,
1357 RTE_FLOW_ITEM_TYPE_TCP,
1358 RTE_FLOW_ITEM_TYPE_END,
1361 enum rte_flow_item_type iavf_pattern_eth_ipv6_gtpu_eh_ipv4_icmp[] = {
1362 RTE_FLOW_ITEM_TYPE_ETH,
1363 RTE_FLOW_ITEM_TYPE_IPV6,
1364 RTE_FLOW_ITEM_TYPE_UDP,
1365 RTE_FLOW_ITEM_TYPE_GTPU,
1366 RTE_FLOW_ITEM_TYPE_GTP_PSC,
1367 RTE_FLOW_ITEM_TYPE_IPV4,
1368 RTE_FLOW_ITEM_TYPE_ICMP,
1369 RTE_FLOW_ITEM_TYPE_END,
1372 /* IPV6 GTPU EH IPv6 */
1373 enum rte_flow_item_type iavf_pattern_eth_ipv6_gtpu_eh_ipv6[] = {
1374 RTE_FLOW_ITEM_TYPE_ETH,
1375 RTE_FLOW_ITEM_TYPE_IPV6,
1376 RTE_FLOW_ITEM_TYPE_UDP,
1377 RTE_FLOW_ITEM_TYPE_GTPU,
1378 RTE_FLOW_ITEM_TYPE_GTP_PSC,
1379 RTE_FLOW_ITEM_TYPE_IPV6,
1380 RTE_FLOW_ITEM_TYPE_END,
1383 enum rte_flow_item_type iavf_pattern_eth_ipv6_gtpu_eh_ipv6_udp[] = {
1384 RTE_FLOW_ITEM_TYPE_ETH,
1385 RTE_FLOW_ITEM_TYPE_IPV6,
1386 RTE_FLOW_ITEM_TYPE_UDP,
1387 RTE_FLOW_ITEM_TYPE_GTPU,
1388 RTE_FLOW_ITEM_TYPE_GTP_PSC,
1389 RTE_FLOW_ITEM_TYPE_IPV6,
1390 RTE_FLOW_ITEM_TYPE_UDP,
1391 RTE_FLOW_ITEM_TYPE_END,
1394 enum rte_flow_item_type iavf_pattern_eth_ipv6_gtpu_eh_ipv6_tcp[] = {
1395 RTE_FLOW_ITEM_TYPE_ETH,
1396 RTE_FLOW_ITEM_TYPE_IPV6,
1397 RTE_FLOW_ITEM_TYPE_UDP,
1398 RTE_FLOW_ITEM_TYPE_GTPU,
1399 RTE_FLOW_ITEM_TYPE_GTP_PSC,
1400 RTE_FLOW_ITEM_TYPE_IPV6,
1401 RTE_FLOW_ITEM_TYPE_TCP,
1402 RTE_FLOW_ITEM_TYPE_END,
1405 enum rte_flow_item_type iavf_pattern_eth_ipv6_gtpu_eh_ipv6_icmp[] = {
1406 RTE_FLOW_ITEM_TYPE_ETH,
1407 RTE_FLOW_ITEM_TYPE_IPV6,
1408 RTE_FLOW_ITEM_TYPE_UDP,
1409 RTE_FLOW_ITEM_TYPE_GTPU,
1410 RTE_FLOW_ITEM_TYPE_GTP_PSC,
1411 RTE_FLOW_ITEM_TYPE_IPV6,
1412 RTE_FLOW_ITEM_TYPE_ICMP,
1413 RTE_FLOW_ITEM_TYPE_END,
1417 enum rte_flow_item_type iavf_pattern_eth_ipv4_esp[] = {
1418 RTE_FLOW_ITEM_TYPE_ETH,
1419 RTE_FLOW_ITEM_TYPE_IPV4,
1420 RTE_FLOW_ITEM_TYPE_ESP,
1421 RTE_FLOW_ITEM_TYPE_END,
1424 enum rte_flow_item_type iavf_pattern_eth_ipv4_udp_esp[] = {
1425 RTE_FLOW_ITEM_TYPE_ETH,
1426 RTE_FLOW_ITEM_TYPE_IPV4,
1427 RTE_FLOW_ITEM_TYPE_UDP,
1428 RTE_FLOW_ITEM_TYPE_ESP,
1429 RTE_FLOW_ITEM_TYPE_END,
1432 enum rte_flow_item_type iavf_pattern_eth_ipv6_esp[] = {
1433 RTE_FLOW_ITEM_TYPE_ETH,
1434 RTE_FLOW_ITEM_TYPE_IPV6,
1435 RTE_FLOW_ITEM_TYPE_ESP,
1436 RTE_FLOW_ITEM_TYPE_END,
1439 enum rte_flow_item_type iavf_pattern_eth_ipv6_udp_esp[] = {
1440 RTE_FLOW_ITEM_TYPE_ETH,
1441 RTE_FLOW_ITEM_TYPE_IPV6,
1442 RTE_FLOW_ITEM_TYPE_UDP,
1443 RTE_FLOW_ITEM_TYPE_ESP,
1444 RTE_FLOW_ITEM_TYPE_END,
1448 enum rte_flow_item_type iavf_pattern_eth_ipv4_ah[] = {
1449 RTE_FLOW_ITEM_TYPE_ETH,
1450 RTE_FLOW_ITEM_TYPE_IPV4,
1451 RTE_FLOW_ITEM_TYPE_AH,
1452 RTE_FLOW_ITEM_TYPE_END,
1455 enum rte_flow_item_type iavf_pattern_eth_ipv6_ah[] = {
1456 RTE_FLOW_ITEM_TYPE_ETH,
1457 RTE_FLOW_ITEM_TYPE_IPV6,
1458 RTE_FLOW_ITEM_TYPE_AH,
1459 RTE_FLOW_ITEM_TYPE_END,
1463 enum rte_flow_item_type iavf_pattern_eth_ipv4_l2tpv3[] = {
1464 RTE_FLOW_ITEM_TYPE_ETH,
1465 RTE_FLOW_ITEM_TYPE_IPV4,
1466 RTE_FLOW_ITEM_TYPE_L2TPV3OIP,
1467 RTE_FLOW_ITEM_TYPE_END,
1470 enum rte_flow_item_type iavf_pattern_eth_ipv6_l2tpv3[] = {
1471 RTE_FLOW_ITEM_TYPE_ETH,
1472 RTE_FLOW_ITEM_TYPE_IPV6,
1473 RTE_FLOW_ITEM_TYPE_L2TPV3OIP,
1474 RTE_FLOW_ITEM_TYPE_END,
1478 enum rte_flow_item_type iavf_pattern_eth_ipv4_pfcp[] = {
1479 RTE_FLOW_ITEM_TYPE_ETH,
1480 RTE_FLOW_ITEM_TYPE_IPV4,
1481 RTE_FLOW_ITEM_TYPE_UDP,
1482 RTE_FLOW_ITEM_TYPE_PFCP,
1483 RTE_FLOW_ITEM_TYPE_END,
1486 enum rte_flow_item_type iavf_pattern_eth_ipv6_pfcp[] = {
1487 RTE_FLOW_ITEM_TYPE_ETH,
1488 RTE_FLOW_ITEM_TYPE_IPV6,
1489 RTE_FLOW_ITEM_TYPE_UDP,
1490 RTE_FLOW_ITEM_TYPE_PFCP,
1491 RTE_FLOW_ITEM_TYPE_END,
1495 enum rte_flow_item_type iavf_pattern_eth_ecpri[] = {
1496 RTE_FLOW_ITEM_TYPE_ETH,
1497 RTE_FLOW_ITEM_TYPE_ECPRI,
1498 RTE_FLOW_ITEM_TYPE_END,
1501 enum rte_flow_item_type iavf_pattern_eth_ipv4_ecpri[] = {
1502 RTE_FLOW_ITEM_TYPE_ETH,
1503 RTE_FLOW_ITEM_TYPE_IPV4,
1504 RTE_FLOW_ITEM_TYPE_UDP,
1505 RTE_FLOW_ITEM_TYPE_ECPRI,
1506 RTE_FLOW_ITEM_TYPE_END,
1510 enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv4[] = {
1511 RTE_FLOW_ITEM_TYPE_ETH,
1512 RTE_FLOW_ITEM_TYPE_IPV4,
1513 RTE_FLOW_ITEM_TYPE_GRE,
1514 RTE_FLOW_ITEM_TYPE_IPV4,
1515 RTE_FLOW_ITEM_TYPE_END,
1518 enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv6[] = {
1519 RTE_FLOW_ITEM_TYPE_ETH,
1520 RTE_FLOW_ITEM_TYPE_IPV4,
1521 RTE_FLOW_ITEM_TYPE_GRE,
1522 RTE_FLOW_ITEM_TYPE_IPV6,
1523 RTE_FLOW_ITEM_TYPE_END,
1526 enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv4[] = {
1527 RTE_FLOW_ITEM_TYPE_ETH,
1528 RTE_FLOW_ITEM_TYPE_IPV6,
1529 RTE_FLOW_ITEM_TYPE_GRE,
1530 RTE_FLOW_ITEM_TYPE_IPV4,
1531 RTE_FLOW_ITEM_TYPE_END,
1534 enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv6[] = {
1535 RTE_FLOW_ITEM_TYPE_ETH,
1536 RTE_FLOW_ITEM_TYPE_IPV6,
1537 RTE_FLOW_ITEM_TYPE_GRE,
1538 RTE_FLOW_ITEM_TYPE_IPV6,
1539 RTE_FLOW_ITEM_TYPE_END,
1542 enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv4_tcp[] = {
1543 RTE_FLOW_ITEM_TYPE_ETH,
1544 RTE_FLOW_ITEM_TYPE_IPV4,
1545 RTE_FLOW_ITEM_TYPE_GRE,
1546 RTE_FLOW_ITEM_TYPE_IPV4,
1547 RTE_FLOW_ITEM_TYPE_TCP,
1548 RTE_FLOW_ITEM_TYPE_END,
1551 enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv4_udp[] = {
1552 RTE_FLOW_ITEM_TYPE_ETH,
1553 RTE_FLOW_ITEM_TYPE_IPV4,
1554 RTE_FLOW_ITEM_TYPE_GRE,
1555 RTE_FLOW_ITEM_TYPE_IPV4,
1556 RTE_FLOW_ITEM_TYPE_UDP,
1557 RTE_FLOW_ITEM_TYPE_END,
1560 enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv6_tcp[] = {
1561 RTE_FLOW_ITEM_TYPE_ETH,
1562 RTE_FLOW_ITEM_TYPE_IPV4,
1563 RTE_FLOW_ITEM_TYPE_GRE,
1564 RTE_FLOW_ITEM_TYPE_IPV6,
1565 RTE_FLOW_ITEM_TYPE_TCP,
1566 RTE_FLOW_ITEM_TYPE_END,
1569 enum rte_flow_item_type iavf_pattern_eth_ipv4_gre_ipv6_udp[] = {
1570 RTE_FLOW_ITEM_TYPE_ETH,
1571 RTE_FLOW_ITEM_TYPE_IPV4,
1572 RTE_FLOW_ITEM_TYPE_GRE,
1573 RTE_FLOW_ITEM_TYPE_IPV6,
1574 RTE_FLOW_ITEM_TYPE_UDP,
1575 RTE_FLOW_ITEM_TYPE_END,
1578 enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv4_tcp[] = {
1579 RTE_FLOW_ITEM_TYPE_ETH,
1580 RTE_FLOW_ITEM_TYPE_IPV6,
1581 RTE_FLOW_ITEM_TYPE_GRE,
1582 RTE_FLOW_ITEM_TYPE_IPV4,
1583 RTE_FLOW_ITEM_TYPE_TCP,
1584 RTE_FLOW_ITEM_TYPE_END,
1587 enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv4_udp[] = {
1588 RTE_FLOW_ITEM_TYPE_ETH,
1589 RTE_FLOW_ITEM_TYPE_IPV6,
1590 RTE_FLOW_ITEM_TYPE_GRE,
1591 RTE_FLOW_ITEM_TYPE_IPV4,
1592 RTE_FLOW_ITEM_TYPE_UDP,
1593 RTE_FLOW_ITEM_TYPE_END,
1596 enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv6_tcp[] = {
1597 RTE_FLOW_ITEM_TYPE_ETH,
1598 RTE_FLOW_ITEM_TYPE_IPV6,
1599 RTE_FLOW_ITEM_TYPE_GRE,
1600 RTE_FLOW_ITEM_TYPE_IPV6,
1601 RTE_FLOW_ITEM_TYPE_TCP,
1602 RTE_FLOW_ITEM_TYPE_END,
1605 enum rte_flow_item_type iavf_pattern_eth_ipv6_gre_ipv6_udp[] = {
1606 RTE_FLOW_ITEM_TYPE_ETH,
1607 RTE_FLOW_ITEM_TYPE_IPV6,
1608 RTE_FLOW_ITEM_TYPE_GRE,
1609 RTE_FLOW_ITEM_TYPE_IPV6,
1610 RTE_FLOW_ITEM_TYPE_UDP,
1611 RTE_FLOW_ITEM_TYPE_END,
1614 typedef struct iavf_flow_engine * (*parse_engine_t)(struct iavf_adapter *ad,
1615 struct rte_flow *flow,
1616 struct iavf_parser_list *parser_list,
1617 const struct rte_flow_item pattern[],
1618 const struct rte_flow_action actions[],
1619 struct rte_flow_error *error);
1622 iavf_register_flow_engine(struct iavf_flow_engine *engine)
1624 TAILQ_INSERT_TAIL(&engine_list, engine, node);
1628 iavf_flow_init(struct iavf_adapter *ad)
1631 struct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(ad);
1633 struct iavf_flow_engine *engine;
1635 TAILQ_INIT(&vf->flow_list);
1636 TAILQ_INIT(&vf->rss_parser_list);
1637 TAILQ_INIT(&vf->dist_parser_list);
1638 rte_spinlock_init(&vf->flow_ops_lock);
1640 RTE_TAILQ_FOREACH_SAFE(engine, &engine_list, node, temp) {
1641 if (engine->init == NULL) {
1642 PMD_INIT_LOG(ERR, "Invalid engine type (%d)",
1647 ret = engine->init(ad);
1648 if (ret && ret != -ENOTSUP) {
1649 PMD_INIT_LOG(ERR, "Failed to initialize engine %d",
1658 iavf_flow_uninit(struct iavf_adapter *ad)
1660 struct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(ad);
1661 struct iavf_flow_engine *engine;
1662 struct rte_flow *p_flow;
1663 struct iavf_flow_parser_node *p_parser;
1666 RTE_TAILQ_FOREACH_SAFE(engine, &engine_list, node, temp) {
1671 /* Remove all flows */
1672 while ((p_flow = TAILQ_FIRST(&vf->flow_list))) {
1673 TAILQ_REMOVE(&vf->flow_list, p_flow, node);
1674 if (p_flow->engine->free)
1675 p_flow->engine->free(p_flow);
1679 /* Cleanup parser list */
1680 while ((p_parser = TAILQ_FIRST(&vf->rss_parser_list))) {
1681 TAILQ_REMOVE(&vf->rss_parser_list, p_parser, node);
1685 while ((p_parser = TAILQ_FIRST(&vf->dist_parser_list))) {
1686 TAILQ_REMOVE(&vf->dist_parser_list, p_parser, node);
1692 iavf_register_parser(struct iavf_flow_parser *parser,
1693 struct iavf_adapter *ad)
1695 struct iavf_parser_list *list = NULL;
1696 struct iavf_flow_parser_node *parser_node;
1697 struct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(ad);
1699 parser_node = rte_zmalloc("iavf_parser", sizeof(*parser_node), 0);
1700 if (parser_node == NULL) {
1701 PMD_DRV_LOG(ERR, "Failed to allocate memory.");
1704 parser_node->parser = parser;
1706 if (parser->engine->type == IAVF_FLOW_ENGINE_HASH) {
1707 list = &vf->rss_parser_list;
1708 TAILQ_INSERT_TAIL(list, parser_node, node);
1709 } else if (parser->engine->type == IAVF_FLOW_ENGINE_FDIR) {
1710 list = &vf->dist_parser_list;
1711 TAILQ_INSERT_HEAD(list, parser_node, node);
1720 iavf_unregister_parser(struct iavf_flow_parser *parser,
1721 struct iavf_adapter *ad)
1723 struct iavf_parser_list *list = NULL;
1724 struct iavf_flow_parser_node *p_parser;
1725 struct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(ad);
1728 if (parser->engine->type == IAVF_FLOW_ENGINE_HASH)
1729 list = &vf->rss_parser_list;
1730 else if (parser->engine->type == IAVF_FLOW_ENGINE_FDIR)
1731 list = &vf->dist_parser_list;
1736 RTE_TAILQ_FOREACH_SAFE(p_parser, list, node, temp) {
1737 if (p_parser->parser->engine->type == parser->engine->type) {
1738 TAILQ_REMOVE(list, p_parser, node);
1745 iavf_flow_valid_attr(const struct rte_flow_attr *attr,
1746 struct rte_flow_error *error)
1748 /* Must be input direction */
1749 if (!attr->ingress) {
1750 rte_flow_error_set(error, EINVAL,
1751 RTE_FLOW_ERROR_TYPE_ATTR_INGRESS,
1752 attr, "Only support ingress.");
1758 rte_flow_error_set(error, EINVAL,
1759 RTE_FLOW_ERROR_TYPE_ATTR_EGRESS,
1760 attr, "Not support egress.");
1765 if (attr->priority) {
1766 rte_flow_error_set(error, EINVAL,
1767 RTE_FLOW_ERROR_TYPE_ATTR_PRIORITY,
1768 attr, "Not support priority.");
1774 rte_flow_error_set(error, EINVAL,
1775 RTE_FLOW_ERROR_TYPE_ATTR_GROUP,
1776 attr, "Not support group.");
1783 /* Find the first VOID or non-VOID item pointer */
1784 static const struct rte_flow_item *
1785 iavf_find_first_item(const struct rte_flow_item *item, bool is_void)
1789 while (item->type != RTE_FLOW_ITEM_TYPE_END) {
1791 is_find = item->type == RTE_FLOW_ITEM_TYPE_VOID;
1793 is_find = item->type != RTE_FLOW_ITEM_TYPE_VOID;
1801 /* Skip all VOID items of the pattern */
1803 iavf_pattern_skip_void_item(struct rte_flow_item *items,
1804 const struct rte_flow_item *pattern)
1806 uint32_t cpy_count = 0;
1807 const struct rte_flow_item *pb = pattern, *pe = pattern;
1810 /* Find a non-void item first */
1811 pb = iavf_find_first_item(pb, false);
1812 if (pb->type == RTE_FLOW_ITEM_TYPE_END) {
1817 /* Find a void item */
1818 pe = iavf_find_first_item(pb + 1, true);
1820 cpy_count = pe - pb;
1821 rte_memcpy(items, pb, sizeof(struct rte_flow_item) * cpy_count);
1825 if (pe->type == RTE_FLOW_ITEM_TYPE_END)
1830 /* Copy the END item. */
1831 rte_memcpy(items, pe, sizeof(struct rte_flow_item));
1834 /* Check if the pattern matches a supported item type array */
1836 iavf_match_pattern(enum rte_flow_item_type *item_array,
1837 const struct rte_flow_item *pattern)
1839 const struct rte_flow_item *item = pattern;
1841 while ((*item_array == item->type) &&
1842 (*item_array != RTE_FLOW_ITEM_TYPE_END)) {
1847 return (*item_array == RTE_FLOW_ITEM_TYPE_END &&
1848 item->type == RTE_FLOW_ITEM_TYPE_END);
1851 struct iavf_pattern_match_item *
1852 iavf_search_pattern_match_item(const struct rte_flow_item pattern[],
1853 struct iavf_pattern_match_item *array,
1855 struct rte_flow_error *error)
1858 struct iavf_pattern_match_item *pattern_match_item;
1859 /* need free by each filter */
1860 struct rte_flow_item *items; /* used for pattern without VOID items */
1861 uint32_t item_num = 0; /* non-void item number */
1863 /* Get the non-void item number of pattern */
1864 while ((pattern + i)->type != RTE_FLOW_ITEM_TYPE_END) {
1865 if ((pattern + i)->type != RTE_FLOW_ITEM_TYPE_VOID)
1871 items = rte_zmalloc("iavf_pattern",
1872 item_num * sizeof(struct rte_flow_item), 0);
1874 rte_flow_error_set(error, ENOMEM, RTE_FLOW_ERROR_TYPE_ITEM_NUM,
1875 NULL, "No memory for PMD internal items.");
1878 pattern_match_item = rte_zmalloc("iavf_pattern_match_item",
1879 sizeof(struct iavf_pattern_match_item), 0);
1880 if (!pattern_match_item) {
1881 rte_flow_error_set(error, ENOMEM, RTE_FLOW_ERROR_TYPE_HANDLE,
1882 NULL, "Failed to allocate memory.");
1886 iavf_pattern_skip_void_item(items, pattern);
1888 for (i = 0; i < array_len; i++)
1889 if (iavf_match_pattern(array[i].pattern_list,
1891 pattern_match_item->input_set_mask =
1892 array[i].input_set_mask;
1893 pattern_match_item->pattern_list =
1894 array[i].pattern_list;
1895 pattern_match_item->meta = array[i].meta;
1897 return pattern_match_item;
1899 rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM,
1900 pattern, "Unsupported pattern");
1903 rte_free(pattern_match_item);
1907 static struct iavf_flow_engine *
1908 iavf_parse_engine_create(struct iavf_adapter *ad,
1909 struct rte_flow *flow,
1910 struct iavf_parser_list *parser_list,
1911 const struct rte_flow_item pattern[],
1912 const struct rte_flow_action actions[],
1913 struct rte_flow_error *error)
1915 struct iavf_flow_engine *engine = NULL;
1916 struct iavf_flow_parser_node *parser_node;
1920 RTE_TAILQ_FOREACH_SAFE(parser_node, parser_list, node, temp) {
1921 if (parser_node->parser->parse_pattern_action(ad,
1922 parser_node->parser->array,
1923 parser_node->parser->array_len,
1924 pattern, actions, &meta, error) < 0)
1927 engine = parser_node->parser->engine;
1929 RTE_ASSERT(engine->create != NULL);
1930 if (!(engine->create(ad, flow, meta, error)))
1936 static struct iavf_flow_engine *
1937 iavf_parse_engine_validate(struct iavf_adapter *ad,
1938 struct rte_flow *flow,
1939 struct iavf_parser_list *parser_list,
1940 const struct rte_flow_item pattern[],
1941 const struct rte_flow_action actions[],
1942 struct rte_flow_error *error)
1944 struct iavf_flow_engine *engine = NULL;
1945 struct iavf_flow_parser_node *parser_node;
1949 RTE_TAILQ_FOREACH_SAFE(parser_node, parser_list, node, temp) {
1950 if (parser_node->parser->parse_pattern_action(ad,
1951 parser_node->parser->array,
1952 parser_node->parser->array_len,
1953 pattern, actions, &meta, error) < 0)
1956 engine = parser_node->parser->engine;
1957 if (engine->validation == NULL) {
1958 rte_flow_error_set(error, EINVAL,
1959 RTE_FLOW_ERROR_TYPE_HANDLE,
1960 NULL, "Validation not support");
1964 if (engine->validation(ad, flow, meta, error)) {
1965 rte_flow_error_set(error, EINVAL,
1966 RTE_FLOW_ERROR_TYPE_HANDLE,
1967 NULL, "Validation failed");
1976 iavf_flow_process_filter(struct rte_eth_dev *dev,
1977 struct rte_flow *flow,
1978 const struct rte_flow_attr *attr,
1979 const struct rte_flow_item pattern[],
1980 const struct rte_flow_action actions[],
1981 struct iavf_flow_engine **engine,
1982 parse_engine_t iavf_parse_engine,
1983 struct rte_flow_error *error)
1985 int ret = IAVF_ERR_CONFIG;
1986 struct iavf_adapter *ad =
1987 IAVF_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
1988 struct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(ad);
1991 rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM_NUM,
1992 NULL, "NULL pattern.");
1997 rte_flow_error_set(error, EINVAL,
1998 RTE_FLOW_ERROR_TYPE_ACTION_NUM,
1999 NULL, "NULL action.");
2004 rte_flow_error_set(error, EINVAL,
2005 RTE_FLOW_ERROR_TYPE_ATTR,
2006 NULL, "NULL attribute.");
2010 ret = iavf_flow_valid_attr(attr, error);
2014 *engine = iavf_parse_engine(ad, flow, &vf->rss_parser_list, pattern,
2019 *engine = iavf_parse_engine(ad, flow, &vf->dist_parser_list, pattern,
2023 rte_flow_error_set(error, EINVAL,
2024 RTE_FLOW_ERROR_TYPE_HANDLE, NULL,
2025 "Failed to create parser engine.");
2033 iavf_flow_validate(struct rte_eth_dev *dev,
2034 const struct rte_flow_attr *attr,
2035 const struct rte_flow_item pattern[],
2036 const struct rte_flow_action actions[],
2037 struct rte_flow_error *error)
2039 struct iavf_flow_engine *engine;
2041 return iavf_flow_process_filter(dev, NULL, attr, pattern, actions,
2042 &engine, iavf_parse_engine_validate, error);
2045 static struct rte_flow *
2046 iavf_flow_create(struct rte_eth_dev *dev,
2047 const struct rte_flow_attr *attr,
2048 const struct rte_flow_item pattern[],
2049 const struct rte_flow_action actions[],
2050 struct rte_flow_error *error)
2052 struct iavf_adapter *ad =
2053 IAVF_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
2054 struct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(ad);
2055 struct iavf_flow_engine *engine = NULL;
2056 struct rte_flow *flow = NULL;
2059 flow = rte_zmalloc("iavf_flow", sizeof(struct rte_flow), 0);
2061 rte_flow_error_set(error, ENOMEM,
2062 RTE_FLOW_ERROR_TYPE_HANDLE, NULL,
2063 "Failed to allocate memory");
2067 ret = iavf_flow_process_filter(dev, flow, attr, pattern, actions,
2068 &engine, iavf_parse_engine_create, error);
2070 PMD_DRV_LOG(ERR, "Failed to create flow");
2076 flow->engine = engine;
2077 TAILQ_INSERT_TAIL(&vf->flow_list, flow, node);
2078 PMD_DRV_LOG(INFO, "Succeeded to create (%d) flow", engine->type);
2081 rte_spinlock_unlock(&vf->flow_ops_lock);
2086 iavf_flow_is_valid(struct rte_flow *flow)
2088 struct iavf_flow_engine *engine;
2091 if (flow && flow->engine) {
2092 RTE_TAILQ_FOREACH_SAFE(engine, &engine_list, node, temp) {
2093 if (engine == flow->engine)
2102 iavf_flow_destroy(struct rte_eth_dev *dev,
2103 struct rte_flow *flow,
2104 struct rte_flow_error *error)
2106 struct iavf_adapter *ad =
2107 IAVF_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
2108 struct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(ad);
2111 if (!iavf_flow_is_valid(flow) || !flow->engine->destroy) {
2112 rte_flow_error_set(error, EINVAL,
2113 RTE_FLOW_ERROR_TYPE_HANDLE,
2114 NULL, "Invalid flow destroy");
2118 rte_spinlock_lock(&vf->flow_ops_lock);
2120 ret = flow->engine->destroy(ad, flow, error);
2123 TAILQ_REMOVE(&vf->flow_list, flow, node);
2126 PMD_DRV_LOG(ERR, "Failed to destroy flow");
2129 rte_spinlock_unlock(&vf->flow_ops_lock);
2135 iavf_flow_flush(struct rte_eth_dev *dev,
2136 struct rte_flow_error *error)
2138 struct iavf_adapter *ad =
2139 IAVF_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
2140 struct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(ad);
2141 struct rte_flow *p_flow;
2145 RTE_TAILQ_FOREACH_SAFE(p_flow, &vf->flow_list, node, temp) {
2146 ret = iavf_flow_destroy(dev, p_flow, error);
2148 PMD_DRV_LOG(ERR, "Failed to flush flows");
2157 iavf_flow_query(struct rte_eth_dev *dev,
2158 struct rte_flow *flow,
2159 const struct rte_flow_action *actions,
2161 struct rte_flow_error *error)
2164 struct iavf_adapter *ad =
2165 IAVF_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
2166 struct rte_flow_query_count *count = data;
2168 if (!iavf_flow_is_valid(flow) || !flow->engine->query_count) {
2169 rte_flow_error_set(error, EINVAL,
2170 RTE_FLOW_ERROR_TYPE_HANDLE,
2171 NULL, "Invalid flow query");
2175 for (; actions->type != RTE_FLOW_ACTION_TYPE_END; actions++) {
2176 switch (actions->type) {
2177 case RTE_FLOW_ACTION_TYPE_VOID:
2179 case RTE_FLOW_ACTION_TYPE_COUNT:
2180 ret = flow->engine->query_count(ad, flow, count, error);
2183 return rte_flow_error_set(error, ENOTSUP,
2184 RTE_FLOW_ERROR_TYPE_ACTION,
2186 "action not supported");