DPDK  23.03.0
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_compat.h>
21 #include <rte_common.h>
22 #include <rte_ether.h>
23 #include <rte_arp.h>
24 #include <rte_icmp.h>
25 #include <rte_ip.h>
26 #include <rte_sctp.h>
27 #include <rte_tcp.h>
28 #include <rte_udp.h>
29 #include <rte_vxlan.h>
30 #include <rte_esp.h>
31 #include <rte_higig.h>
32 #include <rte_ecpri.h>
33 #include <rte_bitops.h>
34 #include <rte_mbuf_dyn.h>
35 #include <rte_meter.h>
36 #include <rte_gtp.h>
37 #include <rte_l2tpv2.h>
38 #include <rte_ppp.h>
39 #include <rte_gre.h>
40 #include <rte_macsec.h>
41 
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
45 
46 #define RTE_FLOW_LOG(level, ...) \
47  rte_log(RTE_LOG_ ## level, rte_eth_dev_logtype, "" __VA_ARGS__)
48 
89 struct rte_flow_attr {
100  uint32_t group;
101  uint32_t priority;
105  uint32_t ingress:1;
109  uint32_t egress:1;
127  uint32_t transfer:1;
128  uint32_t reserved:29;
129 };
130 
157 
167 
177 
185 
199 
206 
213 
220 
227 
234 
241 
248 
255 
262 
269 
276 
283 
290 
297 
309 
318 
327 
336 
343 
350 
357 
364 
371 
378 
385 
392 
399 
407 
415 
422 
431 
444 
453 
462 
471 
480 
487 
494 
501 
507 
516 
525 
532 
541 
548 
555 
566 
575 
584 
594 
603 
610 
617 
624 
631 
638 
645 
652 
659 
666 
675 };
676 
688 };
689 
696  enum rte_flow_quota_state state;
697 };
698 
702 #ifndef __cplusplus
704  .state = (enum rte_flow_quota_state)0xff
705 };
706 #endif
707 
715  struct rte_higig2_hdr hdr;
716 };
717 
719 #ifndef __cplusplus
721  .hdr = {
722  .ppt1 = {
723  .classification = RTE_BE16(UINT16_MAX),
724  .vid = RTE_BE16(0xfff),
725  },
726  },
727 };
728 #endif
729 
742  uint32_t num;
743 };
744 
746 #ifndef __cplusplus
748  .num = 0x00000000,
749 };
750 #endif
751 
767  uint32_t id;
768 };
769 
771 #ifndef __cplusplus
773  .id = 0xffffffff,
774 };
775 #endif
776 
796  uint32_t relative:1;
797  uint32_t search:1;
798  uint32_t reserved:30;
799  int32_t offset;
800  uint16_t limit;
801  uint16_t length;
802  const uint8_t *pattern;
803 };
804 
806 #ifndef __cplusplus
808  .relative = 1,
809  .search = 1,
810  .reserved = 0x3fffffff,
811  .offset = 0xffffffff,
812  .limit = 0xffff,
813  .length = 0xffff,
814  .pattern = NULL,
815 };
816 #endif
817 
837  union {
838  struct {
839  /*
840  * These fields are retained for compatibility.
841  * Please switch to the new header field below.
842  */
843  struct rte_ether_addr dst;
844  struct rte_ether_addr src;
846  };
847  struct rte_ether_hdr hdr;
848  };
849  uint32_t has_vlan:1;
850  uint32_t reserved:31;
851 };
852 
854 #ifndef __cplusplus
856  .hdr.dst_addr.addr_bytes = "\xff\xff\xff\xff\xff\xff",
857  .hdr.src_addr.addr_bytes = "\xff\xff\xff\xff\xff\xff",
858  .hdr.ether_type = RTE_BE16(0x0000),
859 };
860 #endif
861 
879  union {
880  struct {
881  /*
882  * These fields are retained for compatibility.
883  * Please switch to the new header field below.
884  */
887  };
888  struct rte_vlan_hdr hdr;
889  };
891  uint32_t has_more_vlan:1;
892  uint32_t reserved:31;
893 };
894 
896 #ifndef __cplusplus
898  .hdr.vlan_tci = RTE_BE16(0x0fff),
899  .hdr.eth_proto = RTE_BE16(0x0000),
900 };
901 #endif
902 
911  struct rte_ipv4_hdr hdr;
912 };
913 
915 #ifndef __cplusplus
917  .hdr = {
918  .src_addr = RTE_BE32(0xffffffff),
919  .dst_addr = RTE_BE32(0xffffffff),
920  },
921 };
922 #endif
923 
932  struct rte_ipv6_hdr hdr;
934  uint32_t has_hop_ext:1;
936  uint32_t has_route_ext:1;
938  uint32_t has_frag_ext:1;
940  uint32_t has_auth_ext:1;
942  uint32_t has_esp_ext:1;
944  uint32_t has_dest_ext:1;
946  uint32_t has_mobil_ext:1;
948  uint32_t has_hip_ext:1;
950  uint32_t has_shim6_ext:1;
952  uint32_t reserved:23;
953 };
954 
956 #ifndef __cplusplus
958  .hdr = {
959  .src_addr =
960  "\xff\xff\xff\xff\xff\xff\xff\xff"
961  "\xff\xff\xff\xff\xff\xff\xff\xff",
962  .dst_addr =
963  "\xff\xff\xff\xff\xff\xff\xff\xff"
964  "\xff\xff\xff\xff\xff\xff\xff\xff",
965  },
966 };
967 #endif
968 
978  struct rte_ipv6_routing_ext hdr;
979 };
980 
987  struct rte_icmp_hdr hdr;
988 };
989 
991 #ifndef __cplusplus
993  .hdr = {
994  .icmp_type = 0xff,
995  .icmp_code = 0xff,
996  },
997 };
998 #endif
999 
1006  struct rte_udp_hdr hdr;
1007 };
1008 
1010 #ifndef __cplusplus
1012  .hdr = {
1013  .src_port = RTE_BE16(0xffff),
1014  .dst_port = RTE_BE16(0xffff),
1015  },
1016 };
1017 #endif
1018 
1025  struct rte_tcp_hdr hdr;
1026 };
1027 
1029 #ifndef __cplusplus
1031  .hdr = {
1032  .src_port = RTE_BE16(0xffff),
1033  .dst_port = RTE_BE16(0xffff),
1034  },
1035 };
1036 #endif
1037 
1044  struct rte_sctp_hdr hdr;
1045 };
1046 
1048 #ifndef __cplusplus
1050  .hdr = {
1051  .src_port = RTE_BE16(0xffff),
1052  .dst_port = RTE_BE16(0xffff),
1053  },
1054 };
1055 #endif
1056 
1064  union {
1065  struct {
1066  /*
1067  * These fields are retained for compatibility.
1068  * Please switch to the new header field below.
1069  */
1070  uint8_t flags;
1071  uint8_t rsvd0[3];
1072  uint8_t vni[3];
1073  uint8_t rsvd1;
1074  };
1075  struct rte_vxlan_hdr hdr;
1076  };
1077 };
1078 
1080 #ifndef __cplusplus
1082  .hdr.vni = "\xff\xff\xff",
1083 };
1084 #endif
1085 
1102  uint8_t in_ecid_e;
1103  uint8_t ecid_e;
1105 };
1106 
1108 #ifndef __cplusplus
1110  .rsvd_grp_ecid_b = RTE_BE16(0x3fff),
1111 };
1112 #endif
1113 
1128  uint8_t tni[3];
1129  uint8_t flow_id;
1130 };
1131 
1133 #ifndef __cplusplus
1135  .tni = "\xff\xff\xff",
1136 };
1137 #endif
1138 
1148  uint8_t label_tc_s[3];
1149  uint8_t ttl;
1150 };
1151 
1153 #ifndef __cplusplus
1155  .label_tc_s = "\xff\xff\xf0",
1156 };
1157 #endif
1158 
1171 };
1172 
1174 #ifndef __cplusplus
1176  .protocol = RTE_BE16(0xffff),
1177 };
1178 #endif
1179 
1186  struct rte_gre_hdr_opt_checksum_rsvd checksum_rsvd;
1187  struct rte_gre_hdr_opt_key key;
1188  struct rte_gre_hdr_opt_sequence sequence;
1189 };
1190 
1197  struct rte_macsec_hdr macsec_hdr;
1198 };
1199 
1218  uint32_t thresh;
1219 };
1220 
1222 #ifndef __cplusplus
1224  .thresh = 0xffffffff,
1225 };
1226 #endif
1227 
1235  union {
1236  struct {
1237  /*
1238  * These are old fields kept for compatibility.
1239  * Please prefer hdr field below.
1240  */
1248  uint8_t msg_type;
1251  };
1252  struct rte_gtp_hdr hdr;
1253  };
1254 };
1255 
1257 #ifndef __cplusplus
1259  .hdr.teid = RTE_BE32(UINT32_MAX),
1260 };
1261 #endif
1262 
1269  struct rte_esp_hdr hdr;
1270 };
1271 
1273 #ifndef __cplusplus
1275  .hdr = {
1276  .spi = RTE_BE32(0xffffffff),
1277  },
1278 };
1279 #endif
1280 
1293  uint8_t vni[3];
1294  uint8_t rsvd1;
1295 };
1296 
1298 #ifndef __cplusplus
1300  .vni = "\xff\xff\xff",
1301 };
1302 #endif
1303 
1311  union {
1312  struct {
1313  /*
1314  * These are old fields kept for compatibility.
1315  * Please prefer hdr field below.
1316  */
1317  uint8_t flags;
1318  uint8_t rsvd0[2];
1319  uint8_t protocol;
1320  uint8_t vni[3];
1321  uint8_t rsvd1;
1322  };
1323  struct rte_vxlan_gpe_hdr hdr;
1324  };
1325 };
1326 
1328 #ifndef __cplusplus
1330  .hdr.vni = "\xff\xff\xff",
1331 };
1332 #endif
1333 
1341  union {
1342  struct {
1343  /*
1344  * These are old fields kept for compatibility.
1345  * Please prefer hdr field below.
1346  */
1349  uint8_t hln;
1350  uint8_t pln;
1352  struct rte_ether_addr sha;
1354  struct rte_ether_addr tha;
1356  };
1357  struct rte_arp_hdr hdr;
1358  };
1359 };
1360 
1362 #ifndef __cplusplus
1363 static const struct rte_flow_item_arp_eth_ipv4
1365  .hdr.arp_data.arp_sha.addr_bytes = "\xff\xff\xff\xff\xff\xff",
1366  .hdr.arp_data.arp_sip = RTE_BE32(UINT32_MAX),
1367  .hdr.arp_data.arp_tha.addr_bytes = "\xff\xff\xff\xff\xff\xff",
1368  .hdr.arp_data.arp_tip = RTE_BE32(UINT32_MAX),
1369 };
1370 #endif
1371 
1383  uint8_t next_hdr;
1384 };
1385 
1387 #ifndef __cplusplus
1388 static const
1390  .next_hdr = 0xff,
1391 };
1392 #endif
1393 
1405  struct rte_ipv6_fragment_ext hdr;
1406 };
1407 
1414  uint8_t type;
1415  uint8_t code;
1416  uint16_t checksum;
1417 };
1418 
1420 #ifndef __cplusplus
1422  .type = 0xff,
1423  .code = 0xff,
1424 };
1425 #endif
1426 
1434  struct rte_icmp_echo_hdr hdr;
1435 };
1436 
1443  uint8_t type;
1444  uint8_t code;
1447  uint8_t target_addr[16];
1448 };
1449 
1451 #ifndef __cplusplus
1452 static const
1454  .target_addr =
1455  "\xff\xff\xff\xff\xff\xff\xff\xff"
1456  "\xff\xff\xff\xff\xff\xff\xff\xff",
1457 };
1458 #endif
1459 
1466  uint8_t type;
1467  uint8_t code;
1474  uint8_t target_addr[16];
1475 };
1476 
1478 #ifndef __cplusplus
1479 static const
1481  .target_addr =
1482  "\xff\xff\xff\xff\xff\xff\xff\xff"
1483  "\xff\xff\xff\xff\xff\xff\xff\xff",
1484 };
1485 #endif
1486 
1499  uint8_t type;
1500  uint8_t length;
1501 };
1502 
1504 #ifndef __cplusplus
1505 static const struct rte_flow_item_icmp6_nd_opt
1507  .type = 0xff,
1508 };
1509 #endif
1510 
1523  uint8_t type;
1524  uint8_t length;
1525  struct rte_ether_addr sla;
1526 };
1527 
1529 #ifndef __cplusplus
1530 static const struct rte_flow_item_icmp6_nd_opt_sla_eth
1532  .sla.addr_bytes = "\xff\xff\xff\xff\xff\xff",
1533 };
1534 #endif
1535 
1548  uint8_t type;
1549  uint8_t length;
1550  struct rte_ether_addr tla;
1551 };
1552 
1554 #ifndef __cplusplus
1555 static const struct rte_flow_item_icmp6_nd_opt_tla_eth
1557  .tla.addr_bytes = "\xff\xff\xff\xff\xff\xff",
1558 };
1559 #endif
1560 
1573  uint32_t data;
1574 };
1575 
1577 #ifndef __cplusplus
1579  .data = UINT32_MAX,
1580 };
1581 #endif
1582 
1590 };
1591 
1593 #ifndef __cplusplus
1594 static const struct rte_flow_item_gtp_psc
1596  .hdr.qfi = 0x3f,
1597 };
1598 #endif
1599 
1609  uint8_t version_type;
1610  uint8_t code;
1613 };
1614 
1629 };
1630 
1632 #ifndef __cplusplus
1633 static const struct rte_flow_item_pppoe_proto_id
1635  .proto_id = RTE_BE16(0xffff),
1636 };
1637 #endif
1638 
1648  uint32_t data;
1649  uint8_t index;
1650 };
1651 
1653 #ifndef __cplusplus
1655  .data = 0xffffffff,
1656  .index = 0xff,
1657 };
1658 #endif
1659 
1667 };
1668 
1670 #ifndef __cplusplus
1672  .session_id = RTE_BE32(UINT32_MAX),
1673 };
1674 #endif
1675 
1676 
1696  uint32_t id;
1697 };
1698 
1700 #ifndef __cplusplus
1702  .id = 0xffffffff,
1703 };
1704 #endif
1705 
1716  uint32_t version:2;
1717  uint32_t oam_pkt:1;
1718  uint32_t reserved:1;
1719  uint32_t ttl:6;
1720  uint32_t length:6;
1721  uint32_t reserved1:4;
1722  uint32_t mdtype:4;
1723  uint32_t next_proto:8;
1724  uint32_t spi:24;
1725  uint32_t sindex:8;
1726 };
1727 
1729 #ifndef __cplusplus
1731  .mdtype = 0xf,
1732  .next_proto = 0xff,
1733  .spi = 0xffffff,
1734  .sindex = 0xff,
1735 };
1736 #endif
1737 
1748  uint32_t type:8;
1749  uint32_t max_resp_time:8;
1750  uint32_t checksum:16;
1751  uint32_t group_addr;
1752 };
1753 
1755 #ifndef __cplusplus
1757  .group_addr = 0xffffffff,
1758 };
1759 #endif
1760 
1771  uint32_t next_hdr:8;
1772  uint32_t payload_len:8;
1773  uint32_t reserved:16;
1774  uint32_t spi;
1775  uint32_t seq_num;
1776 };
1777 
1779 #ifndef __cplusplus
1781  .spi = 0xffffffff,
1782 };
1783 #endif
1784 
1794  uint8_t s_field;
1795  uint8_t msg_type;
1796  rte_be16_t msg_len;
1797  rte_be64_t seid;
1798 };
1799 
1801 #ifndef __cplusplus
1803  .s_field = 0x01,
1804  .seid = RTE_BE64(UINT64_C(0xffffffffffffffff)),
1805 };
1806 #endif
1807 
1817  struct rte_ecpri_combined_msg_hdr hdr;
1818 };
1819 
1821 #ifndef __cplusplus
1823  .hdr = {
1824  .common = {
1825  .u32 = 0x0,
1826  },
1827  },
1828 };
1829 #endif
1830 
1837  rte_be16_t option_class;
1838  uint8_t option_type;
1839  uint8_t option_len;
1840  uint32_t *data;
1841 };
1842 
1844 #ifndef __cplusplus
1845 static const struct rte_flow_item_geneve_opt
1847  .option_type = 0xff,
1848 };
1849 #endif
1850 
1863  uint32_t level;
1864  RTE_STD_C11
1865  union {
1866  __extension__
1867  struct {
1869  uint64_t packet_ok:1;
1871  uint64_t l2_ok:1;
1873  uint64_t l3_ok:1;
1875  uint64_t l4_ok:1;
1877  uint64_t l2_crc_ok:1;
1879  uint64_t ipv4_csum_ok:1;
1881  uint64_t l4_csum_ok:1;
1883  uint64_t l3_len_ok:1;
1884  uint64_t reserved:56;
1885  };
1886  uint64_t value;
1887  };
1888 };
1889 
1890 #ifndef __cplusplus
1891 static const struct rte_flow_item_integrity
1892 rte_flow_item_integrity_mask = {
1893  .level = 0,
1894  .value = 0,
1895 };
1896 #endif
1897 
1901 #define RTE_FLOW_CONNTRACK_PKT_STATE_VALID RTE_BIT32(0)
1902 
1905 #define RTE_FLOW_CONNTRACK_PKT_STATE_CHANGED RTE_BIT32(1)
1906 
1910 #define RTE_FLOW_CONNTRACK_PKT_STATE_INVALID RTE_BIT32(2)
1911 
1915 #define RTE_FLOW_CONNTRACK_PKT_STATE_DISABLED RTE_BIT32(3)
1916 
1920 #define RTE_FLOW_CONNTRACK_PKT_STATE_BAD RTE_BIT32(4)
1921 
1933  uint32_t flags;
1934 };
1935 
1937 #ifndef __cplusplus
1939  .flags = 0xffffffff,
1940 };
1941 #endif
1942 
1949  uint16_t port_id;
1950 };
1951 
1953 #ifndef __cplusplus
1955  .port_id = 0xffff,
1956 };
1957 #endif
1958 
1968  struct rte_l2tpv2_combined_msg_hdr hdr;
1969 };
1970 
1972 #ifndef __cplusplus
1974  /*
1975  * flags and version bit mask
1976  * 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
1977  * T L x x S x O P x x x x V V V V
1978  */
1979  .hdr = {
1980  .common = {
1981  .flags_version = RTE_BE16(0xcb0f),
1982  },
1983  },
1984 };
1985 #endif
1986 
1996  struct rte_ppp_hdr hdr;
1997 };
1998 
2000 #ifndef __cplusplus
2002  .hdr = {
2003  .addr = 0xff,
2004  .ctrl = 0xff,
2005  .proto_id = RTE_BE16(0xffff),
2006  }
2007 };
2008 #endif
2009 
2045  const void *spec;
2046  const void *last;
2047  const void *mask;
2048 };
2049 
2067  struct rte_flow_item_flex_handle *handle;
2068  uint32_t length;
2069  const uint8_t *pattern;
2070 };
2102 };
2103 
2133 };
2134 
2140 __extension__
2144  uint32_t field_size;
2145  int32_t field_base;
2146  uint32_t offset_base;
2147  uint32_t offset_mask;
2148  int32_t offset_shift;
2149  uint32_t field_id:16;
2150  uint32_t reserved:16;
2151 };
2152 
2163  struct rte_flow_item item;
2168  uint32_t next;
2169 };
2170 
2187  struct rte_flow_item_flex_field next_header;
2192  struct rte_flow_item_flex_field next_protocol;
2200  uint32_t nb_samples;
2210  uint32_t nb_inputs;
2218  uint32_t nb_outputs;
2219 };
2220 
2227  enum rte_color color;
2228 };
2229 
2231 #ifndef __cplusplus
2233  .color = RTE_COLORS,
2234 };
2235 #endif
2236 
2252  uint8_t affinity;
2253 };
2254 
2256 #ifndef __cplusplus
2257 static const struct rte_flow_item_aggr_affinity
2259  .affinity = 0xff,
2260 };
2261 #endif
2262 
2297 
2305 
2313 
2322 
2334 
2346 
2353 
2362 
2373 
2382 
2394 
2406 
2417 
2425 
2433 
2444 
2452 
2460 
2468 
2476 
2484 
2492 
2500 
2509 
2517 
2526 
2533 
2540 
2553 
2566 
2579 
2592 
2606 
2620 
2631 
2641 
2651 
2664 
2677 
2694 
2711 
2728 
2745 
2758 
2768 
2781 
2794 
2807 
2815 
2826 
2837 
2845 
2854 
2862 
2869 
2877 
2885 
2896 
2905 
2915 };
2916 
2929 };
2930 
2941  int64_t quota;
2942 };
2943 
2954  int64_t quota;
2955 };
2956 
2968 };
2969 
2980  int64_t quota;
2981 };
2982 
2994  uint32_t id;
2995 };
2996 
3010  uint32_t group;
3011 };
3012 
3019  uint16_t index;
3020 };
3021 
3036  uint32_t timeout:24;
3037  uint32_t reserved:8;
3039  void *context;
3040 };
3041 
3049  uint32_t reserved:6;
3050  uint32_t aged:1;
3053  uint32_t sec_since_last_hit:24;
3054 };
3055 
3076  uint32_t reserved:6;
3077  uint32_t timeout_valid:1;
3078  uint32_t timeout:24;
3080  uint32_t touch:1;
3081 };
3082 
3101  uint32_t id;
3102 };
3103 
3110  uint32_t reset:1;
3111  uint32_t hits_set:1;
3112  uint32_t bytes_set:1;
3113  uint32_t reserved:29;
3114  uint64_t hits;
3115  uint64_t bytes;
3116 };
3117 
3122  RTE_ETH_HASH_FUNCTION_DEFAULT = 0,
3131  RTE_ETH_HASH_FUNCTION_MAX,
3132 };
3133 
3177  uint32_t level;
3178  uint64_t types;
3179  uint32_t key_len;
3180  uint32_t queue_num;
3181  const uint8_t *key;
3182  const uint16_t *queue;
3183 };
3184 
3202  uint32_t original:1;
3203  uint32_t reserved:31;
3204  uint32_t id;
3205 };
3206 
3219  uint32_t original:1;
3220  uint32_t reserved:31;
3221  uint32_t id;
3222 };
3223 
3233  uint32_t mtr_id;
3234 };
3235 
3268 };
3269 
3278 };
3279 
3288 };
3289 
3297  uint8_t vlan_pcp;
3298 };
3299 
3308 };
3309 
3318 };
3319 
3353 };
3354 
3387 };
3388 
3409  uint8_t *data;
3410  uint8_t *preserve;
3411  size_t size;
3412 };
3413 
3430  uint8_t *data;
3431  size_t size;
3432 };
3433 
3446  rte_be32_t ipv4_addr;
3447 };
3448 
3461  uint8_t ipv6_addr[16];
3462 };
3463 
3476  rte_be16_t port;
3477 };
3478 
3485  uint8_t ttl_value;
3486 };
3487 
3494  uint8_t mac_addr[RTE_ETHER_ADDR_LEN];
3495 };
3496 
3507  uint32_t data;
3508  uint32_t mask;
3509  uint8_t index;
3510 };
3511 
3532  uint32_t data;
3533  uint32_t mask;
3534 };
3535 
3544  uint8_t dscp;
3545 };
3546 
3564 struct rte_flow_action_handle;
3565 
3582 };
3583 
3594 };
3595 
3607  uint32_t scale:4;
3609  uint32_t close_initiated:1;
3611  uint32_t last_ack_seen:1;
3616  uint32_t data_unacked:1;
3621  uint32_t sent_end;
3626  uint32_t reply_end;
3628  uint32_t max_win;
3630  uint32_t max_ack;
3631 };
3632 
3645  uint16_t peer_port;
3650  uint32_t is_original_dir:1;
3658  uint32_t enable:1;
3660  uint32_t live_connection:1;
3662  uint32_t selective_ack:1;
3669  uint32_t last_direction:1;
3671  uint32_t liberal_mode:1;
3679  struct rte_flow_tcp_dir_param original_dir;
3681  struct rte_flow_tcp_dir_param reply_dir;
3683  uint16_t last_window;
3684  enum rte_flow_conntrack_tcp_last_index last_index;
3686  uint32_t last_seq;
3688  uint32_t last_ack;
3693  uint32_t last_end;
3694 };
3695 
3707  uint32_t direction:1;
3709  uint32_t state:1;
3711  uint32_t reserved:30;
3712 };
3713 
3724  enum rte_color color;
3725 };
3726 
3733  uint16_t port_id;
3734 };
3735 
3776 };
3777 
3785  enum rte_flow_field_id field;
3786  RTE_STD_C11
3787  union {
3788  struct {
3790  union {
3791  uint32_t level;
3792  struct rte_flow_item_flex_handle *flex_handle;
3793  };
3795  uint32_t offset;
3796  };
3803  uint8_t value[16];
3809  void *pvalue;
3810  };
3811 };
3812 
3820 };
3821 
3833  enum rte_flow_modify_op operation;
3836  uint32_t width;
3837 };
3838 
3851 
3853  struct rte_flow_meter_profile *profile;
3855  struct rte_flow_meter_policy *policy;
3859  enum rte_color init_color;
3861  int state;
3862 };
3863 
3872  struct rte_flow_action_meter_mark meter_mark;
3874  uint32_t profile_valid:1;
3876  uint32_t policy_valid:1;
3878  uint32_t color_mode_valid:1;
3880  uint32_t init_color_valid:1;
3882  uint32_t state_valid:1;
3884  uint32_t reserved:27;
3885 };
3886 
3887 /* Mbuf dynamic field offset for metadata. */
3888 extern int32_t rte_flow_dynf_metadata_offs;
3889 
3890 /* Mbuf dynamic field flag mask for metadata. */
3891 extern uint64_t rte_flow_dynf_metadata_mask;
3892 
3893 /* Mbuf dynamic field pointer for metadata. */
3894 #define RTE_FLOW_DYNF_METADATA(m) \
3895  RTE_MBUF_DYNFIELD((m), rte_flow_dynf_metadata_offs, uint32_t *)
3896 
3897 /* Mbuf dynamic flags for metadata. */
3898 #define RTE_MBUF_DYNFLAG_RX_METADATA (rte_flow_dynf_metadata_mask)
3899 #define RTE_MBUF_DYNFLAG_TX_METADATA (rte_flow_dynf_metadata_mask)
3900 
3901 __rte_experimental
3902 static inline uint32_t
3903 rte_flow_dynf_metadata_get(struct rte_mbuf *m)
3904 {
3905  return *RTE_FLOW_DYNF_METADATA(m);
3906 }
3907 
3908 __rte_experimental
3909 static inline void
3910 rte_flow_dynf_metadata_set(struct rte_mbuf *m, uint32_t v)
3911 {
3912  *RTE_FLOW_DYNF_METADATA(m) = v;
3913 }
3914 
3924  const void *conf;
3925 };
3926 
3933 struct rte_flow;
3934 
3940 struct rte_flow_meter_profile;
3941 
3947 struct rte_flow_meter_policy;
3948 
3966  uint32_t ratio;
3968  const struct rte_flow_action *actions;
3969 };
3970 
3996 };
3997 
4011  const void *cause;
4012  const char *message;
4013 };
4014 
4025  union {
4026  const struct rte_flow_attr *attr_ro;
4028  };
4029  union {
4030  const struct rte_flow_item *pattern_ro;
4032  };
4033  union {
4034  const struct rte_flow_action *actions_ro;
4036  };
4037 };
4038 
4051 
4063 
4075 
4087 
4100 
4113 
4126 
4140 
4154 
4168 
4182 };
4183 
4203 __rte_experimental
4204 int
4205 rte_flow_dev_dump(uint16_t port_id, struct rte_flow *flow,
4206  FILE *file, struct rte_flow_error *error);
4207 
4214 __rte_experimental
4215 static inline int
4217 {
4218  return !!rte_flow_dynf_metadata_mask;
4219 }
4220 
4231 __rte_experimental
4232 int
4234 
4287 int
4288 rte_flow_validate(uint16_t port_id,
4289  const struct rte_flow_attr *attr,
4290  const struct rte_flow_item pattern[],
4291  const struct rte_flow_action actions[],
4292  struct rte_flow_error *error);
4293 
4314 struct rte_flow *
4315 rte_flow_create(uint16_t port_id,
4316  const struct rte_flow_attr *attr,
4317  const struct rte_flow_item pattern[],
4318  const struct rte_flow_action actions[],
4319  struct rte_flow_error *error);
4320 
4341 int
4342 rte_flow_destroy(uint16_t port_id,
4343  struct rte_flow *flow,
4344  struct rte_flow_error *error);
4345 
4362 int
4363 rte_flow_flush(uint16_t port_id,
4364  struct rte_flow_error *error);
4365 
4390 int
4391 rte_flow_query(uint16_t port_id,
4392  struct rte_flow *flow,
4393  const struct rte_flow_action *action,
4394  void *data,
4395  struct rte_flow_error *error);
4396 
4442 int
4443 rte_flow_isolate(uint16_t port_id, int set, struct rte_flow_error *error);
4444 
4462 int
4463 rte_flow_error_set(struct rte_flow_error *error,
4464  int code,
4465  enum rte_flow_error_type type,
4466  const void *cause,
4467  const char *message);
4468 
4474  size_t size;
4475  struct rte_flow_attr attr;
4478  uint8_t data[];
4479 };
4480 
4507 __rte_deprecated
4508 size_t
4509 rte_flow_copy(struct rte_flow_desc *fd, size_t len,
4510  const struct rte_flow_attr *attr,
4511  const struct rte_flow_item *items,
4512  const struct rte_flow_action *actions);
4513 
4554 __rte_experimental
4555 int
4557  void *dst,
4558  size_t size,
4559  const void *src,
4560  struct rte_flow_error *error);
4561 
4590 __rte_experimental
4591 int
4592 rte_flow_get_aged_flows(uint16_t port_id, void **contexts,
4593  uint32_t nb_contexts, struct rte_flow_error *error);
4594 
4634 __rte_experimental
4635 int
4636 rte_flow_get_q_aged_flows(uint16_t port_id, uint32_t queue_id, void **contexts,
4637  uint32_t nb_contexts, struct rte_flow_error *error);
4638 
4650  uint32_t ingress:1;
4652  uint32_t egress:1;
4657  uint32_t transfer:1;
4658 };
4659 
4687 __rte_experimental
4688 struct rte_flow_action_handle *
4689 rte_flow_action_handle_create(uint16_t port_id,
4690  const struct rte_flow_indir_action_conf *conf,
4691  const struct rte_flow_action *action,
4692  struct rte_flow_error *error);
4693 
4716 __rte_experimental
4717 int
4718 rte_flow_action_handle_destroy(uint16_t port_id,
4719  struct rte_flow_action_handle *handle,
4720  struct rte_flow_error *error);
4721 
4755 __rte_experimental
4756 int
4757 rte_flow_action_handle_update(uint16_t port_id,
4758  struct rte_flow_action_handle *handle,
4759  const void *update,
4760  struct rte_flow_error *error);
4761 
4787 __rte_experimental
4788 int
4789 rte_flow_action_handle_query(uint16_t port_id,
4790  const struct rte_flow_action_handle *handle,
4791  void *data, struct rte_flow_error *error);
4792 
4793 /* Tunnel has a type and the key information. */
4794 struct rte_flow_tunnel {
4799  enum rte_flow_item_type type;
4800  uint64_t tun_id;
4802  RTE_STD_C11
4803  union {
4804  struct {
4807  } ipv4;
4808  struct {
4809  uint8_t src_addr[16];
4810  uint8_t dst_addr[16];
4811  } ipv6;
4812  };
4813  rte_be16_t tp_src;
4814  rte_be16_t tp_dst;
4815  uint16_t tun_flags;
4817  bool is_ipv6;
4823  uint8_t tos;
4824  uint8_t ttl;
4825  uint32_t label;
4826 };
4827 
4831 #define RTE_FLOW_RESTORE_INFO_TUNNEL RTE_BIT64(0)
4832 
4836 #define RTE_FLOW_RESTORE_INFO_ENCAPSULATED RTE_BIT64(1)
4837 
4841 #define RTE_FLOW_RESTORE_INFO_GROUP_ID RTE_BIT64(2)
4842 
4853  uint64_t flags;
4854  uint32_t group_id;
4855  struct rte_flow_tunnel tunnel;
4856 };
4857 
4881 __rte_experimental
4882 int
4883 rte_flow_tunnel_decap_set(uint16_t port_id,
4884  struct rte_flow_tunnel *tunnel,
4885  struct rte_flow_action **actions,
4886  uint32_t *num_of_actions,
4887  struct rte_flow_error *error);
4888 
4912 __rte_experimental
4913 int
4914 rte_flow_tunnel_match(uint16_t port_id,
4915  struct rte_flow_tunnel *tunnel,
4916  struct rte_flow_item **items,
4917  uint32_t *num_of_items,
4918  struct rte_flow_error *error);
4919 
4940 __rte_experimental
4941 int
4942 rte_flow_get_restore_info(uint16_t port_id,
4943  struct rte_mbuf *m,
4944  struct rte_flow_restore_info *info,
4945  struct rte_flow_error *error);
4946 
4963 __rte_experimental
4964 int
4965 rte_flow_tunnel_action_decap_release(uint16_t port_id,
4966  struct rte_flow_action *actions,
4967  uint32_t num_of_actions,
4968  struct rte_flow_error *error);
4969 
4986 __rte_experimental
4987 int
4988 rte_flow_tunnel_item_release(uint16_t port_id,
4989  struct rte_flow_item *items,
4990  uint32_t num_of_items,
4991  struct rte_flow_error *error);
4992 
5018 int
5019 rte_flow_pick_transfer_proxy(uint16_t port_id, uint16_t *proxy_port_id,
5020  struct rte_flow_error *error);
5021 
5040 __rte_experimental
5041 struct rte_flow_item_flex_handle *
5042 rte_flow_flex_item_create(uint16_t port_id,
5043  const struct rte_flow_item_flex_conf *conf,
5044  struct rte_flow_error *error);
5045 
5060 __rte_experimental
5061 int
5062 rte_flow_flex_item_release(uint16_t port_id,
5063  const struct rte_flow_item_flex_handle *handle,
5064  struct rte_flow_error *error);
5065 
5070 #define RTE_FLOW_PORT_FLAG_STRICT_QUEUE RTE_BIT32(0)
5071 
5084  uint32_t max_nb_queues;
5099  uint32_t max_nb_meters;
5109  uint32_t max_nb_quotas;
5114 };
5115 
5128  uint32_t max_size;
5129 };
5130 
5152 __rte_experimental
5153 int
5154 rte_flow_info_get(uint16_t port_id,
5155  struct rte_flow_port_info *port_info,
5156  struct rte_flow_queue_info *queue_info,
5157  struct rte_flow_error *error);
5158 
5164 #define RTE_FLOW_PORT_FLAG_SHARE_INDIRECT RTE_BIT32(0)
5165 
5179  uint32_t nb_counters;
5189  uint32_t nb_meters;
5194  uint32_t nb_conn_tracks;
5198  uint16_t host_port_id;
5203  uint32_t nb_quotas;
5207  uint32_t flags;
5208 };
5209 
5222  uint32_t size;
5223 };
5224 
5256 __rte_experimental
5257 int
5258 rte_flow_configure(uint16_t port_id,
5259  const struct rte_flow_port_attr *port_attr,
5260  uint16_t nb_queue,
5261  const struct rte_flow_queue_attr *queue_attr[],
5262  struct rte_flow_error *error);
5263 
5268 struct rte_flow_pattern_template;
5269 
5276 __extension__
5285  uint32_t relaxed_matching:1;
5291  uint32_t ingress:1;
5293  uint32_t egress:1;
5295  uint32_t transfer:1;
5296 };
5297 
5325 __rte_experimental
5326 struct rte_flow_pattern_template *
5327 rte_flow_pattern_template_create(uint16_t port_id,
5328  const struct rte_flow_pattern_template_attr *template_attr,
5329  const struct rte_flow_item pattern[],
5330  struct rte_flow_error *error);
5331 
5352 __rte_experimental
5353 int
5354 rte_flow_pattern_template_destroy(uint16_t port_id,
5355  struct rte_flow_pattern_template *pattern_template,
5356  struct rte_flow_error *error);
5357 
5362 struct rte_flow_actions_template;
5363 
5370 __extension__
5377  uint32_t ingress:1;
5379  uint32_t egress:1;
5381  uint32_t transfer:1;
5382 };
5383 
5419 __rte_experimental
5420 struct rte_flow_actions_template *
5421 rte_flow_actions_template_create(uint16_t port_id,
5422  const struct rte_flow_actions_template_attr *template_attr,
5423  const struct rte_flow_action actions[],
5424  const struct rte_flow_action masks[],
5425  struct rte_flow_error *error);
5426 
5447 __rte_experimental
5448 int
5449 rte_flow_actions_template_destroy(uint16_t port_id,
5450  struct rte_flow_actions_template *actions_template,
5451  struct rte_flow_error *error);
5452 
5457 struct rte_flow_template_table;
5458 
5472 #define RTE_FLOW_TABLE_SPECIALIZE_TRANSFER_WIRE_ORIG RTE_BIT32(0)
5473 
5480 #define RTE_FLOW_TABLE_SPECIALIZE_TRANSFER_VPORT_ORIG RTE_BIT32(1)
5481 
5498 };
5499 
5523 };
5524 
5535  struct rte_flow_attr flow_attr;
5539  uint32_t nb_flows;
5548  uint32_t specialize;
5552  enum rte_flow_table_insertion_type insertion_type;
5557 };
5558 
5591 __rte_experimental
5592 struct rte_flow_template_table *
5593 rte_flow_template_table_create(uint16_t port_id,
5594  const struct rte_flow_template_table_attr *table_attr,
5595  struct rte_flow_pattern_template *pattern_templates[],
5596  uint8_t nb_pattern_templates,
5597  struct rte_flow_actions_template *actions_templates[],
5598  uint8_t nb_actions_templates,
5599  struct rte_flow_error *error);
5600 
5621 __rte_experimental
5622 int
5623 rte_flow_template_table_destroy(uint16_t port_id,
5624  struct rte_flow_template_table *template_table,
5625  struct rte_flow_error *error);
5626 
5633 __extension__
5639  uint32_t postpone:1;
5640 };
5641 
5678 __rte_experimental
5679 struct rte_flow *
5680 rte_flow_async_create(uint16_t port_id,
5681  uint32_t queue_id,
5682  const struct rte_flow_op_attr *op_attr,
5683  struct rte_flow_template_table *template_table,
5684  const struct rte_flow_item pattern[],
5685  uint8_t pattern_template_index,
5686  const struct rte_flow_action actions[],
5687  uint8_t actions_template_index,
5688  void *user_data,
5689  struct rte_flow_error *error);
5690 
5723 __rte_experimental
5724 struct rte_flow *
5725 rte_flow_async_create_by_index(uint16_t port_id,
5726  uint32_t queue_id,
5727  const struct rte_flow_op_attr *op_attr,
5728  struct rte_flow_template_table *template_table,
5729  uint32_t rule_index,
5730  const struct rte_flow_action actions[],
5731  uint8_t actions_template_index,
5732  void *user_data,
5733  struct rte_flow_error *error);
5734 
5764 __rte_experimental
5765 int
5766 rte_flow_async_destroy(uint16_t port_id,
5767  uint32_t queue_id,
5768  const struct rte_flow_op_attr *op_attr,
5769  struct rte_flow *flow,
5770  void *user_data,
5771  struct rte_flow_error *error);
5772 
5793 __rte_experimental
5794 int
5795 rte_flow_push(uint16_t port_id,
5796  uint32_t queue_id,
5797  struct rte_flow_error *error);
5798 
5814 };
5815 
5822 __extension__
5827  enum rte_flow_op_status status;
5831  void *user_data;
5832 };
5833 
5859 __rte_experimental
5860 int
5861 rte_flow_pull(uint16_t port_id,
5862  uint32_t queue_id,
5863  struct rte_flow_op_result res[],
5864  uint16_t n_res,
5865  struct rte_flow_error *error);
5866 
5893 __rte_experimental
5894 struct rte_flow_action_handle *
5895 rte_flow_async_action_handle_create(uint16_t port_id,
5896  uint32_t queue_id,
5897  const struct rte_flow_op_attr *op_attr,
5898  const struct rte_flow_indir_action_conf *indir_action_conf,
5899  const struct rte_flow_action *action,
5900  void *user_data,
5901  struct rte_flow_error *error);
5902 
5928 __rte_experimental
5929 int
5930 rte_flow_async_action_handle_destroy(uint16_t port_id,
5931  uint32_t queue_id,
5932  const struct rte_flow_op_attr *op_attr,
5933  struct rte_flow_action_handle *action_handle,
5934  void *user_data,
5935  struct rte_flow_error *error);
5936 
5967 __rte_experimental
5968 int
5969 rte_flow_async_action_handle_update(uint16_t port_id,
5970  uint32_t queue_id,
5971  const struct rte_flow_op_attr *op_attr,
5972  struct rte_flow_action_handle *action_handle,
5973  const void *update,
5974  void *user_data,
5975  struct rte_flow_error *error);
5976 
6011 __rte_experimental
6012 int
6013 rte_flow_async_action_handle_query(uint16_t port_id,
6014  uint32_t queue_id,
6015  const struct rte_flow_op_attr *op_attr,
6016  const struct rte_flow_action_handle *action_handle,
6017  void *data,
6018  void *user_data,
6019  struct rte_flow_error *error);
6020 
6033 };
6034 
6068 __rte_experimental
6069 int
6070 rte_flow_action_handle_query_update(uint16_t port_id,
6071  struct rte_flow_action_handle *handle,
6072  const void *update, void *query,
6073  enum rte_flow_query_update_mode mode,
6074  struct rte_flow_error *error);
6075 
6111 __rte_experimental
6112 int
6113 rte_flow_async_action_handle_query_update(uint16_t port_id, uint32_t queue_id,
6114  const struct rte_flow_op_attr *attr,
6115  struct rte_flow_action_handle *handle,
6116  const void *update, void *query,
6117  enum rte_flow_query_update_mode mode,
6118  void *user_data,
6119  struct rte_flow_error *error);
6120 
6121 #ifdef __cplusplus
6122 }
6123 #endif
6124 
6125 #endif /* RTE_FLOW_H_ */
uint32_t reserved
Definition: rte_flow.h:128
static const struct rte_flow_item_icmp6_nd_opt_sla_eth rte_flow_item_icmp6_nd_opt_sla_eth_mask
Definition: rte_flow.h:1531
rte_be32_t u32
Definition: rte_ecpri.h:72
uint32_t nb_quotas
Definition: rte_flow.h:5203
uint8_t addr
Definition: rte_ppp.h:25
rte_flow_field_id
Definition: rte_flow.h:3739
rte_be16_t c_rsvd0_ver
Definition: rte_flow.h:1169
rte_be16_t ver_opt_len_o_c_rsvd0
Definition: rte_flow.h:1291
__rte_experimental int rte_flow_action_handle_update(uint16_t port_id, struct rte_flow_action_handle *handle, const void *update, struct rte_flow_error *error)
__rte_experimental int rte_flow_async_action_handle_query(uint16_t port_id, uint32_t queue_id, const struct rte_flow_op_attr *op_attr, const struct rte_flow_action_handle *action_handle, void *data, void *user_data, struct rte_flow_error *error)
uint32_t reserved
Definition: rte_flow.h:952
static const struct rte_flow_item_quota rte_flow_item_quota_mask
Definition: rte_flow.h:703
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)
uint32_t max_nb_aging_objects
Definition: rte_flow.h:5094
struct rte_ether_addr src_addr
Definition: rte_ether.h:269
struct rte_flow_action * actions
Definition: rte_flow.h:4035
static const struct rte_flow_item_icmp6_nd_na rte_flow_item_icmp6_nd_na_mask
Definition: rte_flow.h:1480
static const struct rte_flow_item_ipv6 rte_flow_item_ipv6_mask
Definition: rte_flow.h:957
rte_be16_t epcp_edei_in_ecid_b
Definition: rte_flow.h:1099
__rte_experimental int rte_flow_action_handle_query(uint16_t port_id, const struct rte_flow_action_handle *handle, void *data, struct rte_flow_error *error)
__rte_experimental struct rte_flow * rte_flow_async_create(uint16_t port_id, uint32_t queue_id, const struct rte_flow_op_attr *op_attr, struct rte_flow_template_table *template_table, const struct rte_flow_item pattern[], uint8_t pattern_template_index, const struct rte_flow_action actions[], uint8_t actions_template_index, void *user_data, struct rte_flow_error *error)
rte_be16_t protocol
Definition: rte_flow.h:1292
static const struct rte_flow_item_pfcp rte_flow_item_pfcp_mask
Definition: rte_flow.h:1802
uint32_t has_auth_ext
Definition: rte_flow.h:940
uint32_t nb_counters
Definition: rte_flow.h:5179
struct rte_ether_addr arp_sha
Definition: rte_arp.h:25
uint32_t num
Definition: rte_flow.h:742
__rte_experimental int rte_flow_async_destroy(uint16_t port_id, uint32_t queue_id, const struct rte_flow_op_attr *op_attr, struct rte_flow *flow, void *user_data, struct rte_flow_error *error)
struct rte_flow_attr * attr
Definition: rte_flow.h:4027
uint32_t has_mobil_ext
Definition: rte_flow.h:946
uint32_t sec_since_last_hit
Definition: rte_flow.h:3053
uint32_t rte_be32_t
__rte_experimental int rte_flow_action_handle_destroy(uint16_t port_id, struct rte_flow_action_handle *handle, struct rte_flow_error *error)
rte_flow_update_quota_op
Definition: rte_flow.h:2965
rte_flow_item_flex_tunnel_mode
Definition: rte_flow.h:2107
uint32_t original
Definition: rte_flow.h:3202
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)
struct rte_flow_item_flex_link * input_link
Definition: rte_flow.h:2208
uint32_t group
Definition: rte_flow.h:100
__rte_experimental int rte_flow_async_action_handle_destroy(uint16_t port_id, uint32_t queue_id, const struct rte_flow_op_attr *op_attr, struct rte_flow_action_handle *action_handle, void *user_data, struct rte_flow_error *error)
uint32_t nb_aging_objects
Definition: rte_flow.h:5184
struct rte_flow_item * definition
Definition: rte_flow.h:3352
uint32_t nb_meters
Definition: rte_flow.h:5189
static const struct rte_flow_item_gre rte_flow_item_gre_mask
Definition: rte_flow.h:1175
struct rte_flow_meter_profile * profile
Definition: rte_flow.h:3853
rte_be16_t msg_len
Definition: rte_flow.h:1249
__rte_experimental int rte_flow_template_table_destroy(uint16_t port_id, struct rte_flow_template_table *template_table, struct rte_flow_error *error)
struct rte_ether_addr dst_addr
Definition: rte_ether.h:274
static const struct rte_flow_item_gtp rte_flow_item_gtp_mask
Definition: rte_flow.h:1258
uint32_t postpone
Definition: rte_flow.h:5639
static const struct rte_flow_item_icmp rte_flow_item_icmp_mask
Definition: rte_flow.h:992
rte_be16_t flags_version
Definition: rte_l2tpv2.h:101
#define RTE_ETHER_ADDR_LEN
Definition: rte_ether.h:25
static const struct rte_flow_item_geneve rte_flow_item_geneve_mask
Definition: rte_flow.h:1299
const struct rte_flow_attr * attr_ro
Definition: rte_flow.h:4026
static const struct rte_flow_item_sctp rte_flow_item_sctp_mask
Definition: rte_flow.h:1049
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:747
__rte_experimental int rte_flow_action_handle_query_update(uint16_t port_id, struct rte_flow_action_handle *handle, const void *update, void *query, enum rte_flow_query_update_mode mode, struct rte_flow_error *error)
static const struct rte_flow_item_meta rte_flow_item_meta_mask
Definition: rte_flow.h:1578
static const struct rte_flow_item_esp rte_flow_item_esp_mask
Definition: rte_flow.h:1274
rte_flow_conntrack_state
Definition: rte_flow.h:3569
__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:987
__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:1247
struct rte_ether_addr tla
Definition: rte_flow.h:1550
rte_flow_item_flex_field_mode
Definition: rte_flow.h:2074
rte_be16_t protocol
Definition: rte_flow.h:1127
uint32_t reserved
Definition: rte_flow.h:798
rte_be32_t spi
Definition: rte_esp.h:24
static const struct rte_flow_item_meter_color rte_flow_item_meter_color_mask
Definition: rte_flow.h:2232
static const struct rte_flow_item_conntrack rte_flow_item_conntrack_mask
Definition: rte_flow.h:1938
static const struct rte_flow_item_geneve_opt rte_flow_item_geneve_opt_mask
Definition: rte_flow.h:1846
static const struct rte_flow_item_icmp6 rte_flow_item_icmp6_mask
Definition: rte_flow.h:1421
rte_be16_t src_port
Definition: rte_sctp.h:29
struct rte_flow_action * actions
Definition: rte_flow.h:4477
uint32_t nb_conn_tracks
Definition: rte_flow.h:5194
uint32_t max_nb_conn_tracks
Definition: rte_flow.h:5104
enum rte_color color
Definition: rte_flow.h:2227
struct rte_ipv4_hdr hdr
Definition: rte_flow.h:911
rte_be32_t teid
Definition: rte_gtp.h:54
static const struct rte_flow_item_mark rte_flow_item_mark_mask
Definition: rte_flow.h:1701
uint32_t reserved
Definition: rte_flow.h:3049
struct rte_flow_item_flex_field * sample_data
Definition: rte_flow.h:2198
rte_be32_t src_addr
Definition: rte_ip.h:63
static const struct rte_flow_item_icmp6_nd_opt rte_flow_item_icmp6_nd_opt_mask
Definition: rte_flow.h:1506
struct rte_gtp_hdr hdr
Definition: rte_flow.h:1252
static const struct rte_flow_item_vxlan rte_flow_item_vxlan_mask
Definition: rte_flow.h:1081
#define RTE_BIT32(nr)
Definition: rte_bitops.h:38
uint8_t src_addr[16]
Definition: rte_ip.h:540
static const struct rte_flow_item_port_id rte_flow_item_port_id_mask
Definition: rte_flow.h:772
struct rte_ether_addr dst_addr
Definition: rte_ether.h:268
static const struct rte_flow_item_higig2_hdr rte_flow_item_higig2_hdr_mask
Definition: rte_flow.h:720
static const struct rte_flow_item_nvgre rte_flow_item_nvgre_mask
Definition: rte_flow.h:1134
uint64_t rte_be64_t
uint8_t vni[3]
Definition: rte_vxlan.h:43
const void * mask
Definition: rte_flow.h:2047
struct rte_flow_item * pattern
Definition: rte_flow.h:4031
static const struct rte_flow_item_aggr_affinity rte_flow_item_aggr_affinity_mask
Definition: rte_flow.h:2258
__rte_experimental struct rte_flow * rte_flow_async_create_by_index(uint16_t port_id, uint32_t queue_id, const struct rte_flow_op_attr *op_attr, struct rte_flow_template_table *template_table, uint32_t rule_index, const struct rte_flow_action actions[], uint8_t actions_template_index, void *user_data, struct rte_flow_error *error)
rte_be16_t type
Definition: rte_flow.h:845
const void * cause
Definition: rte_flow.h:4011
__rte_experimental int rte_flow_async_action_handle_query_update(uint16_t port_id, uint32_t queue_id, const struct rte_flow_op_attr *attr, struct rte_flow_action_handle *handle, const void *update, void *query, enum rte_flow_query_update_mode mode, void *user_data, struct rte_flow_error *error)
__rte_experimental int rte_flow_async_action_handle_update(uint16_t port_id, uint32_t queue_id, const struct rte_flow_op_attr *op_attr, struct rte_flow_action_handle *action_handle, const void *update, void *user_data, struct rte_flow_error *error)
static const struct rte_flow_item_l2tpv2 rte_flow_item_l2tpv2_mask
Definition: rte_flow.h:1973
struct rte_l2tpv2_common_hdr common
Definition: rte_l2tpv2.h:223
static const struct rte_flow_item_udp rte_flow_item_udp_mask
Definition: rte_flow.h:1011
__rte_experimental int rte_flow_get_q_aged_flows(uint16_t port_id, uint32_t queue_id, void **contexts, uint32_t nb_contexts, struct rte_flow_error *error)
struct rte_esp_hdr hdr
Definition: rte_flow.h:1269
rte_flow_error_type
Definition: rte_flow.h:3977
uint32_t has_esp_ext
Definition: rte_flow.h:942
rte_flow_conv_op
Definition: rte_flow.h:4044
rte_be16_t src_port
Definition: rte_udp.h:29
uint32_t has_shim6_ext
Definition: rte_flow.h:950
__rte_experimental int rte_flow_dev_dump(uint16_t port_id, struct rte_flow *flow, FILE *file, struct rte_flow_error *error)
uint32_t max_nb_quotas
Definition: rte_flow.h:5109
uint32_t has_route_ext
Definition: rte_flow.h:936
__rte_experimental int rte_flow_actions_template_destroy(uint16_t port_id, struct rte_flow_actions_template *actions_template, struct rte_flow_error *error)
const uint8_t * pattern
Definition: rte_flow.h:802
uint32_t search
Definition: rte_flow.h:797
rte_be16_t rsvd_grp_ecid_b
Definition: rte_flow.h:1101
rte_flow_quota_state
Definition: rte_flow.h:685
static const struct rte_flow_item_raw rte_flow_item_raw_mask
Definition: rte_flow.h:807
uint16_t limit
Definition: rte_flow.h:800
rte_flow_conntrack_tcp_last_index
Definition: rte_flow.h:3587
__rte_experimental struct rte_flow_item_flex_handle * rte_flow_flex_item_create(uint16_t port_id, const struct rte_flow_item_flex_conf *conf, struct rte_flow_error *error)
struct rte_gtp_psc_generic_hdr hdr
Definition: rte_flow.h:1589
uint32_t max_nb_queues
Definition: rte_flow.h:5084
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:1154
static const struct rte_flow_item_icmp6_nd_ns rte_flow_item_icmp6_nd_ns_mask
Definition: rte_flow.h:1453
__rte_experimental struct rte_flow_action_handle * rte_flow_action_handle_create(uint16_t port_id, const struct rte_flow_indir_action_conf *conf, const struct rte_flow_action *action, struct rte_flow_error *error)
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 void * conf
Definition: rte_flow.h:3924
const char * message
Definition: rte_flow.h:4012
rte_eth_hash_function
Definition: rte_flow.h:3121
uint32_t close_initiated
Definition: rte_flow.h:3609
uint16_t length
Definition: rte_flow.h:801
const void * last
Definition: rte_flow.h:2046
static const struct rte_flow_item_icmp6_nd_opt_tla_eth rte_flow_item_icmp6_nd_opt_tla_eth_mask
Definition: rte_flow.h:1556
rte_be32_t teid
Definition: rte_flow.h:1250
int rte_flow_destroy(uint16_t port_id, struct rte_flow *flow, struct rte_flow_error *error)
uint32_t ingress
Definition: rte_flow.h:105
rte_be16_t tci
Definition: rte_flow.h:885
struct rte_arp_hdr hdr
Definition: rte_flow.h:1357
uint32_t max_nb_meters
Definition: rte_flow.h:5099
__rte_experimental struct rte_flow_action_handle * rte_flow_async_action_handle_create(uint16_t port_id, uint32_t queue_id, const struct rte_flow_op_attr *op_attr, const struct rte_flow_indir_action_conf *indir_action_conf, const struct rte_flow_action *action, void *user_data, struct rte_flow_error *error)
static const struct rte_flow_item_ipv4 rte_flow_item_ipv4_mask
Definition: rte_flow.h:916
size_t size
Definition: rte_flow.h:4474
rte_be16_t c_k_s_rsvd0_ver
Definition: rte_flow.h:1126
static const struct rte_flow_item_ppp rte_flow_item_ppp_mask
Definition: rte_flow.h:2001
const uint8_t * pattern
Definition: rte_flow.h:2069
static const struct rte_flow_item_gtp_psc rte_flow_item_gtp_psc_mask
Definition: rte_flow.h:1595
uint32_t supported_flags
Definition: rte_flow.h:5113
rte_flow_table_hash_func
Definition: rte_flow.h:5506
rte_be16_t length
Definition: rte_flow.h:1612
const struct rte_flow_action * actions_ro
Definition: rte_flow.h:4034
uint32_t has_vlan
Definition: rte_flow.h:849
uint32_t has_more_vlan
Definition: rte_flow.h:891
struct rte_flow_item * items
Definition: rte_flow.h:4476
__rte_experimental int rte_flow_get_aged_flows(uint16_t port_id, void **contexts, uint32_t nb_contexts, struct rte_flow_error *error)
uint32_t timeout_valid
Definition: rte_flow.h:3077
rte_flow_action_type
Definition: rte_flow.h:2289
struct rte_ether_addr sla
Definition: rte_flow.h:1525
rte_flow_query_update_mode
Definition: rte_flow.h:6030
rte_flow_quota_mode
Definition: rte_flow.h:2925
struct rte_flow_item_flex_link * output_link
Definition: rte_flow.h:2216
__rte_experimental struct rte_flow_template_table * rte_flow_template_table_create(uint16_t port_id, const struct rte_flow_template_table_attr *table_attr, struct rte_flow_pattern_template *pattern_templates[], uint8_t nb_pattern_templates, struct rte_flow_actions_template *actions_templates[], uint8_t nb_actions_templates, struct rte_flow_error *error)
rte_flow_modify_op
Definition: rte_flow.h:3816
uint32_t has_hop_ext
Definition: rte_flow.h:934
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)
rte_flow_table_insertion_type
Definition: rte_flow.h:5489
__rte_experimental int rte_flow_pattern_template_destroy(uint16_t port_id, struct rte_flow_pattern_template *pattern_template, struct rte_flow_error *error)
static const struct rte_flow_item_l2tpv3oip rte_flow_item_l2tpv3oip_mask
Definition: rte_flow.h:1671
rte_color
Definition: rte_meter.h:35
static const struct rte_flow_item_igmp rte_flow_item_igmp_mask
Definition: rte_flow.h:1756
const void * spec
Definition: rte_flow.h:2045
uint8_t label_tc_s[3]
Definition: rte_flow.h:1148
uint8_t version_type
Definition: rte_flow.h:1609
#define RTE_STD_C11
Definition: rte_common.h:39
__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:3181
static const struct rte_flow_item_arp_eth_ipv4 rte_flow_item_arp_eth_ipv4_mask
Definition: rte_flow.h:1364
uint32_t has_hip_ext
Definition: rte_flow.h:948
const struct rte_flow_action * actions
Definition: rte_flow.h:3968
__rte_experimental int rte_flow_flex_item_release(uint16_t port_id, const struct rte_flow_item_flex_handle *handle, struct rte_flow_error *error)
uint32_t sec_since_last_hit_valid
Definition: rte_flow.h:3052
rte_be16_t vlan_tci
Definition: rte_ether.h:285
static const struct rte_flow_item_eth rte_flow_item_eth_mask
Definition: rte_flow.h:855
rte_flow_op_status
Definition: rte_flow.h:5805
rte_be16_t src_port
Definition: rte_tcp.h:29
static const struct rte_flow_item_ethdev rte_flow_item_ethdev_mask
Definition: rte_flow.h:1954
__rte_experimental int rte_flow_info_get(uint16_t port_id, struct rte_flow_port_info *port_info, struct rte_flow_queue_info *queue_info, struct rte_flow_error *error)
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:938
uint32_t reserved
Definition: rte_flow.h:3203
__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:1780
static const struct rte_flow_item_tag rte_flow_item_tag_mask
Definition: rte_flow.h:1654
uint32_t priority
Definition: rte_flow.h:101
uint32_t has_dest_ext
Definition: rte_flow.h:944
static const struct rte_flow_item_ipv6_ext rte_flow_item_ipv6_ext_mask
Definition: rte_flow.h:1389
uint32_t max_nb_counters
Definition: rte_flow.h:5089
struct rte_ipv6_hdr hdr
Definition: rte_flow.h:932
static const struct rte_flow_item_ecpri rte_flow_item_ecpri_mask
Definition: rte_flow.h:1822
__rte_experimental struct rte_flow_actions_template * rte_flow_actions_template_create(uint16_t port_id, const struct rte_flow_actions_template_attr *template_attr, const struct rte_flow_action actions[], const struct rte_flow_action masks[], struct rte_flow_error *error)
rte_be16_t protocol
Definition: rte_flow.h:1170
uint32_t queue_num
Definition: rte_flow.h:3180
uint8_t tni[3]
Definition: rte_flow.h:1128
struct rte_tcp_hdr hdr
Definition: rte_flow.h:1025
static const struct rte_flow_item_pppoe_proto_id rte_flow_item_pppoe_proto_id_mask
Definition: rte_flow.h:1634
uint32_t transfer
Definition: rte_flow.h:127
struct rte_flow_item * definition
Definition: rte_flow.h:3386
static const struct rte_flow_item_vlan rte_flow_item_vlan_mask
Definition: rte_flow.h:897
uint8_t msg_type
Definition: rte_flow.h:1248
uint32_t reserved
Definition: rte_flow.h:892
uint32_t egress
Definition: rte_flow.h:109
static const struct rte_flow_item_e_tag rte_flow_item_e_tag_mask
Definition: rte_flow.h:1109
static __rte_experimental int rte_flow_dynf_metadata_avail(void)
Definition: rte_flow.h:4216
__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)
uint16_t host_port_id
Definition: rte_flow.h:5198
__rte_experimental struct rte_flow_pattern_template * rte_flow_pattern_template_create(uint16_t port_id, const struct rte_flow_pattern_template_attr *template_attr, const struct rte_flow_item pattern[], struct rte_flow_error *error)
static const struct rte_flow_item_tcp rte_flow_item_tcp_mask
Definition: rte_flow.h:1030
static const struct rte_flow_item_fuzzy rte_flow_item_fuzzy_mask
Definition: rte_flow.h:1223
uint8_t addr_bytes[RTE_ETHER_ADDR_LEN]
Definition: rte_ether.h:61
rte_be16_t inner_type
Definition: rte_flow.h:886
uint8_t vni[3]
Definition: rte_vxlan.h:72
__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:1006
__rte_experimental int rte_flow_configure(uint16_t port_id, const struct rte_flow_port_attr *port_attr, uint16_t nb_queue, const struct rte_flow_queue_attr *queue_attr[], struct rte_flow_error *error)
const uint16_t * queue
Definition: rte_flow.h:3182
rte_flow_item_type
Definition: rte_flow.h:147
__rte_experimental int rte_flow_pull(uint16_t port_id, uint32_t queue_id, struct rte_flow_op_result res[], uint16_t n_res, struct rte_flow_error *error)
uint32_t relative
Definition: rte_flow.h:796
int32_t offset
Definition: rte_flow.h:799
rte_be16_t inner_type
Definition: rte_flow.h:1104
__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)
struct rte_flow_item_flex_handle * handle
Definition: rte_flow.h:2067
const struct rte_flow_item * pattern_ro
Definition: rte_flow.h:4030
static const struct rte_flow_item_vxlan_gpe rte_flow_item_vxlan_gpe_mask
Definition: rte_flow.h:1329
rte_be16_t session_id
Definition: rte_flow.h:1611
static const struct rte_flow_item_nsh rte_flow_item_nsh_mask
Definition: rte_flow.h:1730
__rte_experimental int rte_flow_push(uint16_t port_id, uint32_t queue_id, struct rte_flow_error *error)
int rte_flow_pick_transfer_proxy(uint16_t port_id, uint16_t *proxy_port_id, struct rte_flow_error *error)
struct rte_sctp_hdr hdr
Definition: rte_flow.h:1044
uint32_t reserved
Definition: rte_flow.h:850