DPDK  21.05.0-rc0
rte_flow.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright 2016 6WIND S.A.
3  * Copyright 2016 Mellanox Technologies, Ltd
4  */
5 
6 #ifndef RTE_FLOW_H_
7 #define RTE_FLOW_H_
8 
17 #include <stddef.h>
18 #include <stdint.h>
19 
20 #include <rte_arp.h>
21 #include <rte_common.h>
22 #include <rte_ether.h>
23 #include <rte_icmp.h>
24 #include <rte_ip.h>
25 #include <rte_sctp.h>
26 #include <rte_tcp.h>
27 #include <rte_udp.h>
28 #include <rte_vxlan.h>
29 #include <rte_byteorder.h>
30 #include <rte_esp.h>
31 #include <rte_higig.h>
32 #include <rte_ecpri.h>
33 #include <rte_mbuf.h>
34 #include <rte_mbuf_dyn.h>
35 
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39 
77 struct rte_flow_attr {
78  uint32_t group;
79  uint32_t priority;
80  uint32_t ingress:1;
81  uint32_t egress:1;
100  uint32_t transfer:1;
101  uint32_t reserved:29;
102 };
103 
130 
140 
150 
158 
168 
178 
188 
198 
205 
212 
219 
226 
233 
240 
247 
254 
261 
268 
275 
282 
289 
296 
308 
317 
326 
335 
342 
349 
356 
363 
370 
377 
384 
391 
398 
406 
414 
421 
430 
443 
452 
461 
470 
479 
486 
493 
500 
506 
515 
524 
531 
540 
547 
554 };
555 
563  struct rte_higig2_hdr hdr;
564 };
565 
567 #ifndef __cplusplus
569  .hdr = {
570  .ppt1 = {
571  .classification = 0xffff,
572  .vid = 0xfff,
573  },
574  },
575 };
576 #endif
577 
590  uint32_t num;
591 };
592 
594 #ifndef __cplusplus
596  .num = 0x00000000,
597 };
598 #endif
599 
619  uint32_t id;
620 };
621 
623 #ifndef __cplusplus
625  .id = 0x00000000,
626 };
627 #endif
628 
650  uint32_t index;
651 };
652 
654 #ifndef __cplusplus
656  .index = 0x00000000,
657 };
658 #endif
659 
676  uint32_t id;
677 };
678 
680 #ifndef __cplusplus
682  .id = 0xffffffff,
683 };
684 #endif
685 
705  uint32_t relative:1;
706  uint32_t search:1;
707  uint32_t reserved:30;
708  int32_t offset;
709  uint16_t limit;
710  uint16_t length;
711  const uint8_t *pattern;
712 };
713 
715 #ifndef __cplusplus
717  .relative = 1,
718  .search = 1,
719  .reserved = 0x3fffffff,
720  .offset = 0xffffffff,
721  .limit = 0xffff,
722  .length = 0xffff,
723  .pattern = NULL,
724 };
725 #endif
726 
746  union {
747  struct {
748  /*
749  * These fields are retained for compatibility.
750  * Please switch to the new header field below.
751  */
752  struct rte_ether_addr dst;
753  struct rte_ether_addr src;
755  };
756  struct rte_ether_hdr hdr;
757  };
758  uint32_t has_vlan:1;
759  uint32_t reserved:31;
760 };
761 
763 #ifndef __cplusplus
765  .hdr.d_addr.addr_bytes = "\xff\xff\xff\xff\xff\xff",
766  .hdr.s_addr.addr_bytes = "\xff\xff\xff\xff\xff\xff",
767  .hdr.ether_type = RTE_BE16(0x0000),
768 };
769 #endif
770 
788  union {
789  struct {
790  /*
791  * These fields are retained for compatibility.
792  * Please switch to the new header field below.
793  */
796  };
797  struct rte_vlan_hdr hdr;
798  };
799  uint32_t has_more_vlan:1;
801  uint32_t reserved:31;
802 };
803 
805 #ifndef __cplusplus
807  .hdr.vlan_tci = RTE_BE16(0x0fff),
808  .hdr.eth_proto = RTE_BE16(0x0000),
809 };
810 #endif
811 
820  struct rte_ipv4_hdr hdr;
821 };
822 
824 #ifndef __cplusplus
826  .hdr = {
827  .src_addr = RTE_BE32(0xffffffff),
828  .dst_addr = RTE_BE32(0xffffffff),
829  },
830 };
831 #endif
832 
841  struct rte_ipv6_hdr hdr;
842  uint32_t has_hop_ext:1;
844  uint32_t has_route_ext:1;
846  uint32_t has_frag_ext:1;
848  uint32_t has_auth_ext:1;
850  uint32_t has_esp_ext:1;
852  uint32_t has_dest_ext:1;
854  uint32_t has_mobil_ext:1;
856  uint32_t has_hip_ext:1;
858  uint32_t has_shim6_ext:1;
860  uint32_t reserved:23;
862 };
863 
865 #ifndef __cplusplus
867  .hdr = {
868  .src_addr =
869  "\xff\xff\xff\xff\xff\xff\xff\xff"
870  "\xff\xff\xff\xff\xff\xff\xff\xff",
871  .dst_addr =
872  "\xff\xff\xff\xff\xff\xff\xff\xff"
873  "\xff\xff\xff\xff\xff\xff\xff\xff",
874  },
875 };
876 #endif
877 
884  struct rte_icmp_hdr hdr;
885 };
886 
888 #ifndef __cplusplus
890  .hdr = {
891  .icmp_type = 0xff,
892  .icmp_code = 0xff,
893  },
894 };
895 #endif
896 
903  struct rte_udp_hdr hdr;
904 };
905 
907 #ifndef __cplusplus
909  .hdr = {
910  .src_port = RTE_BE16(0xffff),
911  .dst_port = RTE_BE16(0xffff),
912  },
913 };
914 #endif
915 
922  struct rte_tcp_hdr hdr;
923 };
924 
926 #ifndef __cplusplus
928  .hdr = {
929  .src_port = RTE_BE16(0xffff),
930  .dst_port = RTE_BE16(0xffff),
931  },
932 };
933 #endif
934 
941  struct rte_sctp_hdr hdr;
942 };
943 
945 #ifndef __cplusplus
947  .hdr = {
948  .src_port = RTE_BE16(0xffff),
949  .dst_port = RTE_BE16(0xffff),
950  },
951 };
952 #endif
953 
961  union {
962  struct {
963  /*
964  * These fields are retained for compatibility.
965  * Please switch to the new header field below.
966  */
967  uint8_t flags;
968  uint8_t rsvd0[3];
969  uint8_t vni[3];
970  uint8_t rsvd1;
971  };
972  struct rte_vxlan_hdr hdr;
973  };
974 };
975 
977 #ifndef __cplusplus
979  .hdr.vx_vni = RTE_BE32(__builtin_constant_p(0xffffff << 8)),
980 };
981 #endif
982 
999  uint8_t in_ecid_e;
1000  uint8_t ecid_e;
1002 };
1003 
1005 #ifndef __cplusplus
1007  .rsvd_grp_ecid_b = RTE_BE16(0x3fff),
1008 };
1009 #endif
1010 
1025  uint8_t tni[3];
1026  uint8_t flow_id;
1027 };
1028 
1030 #ifndef __cplusplus
1032  .tni = "\xff\xff\xff",
1033 };
1034 #endif
1035 
1045  uint8_t label_tc_s[3];
1046  uint8_t ttl;
1047 };
1048 
1050 #ifndef __cplusplus
1052  .label_tc_s = "\xff\xff\xf0",
1053 };
1054 #endif
1055 
1068 };
1069 
1071 #ifndef __cplusplus
1073  .protocol = RTE_BE16(0xffff),
1074 };
1075 #endif
1076 
1095  uint32_t thresh;
1096 };
1097 
1099 #ifndef __cplusplus
1101  .thresh = 0xffffffff,
1102 };
1103 #endif
1104 
1118  uint8_t msg_type;
1121 };
1122 
1124 #ifndef __cplusplus
1126  .teid = RTE_BE32(0xffffffff),
1127 };
1128 #endif
1129 
1136  struct rte_esp_hdr hdr;
1137 };
1138 
1140 #ifndef __cplusplus
1142  .hdr = {
1143  .spi = RTE_BE32(0xffffffff),
1144  },
1145 };
1146 #endif
1147 
1160  uint8_t vni[3];
1161  uint8_t rsvd1;
1162 };
1163 
1165 #ifndef __cplusplus
1167  .vni = "\xff\xff\xff",
1168 };
1169 #endif
1170 
1177  uint8_t flags;
1178  uint8_t rsvd0[2];
1179  uint8_t protocol;
1180  uint8_t vni[3];
1181  uint8_t rsvd1;
1182 };
1183 
1185 #ifndef __cplusplus
1187  .vni = "\xff\xff\xff",
1188 };
1189 #endif
1190 
1199  uint8_t hln;
1200  uint8_t pln;
1202  struct rte_ether_addr sha;
1204  struct rte_ether_addr tha;
1206 };
1207 
1209 #ifndef __cplusplus
1210 static const struct rte_flow_item_arp_eth_ipv4
1212  .sha.addr_bytes = "\xff\xff\xff\xff\xff\xff",
1213  .spa = RTE_BE32(0xffffffff),
1214  .tha.addr_bytes = "\xff\xff\xff\xff\xff\xff",
1215  .tpa = RTE_BE32(0xffffffff),
1216 };
1217 #endif
1218 
1230  uint8_t next_hdr;
1231 };
1232 
1234 #ifndef __cplusplus
1235 static const
1237  .next_hdr = 0xff,
1238 };
1239 #endif
1240 
1252  struct rte_ipv6_fragment_ext hdr;
1253 };
1254 
1261  uint8_t type;
1262  uint8_t code;
1263  uint16_t checksum;
1264 };
1265 
1267 #ifndef __cplusplus
1269  .type = 0xff,
1270  .code = 0xff,
1271 };
1272 #endif
1273 
1280  uint8_t type;
1281  uint8_t code;
1284  uint8_t target_addr[16];
1285 };
1286 
1288 #ifndef __cplusplus
1289 static const
1291  .target_addr =
1292  "\xff\xff\xff\xff\xff\xff\xff\xff"
1293  "\xff\xff\xff\xff\xff\xff\xff\xff",
1294 };
1295 #endif
1296 
1303  uint8_t type;
1304  uint8_t code;
1311  uint8_t target_addr[16];
1312 };
1313 
1315 #ifndef __cplusplus
1316 static const
1318  .target_addr =
1319  "\xff\xff\xff\xff\xff\xff\xff\xff"
1320  "\xff\xff\xff\xff\xff\xff\xff\xff",
1321 };
1322 #endif
1323 
1336  uint8_t type;
1337  uint8_t length;
1338 };
1339 
1341 #ifndef __cplusplus
1342 static const struct rte_flow_item_icmp6_nd_opt
1344  .type = 0xff,
1345 };
1346 #endif
1347 
1360  uint8_t type;
1361  uint8_t length;
1362  struct rte_ether_addr sla;
1363 };
1364 
1366 #ifndef __cplusplus
1367 static const struct rte_flow_item_icmp6_nd_opt_sla_eth
1369  .sla.addr_bytes = "\xff\xff\xff\xff\xff\xff",
1370 };
1371 #endif
1372 
1385  uint8_t type;
1386  uint8_t length;
1387  struct rte_ether_addr tla;
1388 };
1389 
1391 #ifndef __cplusplus
1392 static const struct rte_flow_item_icmp6_nd_opt_tla_eth
1394  .tla.addr_bytes = "\xff\xff\xff\xff\xff\xff",
1395 };
1396 #endif
1397 
1409  uint32_t data;
1410 };
1411 
1413 #ifndef __cplusplus
1415  .data = UINT32_MAX,
1416 };
1417 #endif
1418 
1425  uint8_t pdu_type;
1426  uint8_t qfi;
1427 };
1428 
1430 #ifndef __cplusplus
1431 static const struct rte_flow_item_gtp_psc
1433  .qfi = 0x3f,
1434 };
1435 #endif
1436 
1446  uint8_t version_type;
1447  uint8_t code;
1450 };
1451 
1466 };
1467 
1469 #ifndef __cplusplus
1470 static const struct rte_flow_item_pppoe_proto_id
1472  .proto_id = RTE_BE16(0xffff),
1473 };
1474 #endif
1475 
1485  uint32_t data;
1486  uint8_t index;
1487 };
1488 
1490 #ifndef __cplusplus
1492  .data = 0xffffffff,
1493  .index = 0xff,
1494 };
1495 #endif
1496 
1504 };
1505 
1507 #ifndef __cplusplus
1509  .session_id = RTE_BE32(UINT32_MAX),
1510 };
1511 #endif
1512 
1513 
1533  uint32_t id;
1534 };
1535 
1537 #ifndef __cplusplus
1539  .id = 0xffffffff,
1540 };
1541 #endif
1542 
1553  uint32_t version:2;
1554  uint32_t oam_pkt:1;
1555  uint32_t reserved:1;
1556  uint32_t ttl:6;
1557  uint32_t length:6;
1558  uint32_t reserved1:4;
1559  uint32_t mdtype:4;
1560  uint32_t next_proto:8;
1561  uint32_t spi:24;
1562  uint32_t sindex:8;
1563 };
1564 
1566 #ifndef __cplusplus
1568  .mdtype = 0xf,
1569  .next_proto = 0xff,
1570  .spi = 0xffffff,
1571  .sindex = 0xff,
1572 };
1573 #endif
1574 
1585  uint32_t type:8;
1586  uint32_t max_resp_time:8;
1587  uint32_t checksum:16;
1588  uint32_t group_addr;
1589 };
1590 
1592 #ifndef __cplusplus
1594  .group_addr = 0xffffffff,
1595 };
1596 #endif
1597 
1608  uint32_t next_hdr:8;
1609  uint32_t payload_len:8;
1610  uint32_t reserved:16;
1611  uint32_t spi;
1612  uint32_t seq_num;
1613 };
1614 
1616 #ifndef __cplusplus
1618  .spi = 0xffffffff,
1619 };
1620 #endif
1621 
1631  uint8_t s_field;
1632  uint8_t msg_type;
1633  rte_be16_t msg_len;
1634  rte_be64_t seid;
1635 };
1636 
1638 #ifndef __cplusplus
1640  .s_field = 0x01,
1641  .seid = RTE_BE64(UINT64_C(0xffffffffffffffff)),
1642 };
1643 #endif
1644 
1654  struct rte_ecpri_combined_msg_hdr hdr;
1655 };
1656 
1658 #ifndef __cplusplus
1660  .hdr = {
1661  .common = {
1662  .u32 = 0x0,
1663  },
1664  },
1665 };
1666 #endif
1667 
1674  rte_be16_t option_class;
1675  uint8_t option_type;
1676  uint8_t option_len;
1677  uint32_t *data;
1678 };
1679 
1681 #ifndef __cplusplus
1682 static const struct rte_flow_item_geneve_opt
1684  .option_type = 0xff,
1685 };
1686 #endif
1687 
1723  const void *spec;
1724  const void *last;
1725  const void *mask;
1726 };
1727 
1762 
1770 
1778 
1787 
1795 
1803 
1810 
1819 
1830 
1839 
1847 
1855 
1863 
1870 
1878 
1886 
1894 
1902 
1910 
1918 
1927 
1936 
1944 
1952 
1960 
1968 
1976 
1984 
1992 
2001 
2009 
2018 
2025 
2032 
2042 
2052 
2062 
2072 
2083 
2094 
2105 
2112 
2119 
2129 
2139 
2153 
2167 
2181 
2195 
2205 
2212 
2222 
2232 
2243 
2251 
2259 
2270 };
2271 
2283  uint32_t id;
2284 };
2285 
2299  uint32_t group;
2300 };
2301 
2308  uint16_t index;
2309 };
2310 
2325  uint32_t timeout:24;
2326  uint32_t reserved:8;
2327  void *context;
2329 };
2330 
2338  uint32_t reserved:6;
2339  uint32_t aged:1;
2342  uint32_t sec_since_last_hit:24;
2343 };
2344 
2375  uint32_t shared:1;
2376  uint32_t reserved:31;
2377  uint32_t id;
2378 };
2379 
2386  uint32_t reset:1;
2387  uint32_t hits_set:1;
2388  uint32_t bytes_set:1;
2389  uint32_t reserved:29;
2390  uint64_t hits;
2391  uint64_t bytes;
2392 };
2393 
2398  RTE_ETH_HASH_FUNCTION_DEFAULT = 0,
2407  RTE_ETH_HASH_FUNCTION_MAX,
2408 };
2409 
2453  uint32_t level;
2454  uint64_t types;
2455  uint32_t key_len;
2456  uint32_t queue_num;
2457  const uint8_t *key;
2458  const uint16_t *queue;
2459 };
2460 
2474  uint32_t original:1;
2475  uint32_t reserved:31;
2476  uint32_t id;
2477 };
2478 
2488  uint32_t original:1;
2489  uint32_t reserved:31;
2490  uint32_t index;
2491 };
2492 
2501  uint32_t original:1;
2502  uint32_t reserved:31;
2503  uint32_t id;
2504 };
2505 
2515  uint32_t mtr_id;
2516 };
2517 
2550 };
2551 
2559  uint8_t mpls_ttl;
2560 };
2561 
2569  uint8_t nw_ttl;
2570 };
2571 
2580 };
2581 
2590 };
2591 
2599  uint8_t vlan_pcp;
2600 };
2601 
2610 };
2611 
2620 };
2621 
2655 };
2656 
2689 };
2690 
2711  uint8_t *data;
2712  uint8_t *preserve;
2713  size_t size;
2714 };
2715 
2732  uint8_t *data;
2733  size_t size;
2734 };
2735 
2748  rte_be32_t ipv4_addr;
2749 };
2750 
2763  uint8_t ipv6_addr[16];
2764 };
2765 
2778  rte_be16_t port;
2779 };
2780 
2787  uint8_t ttl_value;
2788 };
2789 
2796  uint8_t mac_addr[RTE_ETHER_ADDR_LEN];
2797 };
2798 
2809  uint32_t data;
2810  uint32_t mask;
2811  uint8_t index;
2812 };
2813 
2834  uint32_t data;
2835  uint32_t mask;
2836 };
2837 
2846  uint8_t dscp;
2847 };
2848 
2860 struct rte_flow_shared_action;
2861 
2895 };
2896 
2901  enum rte_flow_field_id field;
2902  RTE_STD_C11
2903  union {
2904  struct {
2906  uint32_t level;
2908  uint32_t offset;
2909  };
2914  uint64_t value;
2915  };
2916 };
2917 
2925 };
2926 
2938  enum rte_flow_modify_op operation;
2941  uint32_t width;
2942 };
2943 
2944 /* Mbuf dynamic field offset for metadata. */
2945 extern int32_t rte_flow_dynf_metadata_offs;
2946 
2947 /* Mbuf dynamic field flag mask for metadata. */
2948 extern uint64_t rte_flow_dynf_metadata_mask;
2949 
2950 /* Mbuf dynamic field pointer for metadata. */
2951 #define RTE_FLOW_DYNF_METADATA(m) \
2952  RTE_MBUF_DYNFIELD((m), rte_flow_dynf_metadata_offs, uint32_t *)
2953 
2954 /* Mbuf dynamic flags for metadata. */
2955 #define PKT_RX_DYNF_METADATA (rte_flow_dynf_metadata_mask)
2956 #define PKT_TX_DYNF_METADATA (rte_flow_dynf_metadata_mask)
2957 
2958 __rte_experimental
2959 static inline uint32_t
2960 rte_flow_dynf_metadata_get(struct rte_mbuf *m)
2961 {
2962  return *RTE_FLOW_DYNF_METADATA(m);
2963 }
2964 
2965 __rte_experimental
2966 static inline void
2967 rte_flow_dynf_metadata_set(struct rte_mbuf *m, uint32_t v)
2968 {
2969  *RTE_FLOW_DYNF_METADATA(m) = v;
2970 }
2971 
2972 /*
2973  * Definition of a single action.
2974  *
2975  * A list of actions is terminated by a END action.
2976  *
2977  * For simple actions without a configuration object, conf remains NULL.
2978  */
2979 struct rte_flow_action {
2980  enum rte_flow_action_type type;
2981  const void *conf;
2982 };
2983 
2990 struct rte_flow;
2991 
3009  uint32_t ratio;
3010  const struct rte_flow_action *actions;
3012 };
3013 
3038 };
3039 
3053  const void *cause;
3054  const char *message;
3055 };
3056 
3067  union {
3068  const struct rte_flow_attr *attr_ro;
3070  };
3071  union {
3072  const struct rte_flow_item *pattern_ro;
3074  };
3075  union {
3076  const struct rte_flow_action *actions_ro;
3077  struct rte_flow_action *actions;
3078  };
3079 };
3080 
3093 
3105 
3117 
3129 
3142 
3155 
3168 
3182 
3196 
3210 
3224 };
3225 
3243 __rte_experimental
3244 int
3245 rte_flow_dev_dump(uint16_t port_id, FILE *file, struct rte_flow_error *error);
3246 
3253 __rte_experimental
3254 static inline int
3256 {
3257  return !!rte_flow_dynf_metadata_mask;
3258 }
3259 
3270 __rte_experimental
3271 int
3273 
3326 int
3327 rte_flow_validate(uint16_t port_id,
3328  const struct rte_flow_attr *attr,
3329  const struct rte_flow_item pattern[],
3330  const struct rte_flow_action actions[],
3331  struct rte_flow_error *error);
3332 
3353 struct rte_flow *
3354 rte_flow_create(uint16_t port_id,
3355  const struct rte_flow_attr *attr,
3356  const struct rte_flow_item pattern[],
3357  const struct rte_flow_action actions[],
3358  struct rte_flow_error *error);
3359 
3380 int
3381 rte_flow_destroy(uint16_t port_id,
3382  struct rte_flow *flow,
3383  struct rte_flow_error *error);
3384 
3401 int
3402 rte_flow_flush(uint16_t port_id,
3403  struct rte_flow_error *error);
3404 
3429 int
3430 rte_flow_query(uint16_t port_id,
3431  struct rte_flow *flow,
3432  const struct rte_flow_action *action,
3433  void *data,
3434  struct rte_flow_error *error);
3435 
3477 int
3478 rte_flow_isolate(uint16_t port_id, int set, struct rte_flow_error *error);
3479 
3497 int
3498 rte_flow_error_set(struct rte_flow_error *error,
3499  int code,
3500  enum rte_flow_error_type type,
3501  const void *cause,
3502  const char *message);
3503 
3509  size_t size;
3510  struct rte_flow_attr attr;
3512  struct rte_flow_action *actions;
3513  uint8_t data[];
3514 };
3515 
3542 __rte_deprecated
3543 size_t
3544 rte_flow_copy(struct rte_flow_desc *fd, size_t len,
3545  const struct rte_flow_attr *attr,
3546  const struct rte_flow_item *items,
3547  const struct rte_flow_action *actions);
3548 
3589 __rte_experimental
3590 int
3592  void *dst,
3593  size_t size,
3594  const void *src,
3595  struct rte_flow_error *error);
3596 
3625 __rte_experimental
3626 int
3627 rte_flow_get_aged_flows(uint16_t port_id, void **contexts,
3628  uint32_t nb_contexts, struct rte_flow_error *error);
3629 
3640  uint32_t ingress:1;
3642  uint32_t egress:1;
3651  uint32_t transfer:1;
3652 };
3653 
3680 __rte_experimental
3681 struct rte_flow_shared_action *
3682 rte_flow_shared_action_create(uint16_t port_id,
3683  const struct rte_flow_shared_action_conf *conf,
3684  const struct rte_flow_action *action,
3685  struct rte_flow_error *error);
3686 
3709 __rte_experimental
3710 int
3711 rte_flow_shared_action_destroy(uint16_t port_id,
3712  struct rte_flow_shared_action *action,
3713  struct rte_flow_error *error);
3714 
3745 __rte_experimental
3746 int
3747 rte_flow_shared_action_update(uint16_t port_id,
3748  struct rte_flow_shared_action *action,
3749  const struct rte_flow_action *update,
3750  struct rte_flow_error *error);
3751 
3777 __rte_experimental
3778 int
3779 rte_flow_shared_action_query(uint16_t port_id,
3780  const struct rte_flow_shared_action *action,
3781  void *data,
3782  struct rte_flow_error *error);
3783 
3784 /* Tunnel has a type and the key information. */
3785 struct rte_flow_tunnel {
3790  enum rte_flow_item_type type;
3791  uint64_t tun_id;
3793  RTE_STD_C11
3794  union {
3795  struct {
3796  rte_be32_t src_addr;
3797  rte_be32_t dst_addr;
3798  } ipv4;
3799  struct {
3800  uint8_t src_addr[16];
3801  uint8_t dst_addr[16];
3802  } ipv6;
3803  };
3804  rte_be16_t tp_src;
3805  rte_be16_t tp_dst;
3806  uint16_t tun_flags;
3808  bool is_ipv6;
3814  uint8_t tos;
3815  uint8_t ttl;
3816  uint32_t label;
3817 };
3818 
3822 #define RTE_FLOW_RESTORE_INFO_TUNNEL (1ULL << 0)
3823 
3827 #define RTE_FLOW_RESTORE_INFO_ENCAPSULATED (1ULL << 1)
3828 
3832 #define RTE_FLOW_RESTORE_INFO_GROUP_ID (1ULL << 2)
3833 
3844  uint64_t flags;
3845  uint32_t group_id;
3846  struct rte_flow_tunnel tunnel;
3847 };
3848 
3872 __rte_experimental
3873 int
3874 rte_flow_tunnel_decap_set(uint16_t port_id,
3875  struct rte_flow_tunnel *tunnel,
3876  struct rte_flow_action **actions,
3877  uint32_t *num_of_actions,
3878  struct rte_flow_error *error);
3879 
3903 __rte_experimental
3904 int
3905 rte_flow_tunnel_match(uint16_t port_id,
3906  struct rte_flow_tunnel *tunnel,
3907  struct rte_flow_item **items,
3908  uint32_t *num_of_items,
3909  struct rte_flow_error *error);
3910 
3927 __rte_experimental
3928 int
3929 rte_flow_get_restore_info(uint16_t port_id,
3930  struct rte_mbuf *m,
3931  struct rte_flow_restore_info *info,
3932  struct rte_flow_error *error);
3933 
3950 __rte_experimental
3951 int
3952 rte_flow_tunnel_action_decap_release(uint16_t port_id,
3953  struct rte_flow_action *actions,
3954  uint32_t num_of_actions,
3955  struct rte_flow_error *error);
3956 
3973 __rte_experimental
3974 int
3975 rte_flow_tunnel_item_release(uint16_t port_id,
3976  struct rte_flow_item *items,
3977  uint32_t num_of_items,
3978  struct rte_flow_error *error);
3979 #ifdef __cplusplus
3980 }
3981 #endif
3982 
3983 #endif /* RTE_FLOW_H_ */
uint32_t reserved
Definition: rte_flow.h:101
static const struct rte_flow_item_icmp6_nd_opt_sla_eth rte_flow_item_icmp6_nd_opt_sla_eth_mask
Definition: rte_flow.h:1368
rte_be32_t u32
Definition: rte_ecpri.h:72
rte_flow_field_id
Definition: rte_flow.h:2865
rte_be16_t c_rsvd0_ver
Definition: rte_flow.h:1066
rte_be16_t ver_opt_len_o_c_rsvd0
Definition: rte_flow.h:1158
uint32_t reserved
Definition: rte_flow.h:860
int rte_flow_validate(uint16_t port_id, const struct rte_flow_attr *attr, const struct rte_flow_item pattern[], const struct rte_flow_action actions[], struct rte_flow_error *error)
struct rte_flow_action * actions
Definition: rte_flow.h:3077
static const struct rte_flow_item_icmp6_nd_na rte_flow_item_icmp6_nd_na_mask
Definition: rte_flow.h:1317
static const struct rte_flow_item_ipv6 rte_flow_item_ipv6_mask
Definition: rte_flow.h:866
rte_be16_t epcp_edei_in_ecid_b
Definition: rte_flow.h:996
rte_be16_t protocol
Definition: rte_flow.h:1159
static const struct rte_flow_item_pfcp rte_flow_item_pfcp_mask
Definition: rte_flow.h:1639
uint32_t has_auth_ext
Definition: rte_flow.h:848
uint32_t num
Definition: rte_flow.h:590
struct rte_flow_attr * attr
Definition: rte_flow.h:3069
__rte_experimental struct rte_flow_shared_action * rte_flow_shared_action_create(uint16_t port_id, const struct rte_flow_shared_action_conf *conf, const struct rte_flow_action *action, struct rte_flow_error *error)
uint32_t has_mobil_ext
Definition: rte_flow.h:854
uint32_t sec_since_last_hit
Definition: rte_flow.h:2342
uint32_t rte_be32_t
uint32_t original
Definition: rte_flow.h:2474
int rte_flow_query(uint16_t port_id, struct rte_flow *flow, const struct rte_flow_action *action, void *data, struct rte_flow_error *error)
uint32_t group
Definition: rte_flow.h:78
struct rte_flow_item * definition
Definition: rte_flow.h:2654
static const struct rte_flow_item_gre rte_flow_item_gre_mask
Definition: rte_flow.h:1072
rte_be16_t msg_len
Definition: rte_flow.h:1119
static const struct rte_flow_item_gtp rte_flow_item_gtp_mask
Definition: rte_flow.h:1125
static const struct rte_flow_item_icmp rte_flow_item_icmp_mask
Definition: rte_flow.h:889
#define RTE_ETHER_ADDR_LEN
Definition: rte_ether.h:30
static const struct rte_flow_item_geneve rte_flow_item_geneve_mask
Definition: rte_flow.h:1166
const struct rte_flow_attr * attr_ro
Definition: rte_flow.h:3068
static const struct rte_flow_item_sctp rte_flow_item_sctp_mask
Definition: rte_flow.h:946
int rte_flow_isolate(uint16_t port_id, int set, struct rte_flow_error *error)
static const struct rte_flow_item_any rte_flow_item_any_mask
Definition: rte_flow.h:595
static const struct rte_flow_item_meta rte_flow_item_meta_mask
Definition: rte_flow.h:1414
static const struct rte_flow_item_esp rte_flow_item_esp_mask
Definition: rte_flow.h:1141
__rte_experimental int rte_flow_get_restore_info(uint16_t port_id, struct rte_mbuf *m, struct rte_flow_restore_info *info, struct rte_flow_error *error)
struct rte_icmp_hdr hdr
Definition: rte_flow.h:884
__rte_deprecated size_t rte_flow_copy(struct rte_flow_desc *fd, size_t len, const struct rte_flow_attr *attr, const struct rte_flow_item *items, const struct rte_flow_action *actions)
uint8_t v_pt_rsv_flags
Definition: rte_flow.h:1117
struct rte_ether_addr tla
Definition: rte_flow.h:1387
rte_be16_t protocol
Definition: rte_flow.h:1024
uint32_t reserved
Definition: rte_flow.h:707
rte_be32_t spi
Definition: rte_esp.h:24
static const struct rte_flow_item_geneve_opt rte_flow_item_geneve_opt_mask
Definition: rte_flow.h:1683
static const struct rte_flow_item_icmp6 rte_flow_item_icmp6_mask
Definition: rte_flow.h:1268
rte_be16_t src_port
Definition: rte_sctp.h:29
struct rte_flow_action * actions
Definition: rte_flow.h:3512
struct rte_ipv4_hdr hdr
Definition: rte_flow.h:820
static const struct rte_flow_item_mark rte_flow_item_mark_mask
Definition: rte_flow.h:1538
uint32_t reserved
Definition: rte_flow.h:2338
rte_be32_t src_addr
Definition: rte_ip.h:42
static const struct rte_flow_item_icmp6_nd_opt rte_flow_item_icmp6_nd_opt_mask
Definition: rte_flow.h:1343
static const struct rte_flow_item_phy_port rte_flow_item_phy_port_mask
Definition: rte_flow.h:655
static const struct rte_flow_item_vxlan rte_flow_item_vxlan_mask
Definition: rte_flow.h:978
uint8_t src_addr[16]
Definition: rte_ip.h:392
static const struct rte_flow_item_port_id rte_flow_item_port_id_mask
Definition: rte_flow.h:681
static const struct rte_flow_item_higig2_hdr rte_flow_item_higig2_hdr_mask
Definition: rte_flow.h:568
static const struct rte_flow_item_nvgre rte_flow_item_nvgre_mask
Definition: rte_flow.h:1031
uint64_t rte_be64_t
const void * mask
Definition: rte_flow.h:1725
uint16_t vlan_tci
Definition: rte_ether.h:276
struct rte_flow_item * pattern
Definition: rte_flow.h:3073
rte_be16_t type
Definition: rte_flow.h:754
const void * cause
Definition: rte_flow.h:3053
__rte_experimental int rte_flow_shared_action_destroy(uint16_t port_id, struct rte_flow_shared_action *action, struct rte_flow_error *error)
static const struct rte_flow_item_udp rte_flow_item_udp_mask
Definition: rte_flow.h:908
struct rte_esp_hdr hdr
Definition: rte_flow.h:1136
rte_flow_error_type
Definition: rte_flow.h:3020
struct rte_ether_addr d_addr
Definition: rte_ether.h:265
uint32_t has_esp_ext
Definition: rte_flow.h:850
rte_flow_conv_op
Definition: rte_flow.h:3086
rte_be16_t src_port
Definition: rte_udp.h:29
uint32_t has_shim6_ext
Definition: rte_flow.h:858
uint32_t has_route_ext
Definition: rte_flow.h:844
__rte_experimental int rte_flow_shared_action_update(uint16_t port_id, struct rte_flow_shared_action *action, const struct rte_flow_action *update, struct rte_flow_error *error)
uint32_t id
Definition: rte_flow.h:619
const uint8_t * pattern
Definition: rte_flow.h:711
uint32_t search
Definition: rte_flow.h:706
rte_be16_t rsvd_grp_ecid_b
Definition: rte_flow.h:998
static const struct rte_flow_item_raw rte_flow_item_raw_mask
Definition: rte_flow.h:716
uint16_t limit
Definition: rte_flow.h:709
int rte_flow_flush(uint16_t port_id, struct rte_flow_error *error)
static const struct rte_flow_item_mpls rte_flow_item_mpls_mask
Definition: rte_flow.h:1051
static const struct rte_flow_item_icmp6_nd_ns rte_flow_item_icmp6_nd_ns_mask
Definition: rte_flow.h:1290
int rte_flow_error_set(struct rte_flow_error *error, int code, enum rte_flow_error_type type, const void *cause, const char *message)
const char * message
Definition: rte_flow.h:3054
rte_eth_hash_function
Definition: rte_flow.h:2397
uint16_t length
Definition: rte_flow.h:710
const void * last
Definition: rte_flow.h:1724
static const struct rte_flow_item_icmp6_nd_opt_tla_eth rte_flow_item_icmp6_nd_opt_tla_eth_mask
Definition: rte_flow.h:1393
rte_be32_t teid
Definition: rte_flow.h:1120
int rte_flow_destroy(uint16_t port_id, struct rte_flow *flow, struct rte_flow_error *error)
uint32_t ingress
Definition: rte_flow.h:80
rte_be16_t tci
Definition: rte_flow.h:794
rte_be32_t vx_vni
Definition: rte_vxlan.h:35
static const struct rte_flow_item_ipv4 rte_flow_item_ipv4_mask
Definition: rte_flow.h:825
size_t size
Definition: rte_flow.h:3509
rte_be16_t c_k_s_rsvd0_ver
Definition: rte_flow.h:1023
static const struct rte_flow_item_gtp_psc rte_flow_item_gtp_psc_mask
Definition: rte_flow.h:1432
rte_be16_t length
Definition: rte_flow.h:1449
const struct rte_flow_action * actions_ro
Definition: rte_flow.h:3076
uint32_t has_vlan
Definition: rte_flow.h:758
uint32_t has_more_vlan
Definition: rte_flow.h:799
struct rte_flow_item * items
Definition: rte_flow.h:3511
__rte_experimental int rte_flow_get_aged_flows(uint16_t port_id, void **contexts, uint32_t nb_contexts, struct rte_flow_error *error)
rte_flow_action_type
Definition: rte_flow.h:1754
struct rte_ether_addr sla
Definition: rte_flow.h:1362
rte_flow_modify_op
Definition: rte_flow.h:2921
uint32_t has_hop_ext
Definition: rte_flow.h:842
struct rte_flow * rte_flow_create(uint16_t port_id, const struct rte_flow_attr *attr, const struct rte_flow_item pattern[], const struct rte_flow_action actions[], struct rte_flow_error *error)
static const struct rte_flow_item_l2tpv3oip rte_flow_item_l2tpv3oip_mask
Definition: rte_flow.h:1508
static const struct rte_flow_item_igmp rte_flow_item_igmp_mask
Definition: rte_flow.h:1593
const void * spec
Definition: rte_flow.h:1723
uint8_t label_tc_s[3]
Definition: rte_flow.h:1045
uint8_t version_type
Definition: rte_flow.h:1446
#define RTE_STD_C11
Definition: rte_common.h:40
__rte_experimental int rte_flow_tunnel_decap_set(uint16_t port_id, struct rte_flow_tunnel *tunnel, struct rte_flow_action **actions, uint32_t *num_of_actions, struct rte_flow_error *error)
const uint8_t * key
Definition: rte_flow.h:2457
static const struct rte_flow_item_arp_eth_ipv4 rte_flow_item_arp_eth_ipv4_mask
Definition: rte_flow.h:1211
uint32_t has_hip_ext
Definition: rte_flow.h:856
const struct rte_flow_action * actions
Definition: rte_flow.h:3010
uint32_t sec_since_last_hit_valid
Definition: rte_flow.h:2340
struct rte_ether_addr sha
Definition: rte_flow.h:1202
static const struct rte_flow_item_eth rte_flow_item_eth_mask
Definition: rte_flow.h:764
rte_be16_t src_port
Definition: rte_tcp.h:29
uint16_t rte_be16_t
__rte_experimental int rte_flow_conv(enum rte_flow_conv_op op, void *dst, size_t size, const void *src, struct rte_flow_error *error)
uint32_t has_frag_ext
Definition: rte_flow.h:846
uint32_t reserved
Definition: rte_flow.h:2475
__rte_experimental int rte_flow_dynf_metadata_register(void)
static const struct rte_flow_item_ah rte_flow_item_ah_mask
Definition: rte_flow.h:1617
static const struct rte_flow_item_tag rte_flow_item_tag_mask
Definition: rte_flow.h:1491
uint32_t priority
Definition: rte_flow.h:79
uint32_t has_dest_ext
Definition: rte_flow.h:852
static const struct rte_flow_item_ipv6_ext rte_flow_item_ipv6_ext_mask
Definition: rte_flow.h:1236
static const struct rte_flow_item_vf rte_flow_item_vf_mask
Definition: rte_flow.h:624
struct rte_ipv6_hdr hdr
Definition: rte_flow.h:841
__rte_experimental int rte_flow_shared_action_query(uint16_t port_id, const struct rte_flow_shared_action *action, void *data, struct rte_flow_error *error)
static const struct rte_flow_item_ecpri rte_flow_item_ecpri_mask
Definition: rte_flow.h:1659
rte_be16_t protocol
Definition: rte_flow.h:1067
uint32_t queue_num
Definition: rte_flow.h:2456
uint8_t tni[3]
Definition: rte_flow.h:1025
struct rte_tcp_hdr hdr
Definition: rte_flow.h:922
static const struct rte_flow_item_pppoe_proto_id rte_flow_item_pppoe_proto_id_mask
Definition: rte_flow.h:1471
__rte_experimental int rte_flow_dev_dump(uint16_t port_id, FILE *file, struct rte_flow_error *error)
uint32_t transfer
Definition: rte_flow.h:100
struct rte_flow_item * definition
Definition: rte_flow.h:2688
static const struct rte_flow_item_vlan rte_flow_item_vlan_mask
Definition: rte_flow.h:806
uint8_t msg_type
Definition: rte_flow.h:1118
uint32_t reserved
Definition: rte_flow.h:801
uint32_t egress
Definition: rte_flow.h:81
static const struct rte_flow_item_e_tag rte_flow_item_e_tag_mask
Definition: rte_flow.h:1006
static __rte_experimental int rte_flow_dynf_metadata_avail(void)
Definition: rte_flow.h:3255
__rte_experimental int rte_flow_tunnel_item_release(uint16_t port_id, struct rte_flow_item *items, uint32_t num_of_items, struct rte_flow_error *error)
static const struct rte_flow_item_tcp rte_flow_item_tcp_mask
Definition: rte_flow.h:927
static const struct rte_flow_item_fuzzy rte_flow_item_fuzzy_mask
Definition: rte_flow.h:1100
uint8_t addr_bytes[RTE_ETHER_ADDR_LEN]
Definition: rte_ether.h:65
rte_be16_t inner_type
Definition: rte_flow.h:795
__rte_experimental int rte_flow_tunnel_action_decap_release(uint16_t port_id, struct rte_flow_action *actions, uint32_t num_of_actions, struct rte_flow_error *error)
struct rte_udp_hdr hdr
Definition: rte_flow.h:903
const uint16_t * queue
Definition: rte_flow.h:2458
rte_flow_item_type
Definition: rte_flow.h:120
uint32_t relative
Definition: rte_flow.h:705
int32_t offset
Definition: rte_flow.h:708
rte_be16_t inner_type
Definition: rte_flow.h:1001
__rte_experimental int rte_flow_tunnel_match(uint16_t port_id, struct rte_flow_tunnel *tunnel, struct rte_flow_item **items, uint32_t *num_of_items, struct rte_flow_error *error)
const struct rte_flow_item * pattern_ro
Definition: rte_flow.h:3072
static const struct rte_flow_item_vxlan_gpe rte_flow_item_vxlan_gpe_mask
Definition: rte_flow.h:1186
rte_be16_t session_id
Definition: rte_flow.h:1448
static const struct rte_flow_item_nsh rte_flow_item_nsh_mask
Definition: rte_flow.h:1567
struct rte_sctp_hdr hdr
Definition: rte_flow.h:941
uint32_t reserved
Definition: rte_flow.h:759