rte_flow.h(3)

💖 rte_flow.h 💖 — the rte_flow.h(3) manual page, bestie edition

okay so. bestie. sit down. we're doing rte_flow.h — this is the DPDK generic flow API header, and it is, no exaggeration, one of the longest, most iconic, most everything header files in the whole library. full .h(3) manual page energy. it's giving ✨legendary✨. and because it's so huge, we're doing it in 16 parts, and this right here is part 1. buckle up, we're not even at the fun stuff yet. 💅


✨ SYNOPSIS ✨

first things first, the vibe check: all the headers you gotta drag in before ANY of this works. take notes, because if you forget one of these your build is gonna cry and you're gonna cry. 😭

#include <stddef.h>
#include <stdint.h>
#include <rte_compat.h>
#include <rte_common.h>
#include <rte_ether.h>
#include <rte_arp.h>
#include <rte_icmp.h>
#include <rte_ip.h>
#include <rte_sctp.h>
#include <rte_tcp.h>
#include <rte_udp.h>
#include <rte_vxlan.h>
#include <rte_esp.h>
#include <rte_higig.h>
#include <rte_ecpri.h>
#include <rte_bitops.h>
#include <rte_mbuf_dyn.h>
#include <rte_meter.h>
#include <rte_gtp.h>
#include <rte_l2tpv2.h>
#include <rte_ppp.h>
#include <rte_gre.h>
#include <rte_macsec.h>
#include <rte_ib.h>
#include 'rte_ethdev.h'
fr fr note the last one — #include 'rte_ethdev.h' — that's single quotes, bestie. that is exactly how it's written in the page, character for character, and we do not touch it. 🫶

🎀 Data Structures 🎀

the way that this list is, like, a mile long?? this is the cast of characters, the dramatis personae, the whole friend group. every single struct, in order, no cuts, no skips. 🔥

  • struct rte_flow_attr
  • struct rte_flow_item_quota
  • struct rte_flow_item_higig2_hdr
  • struct rte_flow_item_any
  • struct rte_flow_item_port_id
  • struct rte_flow_item_raw
  • struct rte_flow_item_eth
  • struct rte_flow_item_vlan
  • struct rte_flow_item_ipv4
  • struct rte_flow_item_ipv6
  • struct rte_flow_item_ipv6_routing_ext
  • struct rte_flow_item_icmp
  • struct rte_flow_item_udp
  • struct rte_flow_item_tcp
  • struct rte_flow_item_sctp
  • struct rte_flow_item_vxlan
  • struct rte_flow_item_e_tag
  • struct rte_flow_item_nvgre
  • struct rte_flow_item_mpls
  • struct rte_flow_item_gre
  • struct rte_flow_item_gre_opt
  • struct rte_flow_item_macsec
  • struct rte_flow_item_fuzzy
  • struct rte_flow_item_gtp
  • struct rte_flow_item_esp
  • struct rte_flow_item_geneve
  • struct rte_flow_item_vxlan_gpe
  • struct rte_flow_item_arp_eth_ipv4
  • struct rte_flow_item_ipv6_ext
  • struct rte_flow_item_ipv6_frag_ext
  • struct rte_flow_item_icmp6
  • struct rte_flow_item_icmp6_echo
  • struct rte_flow_item_icmp6_nd_ns
  • struct rte_flow_item_icmp6_nd_na
  • struct rte_flow_item_icmp6_nd_opt
  • struct rte_flow_item_icmp6_nd_opt_sla_eth
  • struct rte_flow_item_icmp6_nd_opt_tla_eth
  • struct rte_flow_item_meta
  • struct rte_flow_item_gtp_psc
  • struct rte_flow_item_pppoe
  • struct rte_flow_item_pppoe_proto_id
  • struct rte_flow_item_tag
  • struct rte_flow_item_l2tpv3oip
  • struct rte_flow_item_mark
  • struct rte_flow_item_nsh
  • struct rte_flow_item_igmp
  • struct rte_flow_item_ah
  • struct rte_flow_item_pfcp
  • struct rte_flow_item_ecpri
  • struct rte_flow_item_geneve_opt
  • struct rte_flow_item_integrity
  • struct rte_flow_item_conntrack
  • struct rte_flow_item_ethdev
  • struct rte_flow_item_l2tpv2
  • struct rte_flow_item_ppp
  • struct rte_flow_item_ib_bth
  • struct rte_flow_item_random
  • struct rte_flow_item
  • struct rte_flow_item_flex
  • struct rte_flow_item_flex_field
  • struct rte_flow_item_flex_link
  • struct rte_flow_item_flex_conf
  • struct rte_flow_item_meter_color
  • struct rte_flow_item_aggr_affinity
  • struct rte_flow_item_tx_queue
  • struct rte_flow_item_ptype
  • struct rte_flow_field_data
  • struct rte_flow_item_compare
  • struct rte_flow_action_quota
  • struct rte_flow_query_quota
  • struct rte_flow_update_quota
  • struct rte_flow_action_mark
  • struct rte_flow_action_jump
  • struct rte_flow_action_queue
  • struct rte_flow_action_age
  • struct rte_flow_query_age
  • struct rte_flow_update_age
  • struct rte_flow_action_count
  • struct rte_flow_query_count
  • struct rte_flow_action_rss
  • struct rte_flow_action_vf
  • struct rte_flow_action_port_id
  • struct rte_flow_action_meter
  • struct rte_flow_action_security
  • struct rte_flow_action_nat64
  • struct rte_flow_action_of_push_vlan
  • struct rte_flow_action_of_set_vlan_vid
  • struct rte_flow_action_of_set_vlan_pcp
  • struct rte_flow_action_of_pop_mpls
  • struct rte_flow_action_of_push_mpls
  • struct rte_flow_action_vxlan_encap
  • struct rte_flow_action_nvgre_encap
  • struct rte_flow_action_raw_encap
  • struct rte_flow_action_raw_decap
  • struct rte_flow_action_set_ipv4
  • struct rte_flow_action_set_ipv6
  • struct rte_flow_action_ipv6_ext_push
  • struct rte_flow_action_ipv6_ext_remove
  • struct rte_flow_action_set_tp
  • struct rte_flow_action_set_ttl
  • struct rte_flow_action_set_mac
  • struct rte_flow_action_set_tag
  • struct rte_flow_action_set_meta
  • struct rte_flow_action_set_dscp
  • struct rte_flow_tcp_dir_param
  • struct rte_flow_action_conntrack
  • struct rte_flow_modify_conntrack
  • struct rte_flow_action_meter_color
  • struct rte_flow_action_ethdev
  • struct rte_flow_action_modify_field
  • struct rte_flow_action_meter_mark
  • struct rte_flow_update_meter_mark
  • struct rte_flow_indirect_update_flow_meter_mark
  • struct rte_flow_action_prog_argument
  • struct rte_flow_action_prog
  • struct rte_flow_action_jump_to_table_index
  • struct rte_flow_action
  • struct rte_flow_action_sample
  • struct rte_flow_error
  • struct rte_flow_conv_rule
  • struct rte_flow_desc
  • struct rte_flow_indir_action_conf
  • struct rte_flow_restore_info
  • struct rte_flow_port_info
  • struct rte_flow_queue_info
  • struct rte_flow_port_attr
  • struct rte_flow_queue_attr
  • struct rte_flow_pattern_template_attr
  • struct rte_flow_actions_template_attr
  • struct rte_flow_template_table_attr
  • struct rte_flow_op_attr
  • struct rte_flow_op_result
  • struct rte_flow_action_indirect_list

🌈 Macros 🌈

and now the macros!! first the conntrack packet-state bits, then the restore-info bits, then the port flags. these are all bit flags, so they're made with RTE_BIT32 and RTE_BIT64 — that's the bitops girlies showing up. 🦋

#define RTE_FLOW_CONNTRACK_PKT_STATE_VALID   RTE_BIT32(0)
#define RTE_FLOW_CONNTRACK_PKT_STATE_CHANGED   RTE_BIT32(1)
#define RTE_FLOW_CONNTRACK_PKT_STATE_INVALID   RTE_BIT32(2)
#define RTE_FLOW_CONNTRACK_PKT_STATE_DISABLED   RTE_BIT32(3)
#define RTE_FLOW_CONNTRACK_PKT_STATE_BAD   RTE_BIT32(4)
#define RTE_FLOW_RESTORE_INFO_TUNNEL   RTE_BIT64(0)
#define RTE_FLOW_RESTORE_INFO_ENCAPSULATED   RTE_BIT64(1)
#define RTE_FLOW_RESTORE_INFO_GROUP_ID   RTE_BIT64(2)
#define RTE_FLOW_PORT_FLAG_STRICT_QUEUE   RTE_BIT32(0)
#define RTE_FLOW_PORT_FLAG_SHARE_INDIRECT   RTE_BIT32(1)

✨ Flags for template table attribute ✨

okay so these are hints, and that word is doing a LOT of work here, so listen close bestie:

every single bit is an optional hint for table specialisation — it's a lil nudge that might unlock an optimisation down at the driver layer. that's it. that's the whole offer. 💅

the driver is fully allowed to just silently ignore these hints, and that is not a bug, that is the contract. no drama, no error, it just does its own thing.

and the big one: these hints do not replace any matching criteria. they are not filters, they are not match rules, they do not do the matching for you. do not come for the hints expecting them to do the matching's job. 🙈

#define RTE_FLOW_TABLE_SPECIALIZE_TRANSFER_WIRE_ORIG   RTE_BIT32(0)
#define RTE_FLOW_TABLE_SPECIALIZE_TRANSFER_VPORT_ORIG   RTE_BIT32(1)
#define RTE_FLOW_TABLE_SPECIALIZE_RESIZABLE   RTE_BIT32(2)

🫶 and that's part 1, bestie!! not signing off because there is so much more where this came from — more parts are coming, and they are highkey going to be a whole journey. ✨

🦋 Enumerations 🦋

okay bestie, take a seat, hydrate, because this header is enumerations all the way down. like, rte_flow.h looked at a single enum and said "no 💀, we're doing twenty of them". every one of these is basically a little menu of values, and you're gonna meet them again all over this page. no skimming, no scrolling past, we're doing all of them together 💖


  • enum rte_flow_item_type — THE main character. the master menu of item types, aka everything a match pattern can be built out of. ✨
enum rte_flow_item_type { RTE_FLOW_ITEM_TYPE_END,
    RTE_FLOW_ITEM_TYPE_VOID, RTE_FLOW_ITEM_TYPE_INVERT,
    RTE_FLOW_ITEM_TYPE_ANY, RTE_FLOW_ITEM_TYPE_PORT_ID,
    RTE_FLOW_ITEM_TYPE_RAW, RTE_FLOW_ITEM_TYPE_ETH,
    RTE_FLOW_ITEM_TYPE_VLAN, RTE_FLOW_ITEM_TYPE_IPV4,
    RTE_FLOW_ITEM_TYPE_IPV6, RTE_FLOW_ITEM_TYPE_ICMP,
    RTE_FLOW_ITEM_TYPE_UDP, RTE_FLOW_ITEM_TYPE_TCP,
    RTE_FLOW_ITEM_TYPE_SCTP, RTE_FLOW_ITEM_TYPE_VXLAN,
    RTE_FLOW_ITEM_TYPE_E_TAG, RTE_FLOW_ITEM_TYPE_NVGRE,
    RTE_FLOW_ITEM_TYPE_MPLS, RTE_FLOW_ITEM_TYPE_GRE,
    RTE_FLOW_ITEM_TYPE_FUZZY, RTE_FLOW_ITEM_TYPE_GTP,
    RTE_FLOW_ITEM_TYPE_GTPC, RTE_FLOW_ITEM_TYPE_GTPU,
    RTE_FLOW_ITEM_TYPE_ESP, RTE_FLOW_ITEM_TYPE_GENEVE,
    RTE_FLOW_ITEM_TYPE_VXLAN_GPE, RTE_FLOW_ITEM_TYPE_ARP_ETH_IPV4,
    RTE_FLOW_ITEM_TYPE_IPV6_EXT, RTE_FLOW_ITEM_TYPE_ICMP6,
    RTE_FLOW_ITEM_TYPE_ICMP6_ND_NS, RTE_FLOW_ITEM_TYPE_ICMP6_ND_NA,
    RTE_FLOW_ITEM_TYPE_ICMP6_ND_OPT,
    RTE_FLOW_ITEM_TYPE_ICMP6_ND_OPT_SLA_ETH,
    RTE_FLOW_ITEM_TYPE_ICMP6_ND_OPT_TLA_ETH, RTE_FLOW_ITEM_TYPE_MARK,
    RTE_FLOW_ITEM_TYPE_META, RTE_FLOW_ITEM_TYPE_GRE_KEY,
    RTE_FLOW_ITEM_TYPE_GTP_PSC, RTE_FLOW_ITEM_TYPE_PPPOES,
    RTE_FLOW_ITEM_TYPE_PPPOED, RTE_FLOW_ITEM_TYPE_PPPOE_PROTO_ID,
    RTE_FLOW_ITEM_TYPE_NSH, RTE_FLOW_ITEM_TYPE_IGMP,
    RTE_FLOW_ITEM_TYPE_AH, RTE_FLOW_ITEM_TYPE_HIGIG2,
    RTE_FLOW_ITEM_TYPE_TAG, RTE_FLOW_ITEM_TYPE_L2TPV3OIP,
    RTE_FLOW_ITEM_TYPE_PFCP, RTE_FLOW_ITEM_TYPE_ECPRI,
    RTE_FLOW_ITEM_TYPE_IPV6_FRAG_EXT, RTE_FLOW_ITEM_TYPE_GENEVE_OPT,
    RTE_FLOW_ITEM_TYPE_INTEGRITY, RTE_FLOW_ITEM_TYPE_CONNTRACK,
    RTE_FLOW_ITEM_TYPE_PORT_REPRESENTOR,
    RTE_FLOW_ITEM_TYPE_REPRESENTED_PORT, RTE_FLOW_ITEM_TYPE_FLEX,
    RTE_FLOW_ITEM_TYPE_L2TPV2, RTE_FLOW_ITEM_TYPE_PPP,
    RTE_FLOW_ITEM_TYPE_GRE_OPTION, RTE_FLOW_ITEM_TYPE_MACSEC,
    RTE_FLOW_ITEM_TYPE_METER_COLOR, RTE_FLOW_ITEM_TYPE_IPV6_ROUTING_EXT,
    RTE_FLOW_ITEM_TYPE_ICMP6_ECHO_REQUEST,
    RTE_FLOW_ITEM_TYPE_ICMP6_ECHO_REPLY, RTE_FLOW_ITEM_TYPE_QUOTA,
    RTE_FLOW_ITEM_TYPE_AGGR_AFFINITY, RTE_FLOW_ITEM_TYPE_TX_QUEUE,
    RTE_FLOW_ITEM_TYPE_IB_BTH, RTE_FLOW_ITEM_TYPE_PTYPE,
    RTE_FLOW_ITEM_TYPE_RANDOM, RTE_FLOW_ITEM_TYPE_COMPARE }

like… that list is long. no notes. slay. 🫶

  • enum rte_flow_quota_state — two moods only: PASS or BLOCK. that's it, that's the whole personality. 🎀
enum rte_flow_quota_state { RTE_FLOW_QUOTA_STATE_PASS,
    RTE_FLOW_QUOTA_STATE_BLOCK }
  • enum rte_flow_item_flex_field_mode — how a flex item's field gets interpreted. <purple>FIELD_MODE_DUMMY</purple> is literally assigned 0, and then FIELD_MODE_FIXED, FIELD_MODE_OFFSET and FIELD_MODE_BITMASK follow along. also, iconically, FIELD_MODE_DUMMY said "i'm the default" and we respect that. 💅
enum rte_flow_item_flex_field_mode { FIELD_MODE_DUMMY = 0,
    FIELD_MODE_FIXED, FIELD_MODE_OFFSET, FIELD_MODE_BITMASK }
  • enum rte_flow_item_flex_tunnel_mode — the tunnel vibes for flex items. FLEX_TUNNEL_MODE_SINGLE = 0 starts the party, then FLEX_TUNNEL_MODE_OUTER, FLEX_TUNNEL_MODE_INNER, FLEX_TUNNEL_MODE_MULTI and FLEX_TUNNEL_MODE_TUNNEL. nested energy fr fr. 🌈
enum rte_flow_item_flex_tunnel_mode { FLEX_TUNNEL_MODE_SINGLE = 0,
    FLEX_TUNNEL_MODE_OUTER, FLEX_TUNNEL_MODE_INNER,
    FLEX_TUNNEL_MODE_MULTI, FLEX_TUNNEL_MODE_TUNNEL }
  • enum rte_flow_field_id — the big directory of fields. like all of them. every field you could possibly name from START = 0 onwards. this enum is the reason your scroll wheel is tired. genuinely obsessed. 😭
enum rte_flow_field_id { RTE_FLOW_FIELD_START = 0,
    RTE_FLOW_FIELD_MAC_DST, RTE_FLOW_FIELD_MAC_SRC,
    RTE_FLOW_FIELD_VLAN_TYPE, RTE_FLOW_FIELD_VLAN_ID,
    RTE_FLOW_FIELD_MAC_TYPE, RTE_FLOW_FIELD_IPV4_DSCP,
    RTE_FLOW_FIELD_IPV4_TTL, RTE_FLOW_FIELD_IPV4_SRC,
    RTE_FLOW_FIELD_IPV4_DST, RTE_FLOW_FIELD_IPV6_DSCP,
    RTE_FLOW_FIELD_IPV6_HOPLIMIT, RTE_FLOW_FIELD_IPV6_SRC,
    RTE_FLOW_FIELD_IPV6_DST, RTE_FLOW_FIELD_TCP_PORT_SRC,
    RTE_FLOW_FIELD_TCP_PORT_DST, RTE_FLOW_FIELD_TCP_SEQ_NUM,
    RTE_FLOW_FIELD_TCP_ACK_NUM, RTE_FLOW_FIELD_TCP_FLAGS,
    RTE_FLOW_FIELD_UDP_PORT_SRC, RTE_FLOW_FIELD_UDP_PORT_DST,
    RTE_FLOW_FIELD_VXLAN_VNI, RTE_FLOW_FIELD_GENEVE_VNI,
    RTE_FLOW_FIELD_GTP_TEID, RTE_FLOW_FIELD_TAG, RTE_FLOW_FIELD_MARK,
    RTE_FLOW_FIELD_META, RTE_FLOW_FIELD_POINTER, RTE_FLOW_FIELD_VALUE,
    RTE_FLOW_FIELD_IPV4_ECN, RTE_FLOW_FIELD_IPV6_ECN,
    RTE_FLOW_FIELD_GTP_PSC_QFI, RTE_FLOW_FIELD_METER_COLOR,
    RTE_FLOW_FIELD_IPV6_PROTO, RTE_FLOW_FIELD_FLEX_ITEM,
    RTE_FLOW_FIELD_HASH_RESULT, RTE_FLOW_FIELD_GENEVE_OPT_TYPE,
    RTE_FLOW_FIELD_GENEVE_OPT_CLASS, RTE_FLOW_FIELD_GENEVE_OPT_DATA,
    RTE_FLOW_FIELD_MPLS, RTE_FLOW_FIELD_TCP_DATA_OFFSET,
    RTE_FLOW_FIELD_IPV4_IHL, RTE_FLOW_FIELD_IPV4_TOTAL_LEN,
    RTE_FLOW_FIELD_IPV6_PAYLOAD_LEN, RTE_FLOW_FIELD_IPV4_PROTO,
    RTE_FLOW_FIELD_IPV6_FLOW_LABEL, RTE_FLOW_FIELD_IPV6_TRAFFIC_CLASS,
    RTE_FLOW_FIELD_ESP_SPI, RTE_FLOW_FIELD_ESP_SEQ_NUM,
    RTE_FLOW_FIELD_ESP_PROTO, RTE_FLOW_FIELD_RANDOM,
    RTE_FLOW_FIELD_VXLAN_LAST_RSVD }
  • enum rte_flow_item_compare_op — and that's literally all this page gives us for it. no values listed, just the name, sitting there with main character energy and nothing to say. 🙈
enum rte_flow_item_compare_op
  • enum rte_flow_action_type — the sibling of the item list, except it's the master menu of action types. it's giving "we matched on something, now what do we DO about it". equally enormous. equally iconic. 👑
enum rte_flow_action_type { RTE_FLOW_ACTION_TYPE_END,
    RTE_FLOW_ACTION_TYPE_VOID, RTE_FLOW_ACTION_TYPE_PASSTHRU,
    RTE_FLOW_ACTION_TYPE_JUMP, RTE_FLOW_ACTION_TYPE_MARK,
    RTE_FLOW_ACTION_TYPE_FLAG, RTE_FLOW_ACTION_TYPE_QUEUE,
    RTE_FLOW_ACTION_TYPE_DROP, RTE_FLOW_ACTION_TYPE_COUNT,
    RTE_FLOW_ACTION_TYPE_RSS, RTE_FLOW_ACTION_TYPE_PF,
    RTE_FLOW_ACTION_TYPE_VF, RTE_FLOW_ACTION_TYPE_PORT_ID,
    RTE_FLOW_ACTION_TYPE_METER, RTE_FLOW_ACTION_TYPE_SECURITY,
    RTE_FLOW_ACTION_TYPE_OF_DEC_NW_TTL,
    RTE_FLOW_ACTION_TYPE_OF_POP_VLAN, RTE_FLOW_ACTION_TYPE_OF_PUSH_VLAN,
    RTE_FLOW_ACTION_TYPE_OF_SET_VLAN_VID,
    RTE_FLOW_ACTION_TYPE_OF_SET_VLAN_PCP,
    RTE_FLOW_ACTION_TYPE_OF_POP_MPLS, RTE_FLOW_ACTION_TYPE_OF_PUSH_MPLS,
    RTE_FLOW_ACTION_TYPE_VXLAN_ENCAP, RTE_FLOW_ACTION_TYPE_VXLAN_DECAP,
    RTE_FLOW_ACTION_TYPE_NVGRE_ENCAP, RTE_FLOW_ACTION_TYPE_NVGRE_DECAP,
    RTE_FLOW_ACTION_TYPE_RAW_ENCAP, RTE_FLOW_ACTION_TYPE_RAW_DECAP,
    RTE_FLOW_ACTION_TYPE_SET_IPV4_SRC,
    RTE_FLOW_ACTION_TYPE_SET_IPV4_DST,
    RTE_FLOW_ACTION_TYPE_SET_IPV6_SRC,
    RTE_FLOW_ACTION_TYPE_SET_IPV6_DST, RTE_FLOW_ACTION_TYPE_SET_TP_SRC,
    RTE_FLOW_ACTION_TYPE_SET_TP_DST, RTE_FLOW_ACTION_TYPE_MAC_SWAP,
    RTE_FLOW_ACTION_TYPE_DEC_TTL, RTE_FLOW_ACTION_TYPE_SET_TTL,
    RTE_FLOW_ACTION_TYPE_SET_MAC_SRC, RTE_FLOW_ACTION_TYPE_SET_MAC_DST,
    RTE_FLOW_ACTION_TYPE_INC_TCP_SEQ, RTE_FLOW_ACTION_TYPE_DEC_TCP_SEQ,
    RTE_FLOW_ACTION_TYPE_INC_TCP_ACK, RTE_FLOW_ACTION_TYPE_DEC_TCP_ACK,
    RTE_FLOW_ACTION_TYPE_SET_TAG, RTE_FLOW_ACTION_TYPE_SET_META,
    RTE_FLOW_ACTION_TYPE_SET_IPV4_DSCP,
    RTE_FLOW_ACTION_TYPE_SET_IPV6_DSCP, RTE_FLOW_ACTION_TYPE_AGE,
    RTE_FLOW_ACTION_TYPE_SAMPLE, RTE_FLOW_ACTION_TYPE_SHARED,
    RTE_FLOW_ACTION_TYPE_MODIFY_FIELD, RTE_FLOW_ACTION_TYPE_INDIRECT,
    RTE_FLOW_ACTION_TYPE_CONNTRACK, RTE_FLOW_ACTION_TYPE_METER_COLOR,
    RTE_FLOW_ACTION_TYPE_PORT_REPRESENTOR,
    RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT,
    RTE_FLOW_ACTION_TYPE_METER_MARK,
    RTE_FLOW_ACTION_TYPE_SEND_TO_KERNEL, RTE_FLOW_ACTION_TYPE_QUOTA,
    RTE_FLOW_ACTION_TYPE_SKIP_CMAN, RTE_FLOW_ACTION_TYPE_IPV6_EXT_PUSH,
    RTE_FLOW_ACTION_TYPE_IPV6_EXT_REMOVE,
    RTE_FLOW_ACTION_TYPE_INDIRECT_LIST, RTE_FLOW_ACTION_TYPE_PROG,
    RTE_FLOW_ACTION_TYPE_NAT64, RTE_FLOW_ACTION_TYPE_JUMP_TO_TABLE_INDEX
    }
  • enum rte_flow_quota_mode — quota modes, and the numbering is very deliberate here: RTE_FLOW_QUOTA_MODE_PACKET = 1, RTE_FLOW_QUOTA_MODE_L2 = 2, RTE_FLOW_QUOTA_MODE_L3 = 3. yes, it starts at 1. no, that's not a typo. 🍓
enum rte_flow_quota_mode { RTE_FLOW_QUOTA_MODE_PACKET = 1,
    RTE_FLOW_QUOTA_MODE_L2 = 2, RTE_FLOW_QUOTA_MODE_L3 = 3 }
  • enum rte_flow_update_quota_op — the two ways to update a quota: RTE_FLOW_UPDATE_QUOTA_SET and RTE_FLOW_UPDATE_QUOTA_ADD. set it or add to it. be the change. ✨
enum rte_flow_update_quota_op { RTE_FLOW_UPDATE_QUOTA_SET,
    RTE_FLOW_UPDATE_QUOTA_ADD }
  • enum rte_flow_nat64_type — NAT64 directions, and the values are Explicit with a capital E: RTE_FLOW_NAT64_6TO4 = 0 and RTE_FLOW_NAT64_4TO6 = 1. 🦋
enum rte_flow_nat64_type { RTE_FLOW_NAT64_6TO4 = 0, RTE_FLOW_NAT64_4TO6
    = 1 }
  • enum rte_flow_conntrack_state — the conntrack states, and honestly it's a whole situationship timeline: RTE_FLOW_CONNTRACK_STATE_SYN_RECV, RTE_FLOW_CONNTRACK_STATE_ESTABLISHED, RTE_FLOW_CONNTRACK_STATE_FIN_WAIT, RTE_FLOW_CONNTRACK_STATE_CLOSE_WAIT, RTE_FLOW_CONNTRACK_STATE_LAST_ACK, RTE_FLOW_CONNTRACK_STATE_TIME_WAIT. the arc is real. 😭
enum rte_flow_conntrack_state { RTE_FLOW_CONNTRACK_STATE_SYN_RECV,
    RTE_FLOW_CONNTRACK_STATE_ESTABLISHED,
    RTE_FLOW_CONNTRACK_STATE_FIN_WAIT,
    RTE_FLOW_CONNTRACK_STATE_CLOSE_WAIT,
    RTE_FLOW_CONNTRACK_STATE_LAST_ACK,
    RTE_FLOW_CONNTRACK_STATE_TIME_WAIT }
  • enum rte_flow_conntrack_tcp_last_index — flag bits, and these are built with RTE_BIT32, so RTE_FLOW_CONNTRACK_FLAG_NONE = 0, RTE_FLOW_CONNTRACK_FLAG_SYN = RTE_BIT32(0), RTE_FLOW_CONNTRACK_FLAG_SYNACK = RTE_BIT32(1), RTE_FLOW_CONNTRACK_FLAG_FIN = RTE_BIT32(2), RTE_FLOW_CONNTRACK_FLAG_ACK = RTE_BIT32(3), RTE_FLOW_CONNTRACK_FLAG_RST = RTE_BIT32(4). bit math bestie, we love to see it. 💜
enum rte_flow_conntrack_tcp_last_index { RTE_FLOW_CONNTRACK_FLAG_NONE =
    0, RTE_FLOW_CONNTRACK_FLAG_SYN = RTE_BIT32(0),
    RTE_FLOW_CONNTRACK_FLAG_SYNACK = RTE_BIT32(1),
    RTE_FLOW_CONNTRACK_FLAG_FIN = RTE_BIT32(2),
    RTE_FLOW_CONNTRACK_FLAG_ACK = RTE_BIT32(3),
    RTE_FLOW_CONNTRACK_FLAG_RST = RTE_BIT32(4) }
  • enum rte_flow_modify_op — three whole operations for modify: RTE_FLOW_MODIFY_SET = 0, RTE_FLOW_MODIFY_ADD, RTE_FLOW_MODIFY_SUB. simple. clean. no notes. 🌸
enum rte_flow_modify_op { RTE_FLOW_MODIFY_SET = 0, RTE_FLOW_MODIFY_ADD,
    RTE_FLOW_MODIFY_SUB }
  • enum rte_flow_error_type — the error taxonomy, aka the "which part of your rule was wrong" list. starts at RTE_FLOW_ERROR_TYPE_NONE and works its way all the way down to RTE_FLOW_ERROR_TYPE_STATE. read this one when things go sideways, bestie, it's got receipts. 🔥
enum rte_flow_error_type { RTE_FLOW_ERROR_TYPE_NONE,
    RTE_FLOW_ERROR_TYPE_UNSPECIFIED, RTE_FLOW_ERROR_TYPE_HANDLE,
    RTE_FLOW_ERROR_TYPE_ATTR_GROUP, RTE_FLOW_ERROR_TYPE_ATTR_PRIORITY,
    RTE_FLOW_ERROR_TYPE_ATTR_INGRESS, RTE_FLOW_ERROR_TYPE_ATTR_EGRESS,
    RTE_FLOW_ERROR_TYPE_ATTR_TRANSFER, RTE_FLOW_ERROR_TYPE_ATTR,
    RTE_FLOW_ERROR_TYPE_ITEM_NUM, RTE_FLOW_ERROR_TYPE_ITEM_SPEC,
    RTE_FLOW_ERROR_TYPE_ITEM_LAST, RTE_FLOW_ERROR_TYPE_ITEM_MASK,
    RTE_FLOW_ERROR_TYPE_ITEM, RTE_FLOW_ERROR_TYPE_ACTION_NUM,
    RTE_FLOW_ERROR_TYPE_ACTION_CONF, RTE_FLOW_ERROR_TYPE_ACTION,
    RTE_FLOW_ERROR_TYPE_STATE }
  • enum rte_flow_conv_op — the conversion operations. RTE_FLOW_CONV_OP_NONE, RTE_FLOW_CONV_OP_ATTR, RTE_FLOW_CONV_OP_ITEM, RTE_FLOW_CONV_OP_ITEM_MASK, RTE_FLOW_CONV_OP_ACTION, RTE_FLOW_CONV_OP_PATTERN, RTE_FLOW_CONV_OP_ACTIONS, RTE_FLOW_CONV_OP_RULE, RTE_FLOW_CONV_OP_ITEM_NAME, RTE_FLOW_CONV_OP_ACTION_NAME, RTE_FLOW_CONV_OP_ITEM_NAME_PTR, RTE_FLOW_CONV_OP_ACTION_NAME_PTR. 🎀
enum rte_flow_conv_op { RTE_FLOW_CONV_OP_NONE, RTE_FLOW_CONV_OP_ATTR,
    RTE_FLOW_CONV_OP_ITEM, RTE_FLOW_CONV_OP_ITEM_MASK,
    RTE_FLOW_CONV_OP_ACTION, RTE_FLOW_CONV_OP_PATTERN,
    RTE_FLOW_CONV_OP_ACTIONS, RTE_FLOW_CONV_OP_RULE,
    RTE_FLOW_CONV_OP_ITEM_NAME, RTE_FLOW_CONV_OP_ACTION_NAME,
    RTE_FLOW_CONV_OP_ITEM_NAME_PTR, RTE_FLOW_CONV_OP_ACTION_NAME_PTR }
  • enum rte_flow_table_insertion_type — how you get stuff into a table: RTE_FLOW_TABLE_INSERTION_TYPE_PATTERN, RTE_FLOW_TABLE_INSERTION_TYPE_INDEX, RTE_FLOW_TABLE_INSERTION_TYPE_INDEX_WITH_PATTERN. ✨
enum rte_flow_table_insertion_type {
    RTE_FLOW_TABLE_INSERTION_TYPE_PATTERN,
    RTE_FLOW_TABLE_INSERTION_TYPE_INDEX,
    RTE_FLOW_TABLE_INSERTION_TYPE_INDEX_WITH_PATTERN }
  • enum rte_flow_table_hash_func — hash functions for tables: RTE_FLOW_TABLE_HASH_FUNC_DEFAULT, RTE_FLOW_TABLE_HASH_FUNC_LINEAR, RTE_FLOW_TABLE_HASH_FUNC_CRC32, RTE_FLOW_TABLE_HASH_FUNC_CRC16. crc girlies rise. 🌈
enum rte_flow_table_hash_func { RTE_FLOW_TABLE_HASH_FUNC_DEFAULT,
    RTE_FLOW_TABLE_HASH_FUNC_LINEAR, RTE_FLOW_TABLE_HASH_FUNC_CRC32,
    RTE_FLOW_TABLE_HASH_FUNC_CRC16 }
  • enum rte_flow_op_status — the shortest mood board in the whole file, and honestly? refreshing. RTE_FLOW_OP_SUCCESS or RTE_FLOW_OP_ERROR. that's the vibe check right there. 💅
enum rte_flow_op_status { RTE_FLOW_OP_SUCCESS, RTE_FLOW_OP_ERROR }
  • enum rte_flow_query_update_mode — numbering matters again bestie: RTE_FLOW_QU_QUERY_FIRST = 1, then RTE_FLOW_QU_UPDATE_FIRST. starts at one. as is tradition here apparently. 🍓
enum rte_flow_query_update_mode { RTE_FLOW_QU_QUERY_FIRST = 1,
    RTE_FLOW_QU_UPDATE_FIRST }
  • enum rte_flow_encap_hash_field — the encap hash fields: RTE_FLOW_ENCAP_HASH_FIELD_SRC_PORT and RTE_FLOW_ENCAP_HASH_FIELD_NVGRE_FLOW_ID. two of them. cute, concise, done. 🫶
enum rte_flow_encap_hash_field { RTE_FLOW_ENCAP_HASH_FIELD_SRC_PORT,
    RTE_FLOW_ENCAP_HASH_FIELD_NVGRE_FLOW_ID }

and that's the enum tour bestie — every single value, exactly as written, nothing skipped — but the structures are right behind this and they've been waiting very patiently, so… 👀

✨ Functions ✨

okay bestie. this is the full cast list 💅 every single function that lives on this page, signatures and all, copied over letter for letter — __rte_experimental badges, __rte_unused tags, the one sad __rte_deprecated girl, all of it. the deep lore for each one comes later on the page, this is just so you know who's in the group chat. 🫶

the first one up, and yes she's experimental:

__rte_experimental int rte_flow_dev_dump (uint16_t port_id, struct
    rte_flow *flow, FILE *file, struct rte_flow_error *error)

a FILE *file in the arg list? she knows where things are going ✨

static __rte_experimental int rte_flow_dynf_metadata_avail (void)

(void) — takes literally nothing, no opinions, no drama. 🎀

__rte_experimental int rte_flow_dynf_metadata_register (void)

also (void), also experimental. twins fr fr.


now the un-marked legends, no __rte_experimental in sight, pure main character energy:

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 * 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)

she returns a struct rte_flow * bestie, hold onto that pointer like it's your iced coffee 🧊

int rte_flow_destroy (uint16_t port_id, struct rte_flow *flow, struct
    rte_flow_error *error)
int rte_flow_flush (uint16_t port_id, struct rte_flow_error *error)
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)
int rte_flow_isolate (uint16_t port_id, int set, struct rte_flow_error
    *error)

that int set sitting there by itself, iconic honestly.

int rte_flow_error_set (struct rte_flow_error *error, int code, enum
    rte_flow_error_type type, const void *cause, const char *message)

the one who fills in the error form. void *cause?? she's mysterious, we love her. 😭

__rte_experimental int rte_flow_actions_update (uint16_t port_id, struct
    rte_flow *flow, const struct rte_flow_action actions[], struct
    rte_flow_error *error)

💀 the deprecated one. rip bozo, use something else fr:
__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)

she returns size_t and she's on her way out. we still list her because the rules are the rules 🌸


back to the experimental girlies:

__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)
__rte_experimental int rte_flow_get_aged_flows (uint16_t port_id, void
    **contexts, uint32_t nb_contexts, struct rte_flow_error *error)
__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)

the _q_ one brings a queue_id to the party, very demure, very mindful 💜

__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)
__rte_experimental int rte_flow_action_handle_destroy (uint16_t port_id,
    struct rte_flow_action_handle *handle, struct rte_flow_error *error)
__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_action_handle_query (uint16_t port_id,
    const struct rte_flow_action_handle *handle, void *data, struct
    rte_flow_error *error)

notice the const sneaking onto handle in that last one? the way that— 👑 (create/destroy/update take her non-const, query takes her const. observed. not judging.)


tunnel era 🦋:

__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)
__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)

double pointers everywhere, she's giving pointer to pointer realness ✨

__rte_experimental uint64_t rte_flow_restore_info_dynflag (void)

a uint64_t return and a (void) — no args, all flag. 🌈

__rte_experimental int rte_flow_get_restore_info (uint16_t port_id,
    struct rte_mbuf *m, struct rte_mbuf *m, struct rte_flow_restore_info *info, struct
    rte_flow_error *error)

wait no, sorry, one m only, my bad, here's the real one, rte_mbuf bestie:

__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)

okay that was not the vibe, apology accepted. moving on 💅

__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)
__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)

the clean-up crew. release the girlies!! 🫶


and then, unmarked, mysterious, standing among the experimentals with zero badge:

int rte_flow_pick_transfer_proxy (uint16_t port_id, uint16_t
    *proxy_port_id, struct rte_flow_error *error)

she picks. she transfers. she proxies. little head tilt, no notes. 🎀


flex era:

__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)
__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)

look at that const struct rte_flow_item_flex_handle *handle — she will NOT be touched. boundaries. ✨

__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)

two out-params, port and queue, she's a double threat 💜

__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 ... *queue_attr[] — array of pointers to const. she ate. 😭


template time, this is where it gets very serious:

__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)
__rte_experimental int rte_flow_pattern_template_destroy (uint16_t
    port_id, struct rte_flow_pattern_template *pattern_template, struct
    rte_flow_error *error)
__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)

actions AND masks?? she brought a plus-one to the function call 💅

__rte_experimental int rte_flow_actions_template_destroy (uint16_t
    port_id, struct rte_flow_actions_template *actions_template, struct
    rte_flow_error *error)
__rte_experimental bool rte_flow_template_table_resizable (__rte_unused
    uint16_t port_id, const struct rte_flow_template_table_attr
    *tbl_attr)

🚨 SHE RETURNS A bool 🚨 and she tagged port_id with __rte_unused — she is not even pretending to use it, and honestly? respect. no notes. 🌸

__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)

count them: nb_pattern_templates + nb_actions_templates, both uint8_t. she's carrying TWO counters and two arrays. lowkey a whole meal 🔥

__rte_experimental int rte_flow_template_table_destroy (uint16_t
    port_id, struct rte_flow_template_table *template_table, struct
    rte_flow_error *error)
__rte_experimental int rte_flow_group_set_miss_actions (uint16_t
    port_id, uint32_t group_id, const struct rte_flow_group_attr *attr,
    const struct rte_flow_action actions[], struct rte_flow_error
    *error)

a group_id and a group_attr? group project energy (derogatory) (but she slays) 💖


async era, buckle up bestie, this is the section that just keeps going:

__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)

SEVEN arguments (okay more like nine, we don't count). she has pattern_template_index, actions_template_index, and a void *user_data. chaos, but organized chaos. 💜

__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)

the _by_index one swaps the pattern out for a uint32_t rule_index. glow up ✨

__rte_experimental struct rte_flow *
    rte_flow_async_create_by_index_with_pattern (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_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)

_by_index_with_pattern?? she took "have it all" literally and said okay. 👑

__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)
__rte_experimental int rte_flow_async_actions_update (uint16_t port_id,
    uint32_t queue_id, const struct rte_flow_op_attr *op_attr, struct
    rte_flow *flow, const struct rte_flow_action actions[], uint8_t
    actions_template_index, void *user_data, struct rte_flow_error
    *error)
__rte_experimental int rte_flow_push (uint16_t port_id, uint32_t
    queue_id, struct rte_flow_error *error)

push. 💅

__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)

pull. 💅 they're a set. push+pull, the way that—


async action handles:

__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)

indir_action_conf — spelled all the way out, no abbreviations, she's thorough 🎀

__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)
__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)
__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)

void *data and void *user_data in the same signature. two voids. void ception. 💀

__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)

query and update in ONE function name?? synergy. slay. ✨

__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)

👀 okay okay okay — did you catch it? every other async function calls it op_attr. this one calls it attr. she's different. she's not like the other girls. we don't make the rules, we just document them, no cap. 💅


action list handles, the final boss squad 🌈:

__rte_experimental struct rte_flow_action_list_handle *
    rte_flow_action_list_handle_create (uint16_t port_id, const struct
    rte_flow_indir_action_conf *conf, const struct rte_flow_action
    *actions, struct rte_flow_error *error)
__rte_experimental struct rte_flow_action_list_handle *
    rte_flow_async_action_list_handle_create (uint16_t port_id, uint32_t
    queue_id, const struct rte_flow_op_attr *attr, const struct
    rte_flow_indir_action_conf *conf, const struct rte_flow_action
    *actions, void *user_data, struct rte_flow_error *error)

(the async one is on the attr spelling too btw. iykyk.)

__rte_experimental int rte_flow_action_list_handle_destroy (uint16_t
    port_id, struct rte_flow_action_list_handle *handle, struct
    rte_flow_error *error)

and last but absolutely not least, she gets cut off mid-argument list because the page just keeps going, and honestly? we love a cliffhanger:

__rte_experimental int rte_flow_async_action_list_handle_destroy
    (uint16_t port_id, uint32_t queue_id, const struct rte_flow_op_attr

bestie she's still talking. 💀 the signature isn't finished, the group chat keeps scrolling, and so do we —

…and that's the rest of the function roll-call, bestie 💖:

__rte_experimental int rte_flow_action_list_handle_query_update
    (uint16_t port_id, const struct rte_flow_action_list_handle *handle,
    const void **update, void **query, enum rte_flow_query_update_mode
    mode, struct rte_flow_error *error)
__rte_experimental int rte_flow_async_action_list_handle_query_update
    (uint16_t port_id, uint32_t queue_id, const struct rte_flow_op_attr
    *attr, const struct rte_flow_action_list_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_calc_table_hash (uint16_t port_id, const
    struct rte_flow_template_table *table, const struct rte_flow_item
    pattern[], uint8_t pattern_template_index, uint32_t *hash, struct
    rte_flow_error *error)
__rte_experimental int rte_flow_calc_encap_hash (uint16_t port_id, const
    struct rte_flow_item pattern[], enum rte_flow_encap_hash_field
    dest_field, uint8_t hash_len, uint8_t *hash, struct rte_flow_error
    *error)
__rte_experimental int rte_flow_template_table_resize (uint16_t port_id,
    struct rte_flow_template_table *table, uint32_t nb_rules, struct
    rte_flow_error *error)
__rte_experimental int rte_flow_async_update_resized (uint16_t port_id,
    uint32_t queue, const struct rte_flow_op_attr *attr, struct rte_flow
    *rule, void *user_data, struct rte_flow_error *error)
__rte_experimental int rte_flow_template_table_resize_complete (uint16_t
    port_id, struct rte_flow_template_table *table, struct
    rte_flow_error *error)

Look at all those __rte_experimentals, we love an experimental queen who isn't quite ready for commitment 💅


🌈 Variables 🌈

Okay so these are the pre-built mask structs — the ready-to-wear collection, if you will 🎀 They're all static const, so they're locked in, no touchy.

  • static const struct rte_flow_item_quota rte_flow_item_quota_mask
  • static const struct rte_flow_item_higig2_hdr rte_flow_item_higig2_hdr_mask
  • static const struct rte_flow_item_any rte_flow_item_any_mask
  • static const struct rte_flow_item_port_id rte_flow_item_port_id_mask
  • static const struct rte_flow_item_raw rte_flow_item_raw_mask
  • static const struct rte_flow_item_eth rte_flow_item_eth_mask
  • static const struct rte_flow_item_vlan rte_flow_item_vlan_mask
  • static const struct rte_flow_item_ipv4 rte_flow_item_ipv4_mask
  • static const struct rte_flow_item_ipv6 rte_flow_item_ipv6_mask
  • static const struct rte_flow_item_icmp rte_flow_item_icmp_mask
  • static const struct rte_flow_item_udp rte_flow_item_udp_mask
  • static const struct rte_flow_item_tcp rte_flow_item_tcp_mask
  • static const struct rte_flow_item_sctp rte_flow_item_sctp_mask
  • static const struct rte_flow_item_vxlan rte_flow_item_vxlan_mask
  • static const struct rte_flow_item_e_tag rte_flow_item_e_tag_mask
  • static const struct rte_flow_item_nvgre rte_flow_item_nvgre_mask
  • static const struct rte_flow_item_mpls rte_flow_item_mpls_mask
  • static const struct rte_flow_item_gre rte_flow_item_gre_mask
  • static const struct rte_flow_item_fuzzy rte_flow_item_fuzzy_mask
  • static const struct rte_flow_item_gtp rte_flow_item_gtp_mask
  • static const struct rte_flow_item_esp rte_flow_item_esp_mask
  • static const struct rte_flow_item_geneve rte_flow_item_geneve_mask
  • static const struct rte_flow_item_vxlan_gpe rte_flow_item_vxlan_gpe_mask
  • static const struct rte_flow_item_arp_eth_ipv4 rte_flow_item_arp_eth_ipv4_mask
  • static const struct rte_flow_item_ipv6_ext rte_flow_item_ipv6_ext_mask
  • static const struct rte_flow_item_icmp6 rte_flow_item_icmp6_mask
  • static const struct rte_flow_item_icmp6_nd_ns rte_flow_item_icmp6_nd_ns_mask
  • static const struct rte_flow_item_icmp6_nd_na rte_flow_item_icmp6_nd_na_mask
  • static const struct rte_flow_item_icmp6_nd_opt rte_flow_item_icmp6_nd_opt_mask
  • static const struct rte_flow_item_icmp6_nd_opt_sla_eth rte_flow_item_icmp6_nd_opt_sla_eth_mask
  • static const struct rte_flow_item_icmp6_nd_opt_tla_eth rte_flow_item_icmp6_nd_opt_tla_eth_mask
  • static const struct rte_flow_item_meta rte_flow_item_meta_mask
  • static const struct rte_flow_item_gtp_psc rte_flow_item_gtp_psc_mask
  • static const struct rte_flow_item_pppoe_proto_id rte_flow_item_pppoe_proto_id_mask
  • static const struct rte_flow_item_tag rte_flow_item_tag_mask
  • static const struct rte_flow_item_l2tpv3oip rte_flow_item_l2tpv3oip_mask
  • static const struct rte_flow_item_mark rte_flow_item_mark_mask
  • static const struct rte_flow_item_nsh rte_flow_item_nsh_mask
  • static const struct rte_flow_item_igmp rte_flow_item_igmp_mask
  • static const struct rte_flow_item_ah rte_flow_item_ah_mask
  • static const struct rte_flow_item_pfcp rte_flow_item_pfcp_mask
  • static const struct rte_flow_item_ecpri rte_flow_item_ecpri_mask
  • static const struct rte_flow_item_geneve_opt rte_flow_item_geneve_opt_mask
  • static const struct rte_flow_item_conntrack rte_flow_item_conntrack_mask
  • static const struct rte_flow_item_ethdev rte_flow_item_ethdev_mask
  • static const struct rte_flow_item_l2tpv2 rte_flow_item_l2tpv2_mask
  • static const struct rte_flow_item_ppp rte_flow_item_ppp_mask
  • static const struct rte_flow_item_ib_bth rte_flow_item_ib_bth_mask
  • static const struct rte_flow_item_random rte_flow_item_random_mask
  • static const struct rte_flow_item_meter_color rte_flow_item_meter_color_mask
  • static const struct rte_flow_item_aggr_affinity rte_flow_item_aggr_affinity_mask
  • static const struct rte_flow_item_tx_queue rte_flow_item_tx_queue_mask
  • static const struct rte_flow_item_ptype rte_flow_item_ptype_mask

Fifty-three masks. Fifty-three!! 🫶 Every item type gets its own little matching twin, it's giving catalog energy, honestly iconic.


💫 Detailed Description 💫

RTE generic flow API

Okay so here's the whole point of this header, in one breath: this interface gives you the ability to program packet matching and the actions that go with it directly into hardware, through flow rules. 🦋

It's basically "tell the NIC what you want it to notice, and what you want it to do about it." Hardware offload, no cap.

Definition in file rte_flow.h.


🎀 Macro Definition Documentation 🎀

Conntrack state bits first, bestie, because vibes:

  • #define RTE_FLOW_CONNTRACK_PKT_STATE_VALID = RTE_BIT32(0) ✅ — The packet is valid after conntrack checking. Definition at line 1947 of file rte_flow.h.
  • #define RTE_FLOW_CONNTRACK_PKT_STATE_CHANGED = RTE_BIT32(1) 💫 — The state of the connection is changed. Definition at line 1951 of file rte_flow.h.
  • #define RTE_FLOW_CONNTRACK_PKT_STATE_INVALID = RTE_BIT32(2) 💀 — Error is detected on this packet for this connection, and an invalid state gets set. Definition at line 1956 of file rte_flow.h.
  • #define RTE_FLOW_CONNTRACK_PKT_STATE_DISABLED = RTE_BIT32(3) 🙈 — The HW connection tracking module is disabled. That can happen because of an application command, or because of an invalid state. Definition at line 1961 of file rte_flow.h.
  • #define RTE_FLOW_CONNTRACK_PKT_STATE_BAD = RTE_BIT32(4) 😭 — The packet contains some bad field(s) and cannot continue with the conntrack module checking. Definition at line 1966 of file rte_flow.h.

Then the restore-info bits ✨:

  • #define RTE_FLOW_RESTORE_INFO_TUNNEL = RTE_BIT64(0) 🕳️ — Indicate that the packet has a tunnel. Definition at line 5233 of file rte_flow.h.
  • #define RTE_FLOW_RESTORE_INFO_ENCAPSULATED = RTE_BIT64(1) 🎁 — Indicate that the packet has a non decapsulated tunnel header. Definition at line 5238 of file rte_flow.h.
  • #define RTE_FLOW_RESTORE_INFO_GROUP_ID = RTE_BIT64(2) 🔢 — Indicate that the packet has a group_id. Definition at line 5243 of file rte_flow.h.

Port flags, the organized-bestie era 🌸:

  • #define RTE_FLOW_PORT_FLAG_STRICT_QUEUE = RTE_BIT32(0) 📌 — Indicate all operations for a given flow rule will strictly happen on the same queue (create/destroy/query/update). Definition at line 5488 of file rte_flow.h.
  • #define RTE_FLOW_PORT_FLAG_SHARE_INDIRECT = RTE_BIT32(1) 🤝 — Indicate all steering objects should be created on contexts of the host port, providing indirect object sharing between ports. Definition at line 5495 of file rte_flow.h.

Table specialization hints, and listen, these ones matter 👑:

  • #define RTE_FLOW_TABLE_SPECIALIZE_TRANSFER_WIRE_ORIG = RTE_BIT32(0) 🧵 — Specialize table for transfer flows which come only from wire. It allows the PMD not to allocate resources for non-wire originated traffic. This bit is not a matching criteria, just an optimization hint. Flow rules which match non-wire originated traffic will be missed if the hint is supported. Definition at line 5886 of file rte_flow.h.
  • #define RTE_FLOW_TABLE_SPECIALIZE_TRANSFER_VPORT_ORIG = RTE_BIT32(1) 🧶 — Specialize table for transfer flows which come only from vport (e.g. VF, SF). It allows the PMD not to allocate resources for non-vport originated traffic. This bit is not a matching criteria, just an optimization hint. Flow rules which match non-vport originated traffic will be missed if the hint is supported. Definition at line 5894 of file rte_flow.h.
  • #define RTE_FLOW_TABLE_SPECIALIZE_RESIZABLE = RTE_BIT32(2) 📐 — Specialize table for resize. Definition at line 5898 of file rte_flow.h.
⚠️ Okay quick PSA because those two *_ORIG hints are out here catching people: they are hints, not match criteria, and if the PMD takes the hint, traffic from the "other" origin is going to get missed. Not a bug, that's the whole deal. Read twice, bestie 🫶

🔥 Enumeration Type Documentation 🔥

enum rte_flow_item_type

Matching pattern item types. ✨

Pattern items fall in two categories:

  • Matching protocol headers and packet data, usually associated with a specification structure. These must be stacked in the same order as the protocol layers to match inside packets, starting from the lowest.
  • Matching meta-data or affecting pattern processing, often without a specification structure. Since they do not match packet contents, their position in the list is usually not relevant.

See the description of individual types for more information. Those marked with [META] fall into the second category. 🫧


Enumerator

RTE_FLOW_ITEM_TYPE_END

[META]

End marker for item lists. Prevents further processing of items, thereby ending the pattern. 🛑

No associated specification structure.

RTE_FLOW_ITEM_TYPE_VOID

[META]

Used as a placeholder for convenience. It is ignored and simply discarded by PMDs. 💨

No associated specification structure.

RTE_FLOW_ITEM_TYPE_INVERT

[META]

Inverted matching, i.e. process packets that do not match the pattern. 🙃

No associated specification structure.

RTE_FLOW_ITEM_TYPE_ANY

Matches any protocol in place of the current layer, a single ANY may also stand for several protocol layers. 🌈

See struct rte_flow_item_any.

RTE_FLOW_ITEM_TYPE_PORT_ID

Deprecated

See also

  • RTE_FLOW_ITEM_TYPE_PORT_REPRESENTOR
  • RTE_FLOW_ITEM_TYPE_REPRESENTED_PORT

[META]

Matches traffic originating from (ingress) or going to (egress) a given DPDK port ID. 🚪

See struct rte_flow_item_port_id.

RTE_FLOW_ITEM_TYPE_RAW

Matches a byte string of a given length at a given offset. 🔍

See struct rte_flow_item_raw.

RTE_FLOW_ITEM_TYPE_ETH

Matches an Ethernet header. 🖧

See struct rte_flow_item_eth.

RTE_FLOW_ITEM_TYPE_VLAN

Matches an 802.1Q/ad VLAN tag. 🏷️

See struct rte_flow_item_vlan.

RTE_FLOW_ITEM_TYPE_IPV4

Matches an IPv4 header. 4️⃣

See struct rte_flow_item_ipv4.

RTE_FLOW_ITEM_TYPE_IPV6

Matches an IPv6 header. 6️⃣

See struct rte_flow_item_ipv6.

RTE_FLOW_ITEM_TYPE_ICMP

Matches an ICMP header. 🏓

See struct rte_flow_item_icmp.

RTE_FLOW_ITEM_TYPE_UDP

Matches a UDP header. 📨

See struct rte_flow_item_udp.

RTE_FLOW_ITEM_TYPE_TCP

Matches a TCP header, bestie 💖

See struct rte_flow_item_tcp.

RTE_FLOW_ITEM_TYPE_SCTP

Matches a SCTP header 🌸

See struct rte_flow_item_sctp.

RTE_FLOW_ITEM_TYPE_VXLAN

Matches a VXLAN header ✨

See struct rte_flow_item_vxlan.

RTE_FLOW_ITEM_TYPE_E_TAG

Matches a E_TAG header 🎀

See struct rte_flow_item_e_tag.

RTE_FLOW_ITEM_TYPE_NVGRE

Matches a NVGRE header 🦋

See struct rte_flow_item_nvgre.

RTE_FLOW_ITEM_TYPE_MPLS

Matches a MPLS header 👑

See struct rte_flow_item_mpls.

RTE_FLOW_ITEM_TYPE_GRE

Matches a GRE header 💜

See struct rte_flow_item_gre.

RTE_FLOW_ITEM_TYPE_FUZZY

[META] — so this one matches on vibes (the metadata ones, iykyk).

Fuzzy pattern match, expect faster than default. Fr fr, it's quicker.

This is for devices that support the fuzzy matching option. Usually a fuzzy matching is fast but the cost is accuracy — you're trading precision for speed, ngl 😭.

See struct rte_flow_item_fuzzy.

RTE_FLOW_ITEM_TYPE_GTP

Matches a GTP header.

Configure flow for GTP packets.

See struct rte_flow_item_gtp.

RTE_FLOW_ITEM_TYPE_GTPC

Matches a GTP header.

Configure flow for GTP-C packets.

See struct rte_flow_item_gtp.

RTE_FLOW_ITEM_TYPE_GTPU

Matches a GTP header.

Configure flow for GTP-U packets.

See struct rte_flow_item_gtp.

RTE_FLOW_ITEM_TYPE_ESP

Matches a ESP header 🔥

See struct rte_flow_item_esp.

RTE_FLOW_ITEM_TYPE_GENEVE

Matches a GENEVE header 🌈

See struct rte_flow_item_geneve.

RTE_FLOW_ITEM_TYPE_VXLAN_GPE

Deprecated 🚨 — she's old, she's retiring, don't build new stuff on her.

See also

  • RTE_FLOW_ITEM_TYPE_VXLAN

Matches a VXLAN-GPE header.

See struct rte_flow_item_vxlan_gpe.

RTE_FLOW_ITEM_TYPE_ARP_ETH_IPV4

Matches an ARP header for Ethernet/IPv4 💅

See struct rte_flow_item_arp_eth_ipv4.

RTE_FLOW_ITEM_TYPE_IPV6_EXT

Matches the presence of any IPv6 extension header 🌸

See struct rte_flow_item_ipv6_ext.

RTE_FLOW_ITEM_TYPE_ICMP6

Matches any ICMPv6 header ✨

See struct rte_flow_item_icmp6.

RTE_FLOW_ITEM_TYPE_ICMP6_ND_NS

Matches an ICMPv6 neighbor discovery solicitation 🫶

See struct rte_flow_item_icmp6_nd_ns.

RTE_FLOW_ITEM_TYPE_ICMP6_ND_NA

Matches an ICMPv6 neighbor discovery advertisement 💖

See struct rte_flow_item_icmp6_nd_na.

RTE_FLOW_ITEM_TYPE_ICMP6_ND_OPT

Matches the presence of any ICMPv6 neighbor discovery option 🎀

See struct rte_flow_item_icmp6_nd_opt.

RTE_FLOW_ITEM_TYPE_ICMP6_ND_OPT_SLA_ETH

Matches an ICMPv6 neighbor discovery source Ethernet link-layer address option.

See struct rte_flow_item_icmp6_nd_opt_sla_eth.

RTE_FLOW_ITEM_TYPE_ICMP6_ND_OPT_TLA_ETH

Matches an ICMPv6 neighbor discovery target Ethernet link-layer address option.

See struct rte_flow_item_icmp6_nd_opt_tla_eth.

RTE_FLOW_ITEM_TYPE_MARK

Matches specified mark field 🏷️

See struct rte_flow_item_mark.

RTE_FLOW_ITEM_TYPE_META

[META] ✨

Matches a metadata value.

See struct rte_flow_item_meta.

RTE_FLOW_ITEM_TYPE_GRE_KEY

Matches a GRE optional key field 🔑

The value should a big-endian 32bit integer. Yes, big-endian, don't come at me.

When this item present the K bit is implicitly matched as "1" in the default mask. So like, it's already handled for you, no cap.

spec/mask type:

rte_be32_t *

RTE_FLOW_ITEM_TYPE_GTP_PSC

Matches a GTP extension header: PDU session container.

Configure flow for GTP packets with extension header type 0x85.

See struct rte_flow_item_gtp_psc.

RTE_FLOW_ITEM_TYPE_PPPOES

Matches a PPPoE header.

Configure flow for PPPoE session packets.

See struct rte_flow_item_pppoe.

RTE_FLOW_ITEM_TYPE_PPPOED

Matches a PPPoE header.

Configure flow for PPPoE discovery packets.

See struct rte_flow_item_pppoe.

RTE_FLOW_ITEM_TYPE_PPPOE_PROTO_ID

Matches a PPPoE optional proto_id field 🌸

It only applies to PPPoE session packets.

See struct rte_flow_item_pppoe_proto_id.

RTE_FLOW_ITEM_TYPE_NSH

Matches Network service header (NSH). See struct rte_flow_item_nsh.

RTE_FLOW_ITEM_TYPE_IGMP

Matches Internet Group Management Protocol (IGMP). See struct rte_flow_item_igmp.

RTE_FLOW_ITEM_TYPE_AH

Matches IP Authentication Header (AH). See struct rte_flow_item_ah.

RTE_FLOW_ITEM_TYPE_HIGIG2

Matches a HIGIG header. see struct rte_flow_item_higig2_hdr. (yes lowercase "see", we keep it exactly 💅)

RTE_FLOW_ITEM_TYPE_TAG

[META] 🏷️

Matches a tag value.

See struct rte_flow_item_tag.

RTE_FLOW_ITEM_TYPE_L2TPV3OIP

Matches a L2TPv3 over IP header.

Configure flow for L2TPv3 over IP packets.

See struct rte_flow_item_l2tpv3oip.

RTE_FLOW_ITEM_TYPE_PFCP

Matches PFCP Header. See struct rte_flow_item_pfcp.

RTE_FLOW_ITEM_TYPE_ECPRI

Matches eCPRI Header.

Configure flow for eCPRI over ETH or UDP packets.

See struct rte_flow_item_ecpri.

RTE_FLOW_ITEM_TYPE_IPV6_FRAG_EXT

Matches the presence of IPv6 fragment extension header 🦋

See struct rte_flow_item_ipv6_frag_ext.

RTE_FLOW_ITEM_TYPE_GENEVE_OPT

Matches Geneve Variable Length Option

See struct rte_flow_item_geneve_opt

RTE_FLOW_ITEM_TYPE_INTEGRITY

[META] 🔥

Matches on packet integrity. For some devices application needs to enable integration checks in HW before using this item. So heads up, enable it first bestie.

See also

  • struct rte_flow_item_integrity.

RTE_FLOW_ITEM_TYPE_CONNTRACK

[META] 💀

Matches conntrack state.

See also

  • struct rte_flow_item_conntrack.

RTE_FLOW_ITEM_TYPE_PORT_REPRESENTOR

[META] 💅

Matches traffic entering the embedded switch from the given ethdev.

See also

  • struct rte_flow_item_ethdev

RTE_FLOW_ITEM_TYPE_REPRESENTED_PORT

[META] 💖

Matches traffic entering the embedded switch from the entity represented by the given ethdev.

See also

  • struct rte_flow_item_ethdev

RTE_FLOW_ITEM_TYPE_FLEX

Matches a configured set of fields at runtime calculated offsets over the generic network header with variable length and flexible pattern 🧚

See also

  • struct rte_flow_item_flex.

RTE_FLOW_ITEM_TYPE_L2TPV2

Matches L2TPv2 Header.

See struct rte_flow_item_l2tpv2.

RTE_FLOW_ITEM_TYPE_PPP

Matches PPP Header.

See struct rte_flow_item_ppp.

RTE_FLOW_ITEM_TYPE_GRE_OPTION

Matches GRE optional fields.

See struct rte_flow_item_gre_opt.

RTE_FLOW_ITEM_TYPE_MACSEC

Matches MACsec Ethernet Header.

See struct rte_flow_item_macsec.

RTE_FLOW_ITEM_TYPE_METER_COLOR

Matches Meter Color Marker 🎨

See struct rte_flow_item_meter_color.

RTE_FLOW_ITEM_TYPE_IPV6_ROUTING_EXT

Matches the presence of IPv6 routing extension header.

See also

  • struct rte_flow_item_ipv6_routing_ext.

RTE_FLOW_ITEM_TYPE_ICMP6_ECHO_REQUEST

Matches an ICMPv6 echo request 📣

See also

  • struct rte_flow_item_icmp6_echo.

RTE_FLOW_ITEM_TYPE_ICMP6_ECHO_REPLY

Matches an ICMPv6 echo reply 💬

See also

  • struct rte_flow_item_icmp6_echo.

RTE_FLOW_ITEM_TYPE_QUOTA

Match Quota state

See also

  • struct rte_flow_item_quota

RTE_FLOW_ITEM_TYPE_AGGR_AFFINITY

Matches on the aggregated port of the received packet. Used in case multiple ports are aggregated to the a DPDK port. First port is number 1. (yes, it starts at 1, not 0, iconic behaviour tbh)

See also

  • struct rte_flow_item_aggr_affinity.

RTE_FLOW_ITEM_TYPE_TX_QUEUE

Match Tx queue number. This is valid only for egress rules 👑

See also

  • struct rte_flow_item_tx_queue

RTE_FLOW_ITEM_TYPE_IB_BTH

Matches an InfiniBand base transport header in RoCE packet 🌈

See also

  • struct rte_flow_item_ib_bth.

RTE_FLOW_ITEM_TYPE_PTYPE

Matches the packet type as defined in rte_mbuf_ptype.

See struct rte_flow_item_ptype.

RTE_FLOW_ITEM_TYPE_RANDOM

[META] 🎲

Matches a random value.

This value is not based on the packet data/headers. The application shouldn't assume that this value is kept during the lifetime of the packet. So literally do not depend on it staying the same, fr fr 😭

See also

  • struct rte_flow_item_random.

RTE_FLOW_ITEM_TYPE_COMPARE

Match packet with various comparison types.

See struct rte_flow_item_compare.

Definition at line 153 of file rte_flow.h.


enum rte_flow_quota_state

Warning 🚨 EXPERIMENTAL: this API may change without prior notice. She's experimental bestie, she might switch up on you.

QUOTA state.

See also

  • struct rte_flow_item_quota

Enumerator

  • RTE_FLOW_QUOTA_STATE_PASS — PASS quota state ✨
  • RTE_FLOW_QUOTA_STATE_BLOCK — BLOCK quota state 🛑

Definition at line 737 of file rte_flow.h.


enum rte_flow_item_flex_field_mode

Field bit offset calculation mode. The math girlies are gonna love this one 💅

Enumerator

  • FIELD_MODE_DUMMY — Dummy field, used for byte boundary alignment in pattern. Pattern mask and data are ignored in the match. All configuration parameters besides field size are ignored. So like, it's there for the alignment vibes only.
  • FIELD_MODE_FIXED — Fixed offset field. The bit offset from header beginning is permanent and defined by field_base parameter.
  • FIELD_MODE_OFFSET — The field bit offset is extracted from other header field (indirect offset field). The resulting field offset to match is calculated as:
field_base + (*offset_base & offset_mask) << offset_shift
  • FIELD_MODE_BITMASK — The field bit offset is extracted from other header field (indirect offset field), the latter is considered as bitmask containing some number of one bits, the resulting field offset to match is calculated as:
field_base + bitcount(*offset_base & offset_mask) << offset_shift

Definition at line 2158 of file rte_flow.h.


enum rte_flow_item_flex_tunnel_mode

Flex item field tunnel mode 🌸

Enumerator

  • FLEX_TUNNEL_MODE_SINGLE — The protocol header can be present in the packet only once. No multiple flex item flow inclusions (for inner/outer) are allowed. No any relations with tunnel protocols are imposed. The drivers can optimize hardware resource usage to handle match on single flex item of specific type.
  • FLEX_TUNNEL_MODE_OUTER — Flex item presents outer header only.
  • FLEX_TUNNEL_MODE_INNER — Flex item presents inner header only.
  • FLEX_TUNNEL_MODE_MULTI — Flex item presents either inner or outer header. The driver handles as many multiple inners as hardware supports.
  • FLEX_TUNNEL_MODE_TUNNEL — Flex item presents tunnel protocol header.

Definition at line 2191 of file rte_flow.h.

enum rte_flow_field_id 🌸

okay so these are the packet header field IDs bestie — the little name tags that RTE_FLOW_ACTION_TYPE_MODIFY_FIELD and RTE_FLOW_ITEM_TYPE_COMPARE point at when they wanna say "yeah this exact bit of the packet". Enumerator time, let's go 💅

  • RTE_FLOW_FIELD_START — Start of a packet. the very beginning, the origin story ✨
  • RTE_FLOW_FIELD_MAC_DST — Destination MAC Address.
  • RTE_FLOW_FIELD_MAC_SRC — Source MAC Address.
  • RTE_FLOW_FIELD_VLAN_TYPE — VLAN Tag Identifier.
  • RTE_FLOW_FIELD_VLAN_ID — VLAN Identifier.
  • RTE_FLOW_FIELD_MAC_TYPE — EtherType.
  • RTE_FLOW_FIELD_IPV4_DSCP — IPv4 DSCP.
  • RTE_FLOW_FIELD_IPV4_TTL — IPv4 Time To Live.
  • RTE_FLOW_FIELD_IPV4_SRC — IPv4 Source Address.
  • RTE_FLOW_FIELD_IPV4_DST — IPv4 Destination Address.
  • RTE_FLOW_FIELD_IPV6_DSCP — IPv6 DSCP.
  • RTE_FLOW_FIELD_IPV6_HOPLIMIT — IPv6 Hop Limit.
  • RTE_FLOW_FIELD_IPV6_SRC — IPv6 Source Address.
  • RTE_FLOW_FIELD_IPV6_DST — IPv6 Destination Address.
  • RTE_FLOW_FIELD_TCP_PORT_SRC — TCP Source Port Number.
  • RTE_FLOW_FIELD_TCP_PORT_DST — TCP Destination Port Number.
  • RTE_FLOW_FIELD_TCP_SEQ_NUM — TCP Sequence Number.
  • RTE_FLOW_FIELD_TCP_ACK_NUM — TCP Acknowledgment Number.
  • RTE_FLOW_FIELD_TCP_FLAGS — TCP Flags.
  • RTE_FLOW_FIELD_UDP_PORT_SRC — UDP Source Port Number.
  • RTE_FLOW_FIELD_UDP_PORT_DST — UDP Destination Port Number.
  • RTE_FLOW_FIELD_VXLAN_VNI — VXLAN Network Identifier.
  • RTE_FLOW_FIELD_GENEVE_VNI — GENEVE Network Identifier.
  • RTE_FLOW_FIELD_GTP_TEID — GTP Tunnel Endpoint Identifier.
  • RTE_FLOW_FIELD_TAG — Tag value.
  • RTE_FLOW_FIELD_MARK — Mark value.
  • RTE_FLOW_FIELD_META — Metadata value.
  • RTE_FLOW_FIELD_POINTER — Memory pointer.
  • RTE_FLOW_FIELD_VALUE — Immediate value.
  • RTE_FLOW_FIELD_IPV4_ECN — IPv4 ECN.
  • RTE_FLOW_FIELD_IPV6_ECN — IPv6 ECN.
  • RTE_FLOW_FIELD_GTP_PSC_QFI — GTP QFI.
  • RTE_FLOW_FIELD_METER_COLOR — Meter color marker.
  • RTE_FLOW_FIELD_IPV6_PROTO — IPv6 next header.
  • RTE_FLOW_FIELD_FLEX_ITEM — Flex item.
  • RTE_FLOW_FIELD_HASH_RESULT — Hash result.
  • RTE_FLOW_FIELD_GENEVE_OPT_TYPE — GENEVE option type.
  • RTE_FLOW_FIELD_GENEVE_OPT_CLASS — GENEVE option class.
  • RTE_FLOW_FIELD_GENEVE_OPT_DATA — GENEVE option data.
  • RTE_FLOW_FIELD_MPLS — MPLS header.
  • RTE_FLOW_FIELD_TCP_DATA_OFFSET — TCP data offset.
  • RTE_FLOW_FIELD_IPV4_IHL — IPv4 IHL.
  • RTE_FLOW_FIELD_IPV4_TOTAL_LEN — IPv4 total length.
  • RTE_FLOW_FIELD_IPV6_PAYLOAD_LEN — IPv6 payload length.
  • RTE_FLOW_FIELD_IPV4_PROTO — IPv4 next protocol.
  • RTE_FLOW_FIELD_IPV6_FLOW_LABEL — IPv6 flow label.
  • RTE_FLOW_FIELD_IPV6_TRAFFIC_CLASS — IPv6 traffic class.
  • RTE_FLOW_FIELD_ESP_SPI — ESP SPI.
  • RTE_FLOW_FIELD_ESP_SEQ_NUM — ESP Sequence Number.
  • RTE_FLOW_FIELD_ESP_PROTO — ESP next protocol value.
  • RTE_FLOW_FIELD_RANDOM — Random value.
  • RTE_FLOW_FIELD_VXLAN_LAST_RSVD — VXLAN last reserved byte.

Definition at line 2387 of file rte_flow.h.


enum rte_flow_item_compare_op 🦋

Expected operation types for compare item. that's the whole vibe, bestie, that's it 😌

Definition at line 2540 of file rte_flow.h.


enum rte_flow_action_type 👑

Action types. Every possible action is a type, okay? An action can have its own little config object attached, and you can stack several actions in a list, hand the whole list to a flow rule, and they get performed in order. no line-cutting, they queue up 💅

They fall into three categories:

  • Actions that modify the fate of matching traffic — like dropping it, or sending it somewhere specific.
  • Actions that modify the contents or properties of matching traffic — that's your adding/removing encapsulation, encryption, compression and marks situation.
  • Actions related to the flow rule itself — updating counters, making it non-terminating, that kind of thing.
Heads up fr fr: flow rules are terminating by default, so if you don't specify any fate-kind action, the result is undefined behavior. and yes, that applies to both ingress and egress. not a cute look 🙈

PASSTHRU, when it's supported, is the thing that makes a flow rule non-terminating.

Enumerator:

  • RTE_FLOW_ACTION_TYPE_END — End marker for action lists. Prevents further processing of actions, thereby ending the list.

No associated configuration structure.

  • RTE_FLOW_ACTION_TYPE_VOID — Used as a placeholder for convenience. It is ignored and simply discarded by PMDs.

No associated configuration structure.

  • RTE_FLOW_ACTION_TYPE_PASSTHRU — Leaves traffic up for additional processing by subsequent flow rules; makes a flow rule non-terminating.

No associated configuration structure.

  • RTE_FLOW_ACTION_TYPE_JUMP — RTE_FLOW_ACTION_TYPE_JUMP

Redirects packets to a group on the current device.

See struct rte_flow_action_jump.

  • RTE_FLOW_ACTION_TYPE_MARK — Attaches an integer value to packets and sets RTE_MBUF_F_RX_FDIR and RTE_MBUF_F_RX_FDIR_ID mbuf flags.

See struct rte_flow_action_mark.

One should negotiate mark delivery from the NIC to the PMD.

See also:

  • rte_eth_rx_metadata_negotiate()
  • RTE_ETH_RX_METADATA_USER_MARK
  • RTE_FLOW_ACTION_TYPE_FLAG — Flags packets. Similar to MARK without a specific value; only sets the RTE_MBUF_F_RX_FDIR mbuf flag.

No associated configuration structure.

One should negotiate flag delivery from the NIC to the PMD.

See also:

  • rte_eth_rx_metadata_negotiate()
  • RTE_ETH_RX_METADATA_USER_FLAG
  • RTE_FLOW_ACTION_TYPE_QUEUE — Assigns packets to a given queue index.

See struct rte_flow_action_queue.

  • RTE_FLOW_ACTION_TYPE_DROP — Drops packets.

PASSTHRU overrides this action if both are specified.

No associated configuration structure.

  • RTE_FLOW_ACTION_TYPE_COUNT — Enables counters for this flow rule.

These counters can be retrieved and reset through rte_flow_query() or rte_flow_action_handle_query() if the action provided via handle, see struct rte_flow_query_count.

See struct rte_flow_action_count.

  • RTE_FLOW_ACTION_TYPE_RSS — Similar to QUEUE, except RSS is additionally performed on packets to spread them among several queues according to the provided parameters.

See struct rte_flow_action_rss.

  • RTE_FLOW_ACTION_TYPE_PF
Deprecated ⚠️

See also:

  • RTE_FLOW_ACTION_TYPE_PORT_REPRESENTOR
  • RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT

Directs matching traffic to the physical function (PF) of the current device.

No associated configuration structure.

  • RTE_FLOW_ACTION_TYPE_VF
Deprecated ⚠️

See also:

  • RTE_FLOW_ACTION_TYPE_PORT_REPRESENTOR
  • RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT

Directs matching traffic to a given virtual function of the current device.

See struct rte_flow_action_vf.

  • RTE_FLOW_ACTION_TYPE_PORT_ID
Deprecated ⚠️

See also:

  • RTE_FLOW_ACTION_TYPE_PORT_REPRESENTOR
  • RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT

Directs matching traffic to a given DPDK port ID.

See struct rte_flow_action_port_id.

  • RTE_FLOW_ACTION_TYPE_METER — Traffic metering and policing (MTR).

See struct rte_flow_action_meter. See file rte_mtr.h for MTR object configuration.

  • RTE_FLOW_ACTION_TYPE_SECURITY — Redirects packets to security engine of current device for security processing as specified by security session.

See struct rte_flow_action_security.

  • RTE_FLOW_ACTION_TYPE_OF_DEC_NW_TTL
Warning: This is a legacy action. 🫠

See also:

  • RTE_FLOW_ACTION_TYPE_MODIFY_FIELD

Implements OFPAT_DEC_NW_TTL ("decrement IP TTL") as defined by the OpenFlow Switch Specification.

No associated configuration structure.

  • RTE_FLOW_ACTION_TYPE_OF_POP_VLAN — Implements OFPAT_POP_VLAN ("pop the outer VLAN tag") as defined by the OpenFlow Switch Specification.

No associated configuration structure.

  • RTE_FLOW_ACTION_TYPE_OF_PUSH_VLAN — Implements OFPAT_PUSH_VLAN ("push a new VLAN tag") as defined by the OpenFlow Switch Specification.

See struct rte_flow_action_of_push_vlan.

  • RTE_FLOW_ACTION_TYPE_OF_SET_VLAN_VID — Implements OFPAT_SET_VLAN_VID ("set the 802.1q VLAN ID") as defined by the OpenFlow Switch Specification.

See struct rte_flow_action_of_set_vlan_vid.

  • RTE_FLOW_ACTION_TYPE_OF_SET_VLAN_PCP — Implements OFPAT_SET_LAN_PCP ("set the 802.1q priority") as defined by the OpenFlow Switch Specification.

See struct rte_flow_action_of_set_vlan_pcp.

  • RTE_FLOW_ACTION_TYPE_OF_POP_MPLS — Implements OFPAT_POP_MPLS ("pop the outer MPLS tag") as defined by the OpenFlow Switch Specification.

See struct rte_flow_action_of_pop_mpls.

  • RTE_FLOW_ACTION_TYPE_OF_PUSH_MPLS — Implements OFPAT_PUSH_MPLS ("push a new MPLS tag") as defined by the OpenFlow Switch Specification.

See struct rte_flow_action_of_push_mpls.

  • RTE_FLOW_ACTION_TYPE_VXLAN_ENCAP — Encapsulate flow in VXLAN tunnel as defined in rte_flow_action_vxlan_encap action structure.

See struct rte_flow_action_vxlan_encap.

  • RTE_FLOW_ACTION_TYPE_VXLAN_DECAP — Decapsulate outer most VXLAN tunnel from matched flow.

If flow pattern does not define a valid VXLAN tunnel (as specified by RFC7348) then the PMD should return a RTE_FLOW_ERROR_TYPE_ACTION error. 😭

  • RTE_FLOW_ACTION_TYPE_NVGRE_ENCAP — Encapsulate flow in NVGRE tunnel defined in the rte_flow_action_nvgre_encap action structure.

See struct rte_flow_action_nvgre_encap.

  • RTE_FLOW_ACTION_TYPE_NVGRE_DECAP — Decapsulate outer most NVGRE tunnel from matched flow.

If flow pattern does not define a valid NVGRE tunnel (as specified by RFC7637) then the PMD should return a RTE_FLOW_ERROR_TYPE_ACTION error. 😭

  • RTE_FLOW_ACTION_TYPE_RAW_ENCAP — Add outer header whose template is provided in its data buffer

See struct rte_flow_action_raw_encap.

  • RTE_FLOW_ACTION_TYPE_RAW_DECAP — Remove outer header whose template is provided in its data buffer.

See struct rte_flow_action_raw_decap

  • RTE_FLOW_ACTION_TYPE_SET_IPV4_SRC
Warning: This is a legacy action. 🫠

See also:

  • RTE_FLOW_ACTION_TYPE_MODIFY_FIELD

Modify IPv4 source address in the outermost IPv4 header.

If flow pattern does not define a valid RTE_FLOW_ITEM_TYPE_IPV4, then the PMD should return a RTE_FLOW_ERROR_TYPE_ACTION error.

See struct rte_flow_action_set_ipv4.

  • RTE_FLOW_ACTION_TYPE_SET_IPV4_DST
Warning: This is a legacy action. 🫠

See also: RTE_FLOW_ACTION_TYPE_MODIFY_FIELD ✨

Changes the IPv4 destination address in the outermost IPv4 header. 🎯 If the flow pattern doesn't give you a valid RTE_FLOW_ITEM_TYPE_IPV4, then the PMD should hand back a RTE_FLOW_ERROR_TYPE_ACTION error. No item, no action, no exceptions.

See struct rte_flow_action_set_ipv4


RTE_FLOW_ACTION_TYPE_SET_IPV6_SRC

⚠️ Warning: this is a legacy action.

See also: RTE_FLOW_ACTION_TYPE_MODIFY_FIELD ✨

Changes the IPv6 source address in the outermost IPv6 header. 🌸 If the flow pattern doesn't define a valid RTE_FLOW_ITEM_TYPE_IPV6, the PMD should return a RTE_FLOW_ERROR_TYPE_ACTION error.

See struct rte_flow_action_set_ipv6


RTE_FLOW_ACTION_TYPE_SET_IPV6_DST

⚠️ Warning: this is a legacy action.

See also: RTE_FLOW_ACTION_TYPE_MODIFY_FIELD ✨

Changes the IPv6 destination address in the outermost IPv6 header. 💫 Same dealio: if the flow pattern doesn't define a valid RTE_FLOW_ITEM_TYPE_IPV6, the PMD should return a RTE_FLOW_ERROR_TYPE_ACTION error.

See struct rte_flow_action_set_ipv6


RTE_FLOW_ACTION_TYPE_SET_TP_SRC

⚠️ Warning: this is a legacy action.

See also: RTE_FLOW_ACTION_TYPE_MODIFY_FIELD ✨

Changes the source port number in the outermost TCP/UDP header. 🧚 If the flow pattern doesn't define a valid RTE_FLOW_ITEM_TYPE_TCP or RTE_FLOW_ITEM_TYPE_UDP, the PMD should return a RTE_FLOW_ERROR_TYPE_ACTION error.

See struct rte_flow_action_set_tp


RTE_FLOW_ACTION_TYPE_SET_TP_DST

⚠️ Warning: this is a legacy action.

See also: RTE_FLOW_ACTION_TYPE_MODIFY_FIELD ✨

Changes the destination port number in the outermost TCP/UDP header. 🎀 If the flow pattern doesn't define a valid RTE_FLOW_ITEM_TYPE_TCP or RTE_FLOW_ITEM_TYPE_UDP, the PMD should return a RTE_FLOW_ERROR_TYPE_ACTION error.

See struct rte_flow_action_set_tp


RTE_FLOW_ACTION_TYPE_MAC_SWAP

Swaps the source and destination MAC addresses in the outermost Ethernet header. 🔁 If the flow pattern doesn't define a valid RTE_FLOW_ITEM_TYPE_ETH, the PMD should return a RTE_FLOW_ERROR_TYPE_ACTION error.

No associated configuration structure. (she's low maintenance fr)


RTE_FLOW_ACTION_TYPE_DEC_TTL

⚠️ Warning: this is a legacy action.

See also: RTE_FLOW_ACTION_TYPE_MODIFY_FIELD ✨

Decreases the TTL value directly. 📉

No associated configuration structure.


RTE_FLOW_ACTION_TYPE_SET_TTL

⚠️ Warning: this is a legacy action.

See also: RTE_FLOW_ACTION_TYPE_MODIFY_FIELD ✨

Sets the TTL value. ⏱️

See struct rte_flow_action_set_ttl


RTE_FLOW_ACTION_TYPE_SET_MAC_SRC

⚠️ Warning: this is a legacy action.

See also: RTE_FLOW_ACTION_TYPE_MODIFY_FIELD ✨

Sets the source MAC address from the matched flow. 📬 If the flow pattern doesn't define a valid RTE_FLOW_ITEM_TYPE_ETH, the PMD should return a RTE_FLOW_ERROR_TYPE_ACTION error.

See struct rte_flow_action_set_mac


RTE_FLOW_ACTION_TYPE_SET_MAC_DST

⚠️ Warning: this is a legacy action.

See also: RTE_FLOW_ACTION_TYPE_MODIFY_FIELD ✨

Sets the destination MAC address from the matched flow. 📮 If the flow pattern doesn't define a valid RTE_FLOW_ITEM_TYPE_ETH, the PMD should return a RTE_FLOW_ERROR_TYPE_ACTION error.

See struct rte_flow_action_set_mac


RTE_FLOW_ACTION_TYPE_INC_TCP_SEQ

⚠️ Warning: this is a legacy action.

See also: RTE_FLOW_ACTION_TYPE_MODIFY_FIELD ✨

Increases the sequence number in the outermost TCP header. ⬆️ The action configuration specifies the value to increase the TCP sequence number by, as a big-endian 32 bit integer.

conf type: rte_be32_t *

💀 Using this action on non-matching traffic will result in undefined behavior. Not cute, not iconic, just chaos.

RTE_FLOW_ACTION_TYPE_DEC_TCP_SEQ

⚠️ Warning: this is a legacy action.

See also: RTE_FLOW_ACTION_TYPE_MODIFY_FIELD ✨

Decreases the sequence number in the outermost TCP header. ⬇️ The action configuration specifies the value to decrease the TCP sequence number by, as a big-endian 32 bit integer.

conf type: rte_be32_t *

💀 Using this action on non-matching traffic will result in undefined behavior.

RTE_FLOW_ACTION_TYPE_INC_TCP_ACK

⚠️ Warning: this is a legacy action.

See also: RTE_FLOW_ACTION_TYPE_MODIFY_FIELD ✨

Increases the acknowledgment number in the outermost TCP header. ⬆️ The action configuration specifies the value to increase the TCP acknowledgment number by, as a big-endian 32 bit integer.

conf type: rte_be32_t *

💀 Using this action on non-matching traffic will result in undefined behavior.

RTE_FLOW_ACTION_TYPE_DEC_TCP_ACK

⚠️ Warning: this is a legacy action.

See also: RTE_FLOW_ACTION_TYPE_MODIFY_FIELD ✨

Decreases the acknowledgment number in the outermost TCP header. ⬇️ The action configuration specifies the value to decrease the TCP acknowledgment number by, as a big-endian 32 bit integer.

conf type: rte_be32_t *

💀 Using this action on non-matching traffic will result in undefined behavior.

RTE_FLOW_ACTION_TYPE_SET_TAG

⚠️ Warning: this is a legacy action.

See also: RTE_FLOW_ACTION_TYPE_MODIFY_FIELD ✨

Sets the Tag. 🏷️ Heads up bestie: the Tag is for internal flow usage only and is not delivered to the application.

See struct rte_flow_action_set_tag


RTE_FLOW_ACTION_TYPE_SET_META

⚠️ Warning: this is a legacy action.

See also: RTE_FLOW_ACTION_TYPE_MODIFY_FIELD ✨

Sets metadata on the ingress or egress path. 🪄

See struct rte_flow_action_set_meta


RTE_FLOW_ACTION_TYPE_SET_IPV4_DSCP

⚠️ Warning: this is a legacy action.

See also: RTE_FLOW_ACTION_TYPE_MODIFY_FIELD ✨

Changes the IPv4 DSCP in the outermost IP header. 🌈 If the flow pattern doesn't define a valid RTE_FLOW_ITEM_TYPE_IPV4, then the PMD should return a RTE_FLOW_ERROR_TYPE_ACTION error.

See struct rte_flow_action_set_dscp


RTE_FLOW_ACTION_TYPE_SET_IPV6_DSCP

⚠️ Warning: this is a legacy action.

See also: RTE_FLOW_ACTION_TYPE_MODIFY_FIELD ✨

Changes the IPv6 DSCP in the outermost IP header. 🌈 If the flow pattern doesn't define a valid RTE_FLOW_ITEM_TYPE_IPV6, then the PMD should return a RTE_FLOW_ERROR_TYPE_ACTION error.

See struct rte_flow_action_set_dscp


RTE_FLOW_ACTION_TYPE_AGE

Reports the flow as aged if the timeout passed without any matching on the flow. ⏳

See struct rte_flow_action_age See function rte_flow_get_q_aged_flows See function rte_flow_get_aged_flows See enum RTE_ETH_EVENT_FLOW_AGED See struct rte_flow_query_age See struct rte_flow_update_age


RTE_FLOW_ACTION_TYPE_SAMPLE

The matching packets will be duplicated with the specified ratio and applied with their own set of actions, with a fate action. 🎲✨

See struct rte_flow_action_sample


RTE_FLOW_ACTION_TYPE_SHARED

🚫 Deprecated.

See also: RTE_FLOW_ACTION_TYPE_INDIRECT

Describes an action shared across multiple flow rules. 👯 Allows multiple rules to reference the same action by handle (see struct rte_flow_shared_action).


RTE_FLOW_ACTION_TYPE_MODIFY_FIELD

Modifies a packet header field, tag, mark or metadata. 🛠️

Lets you modify an arbitrary header field via set, add and sub operations, or copy its content into tag, meta or mark for future processing.

See struct rte_flow_action_modify_field


RTE_FLOW_ACTION_TYPE_INDIRECT

An action handle is referenced in a rule through an indirect action. 🔗

The same action handle may be used in multiple rules, for the same or different ethdev ports.


RTE_FLOW_ACTION_TYPE_CONNTRACK

[META] 🧠

Enables tracking of a TCP connection state.

See also: struct rte_flow_action_conntrack


RTE_FLOW_ACTION_TYPE_METER_COLOR

Colors the packet to reflect the meter color result. 🎨 Sets the meter color in the mbuf to the selected color.

See struct rte_flow_action_meter_color


RTE_FLOW_ACTION_TYPE_PORT_REPRESENTOR

At embedded switch level, sends matching traffic to the given ethdev. 🔌

See also: struct rte_flow_action_ethdev


RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT

At embedded switch level, sends matching traffic to the entity represented by the given ethdev. 🪞

See also: struct rte_flow_action_ethdev


RTE_FLOW_ACTION_TYPE_METER_MARK

Traffic metering and marking (MTR). 📏

See also: struct rte_flow_action_meter_mark — see file rte_mtr.h for MTR profile object configuration.


RTE_FLOW_ACTION_TYPE_SEND_TO_KERNEL

Sends packets to the kernel, without going to userspace at all. 🐧➡️ The packets will be received by the kernel driver sharing the same device as the DPDK port on which this action is configured. This action mostly suits the bifurcated driver model.

No associated configuration structure.


RTE_FLOW_ACTION_TYPE_QUOTA

Applies the quota verdict (PASS or BLOCK) to a flow. 🚦

See also:

  • struct rte_flow_action_quota
  • struct rte_flow_query_quota
  • struct rte_flow_update_quota

RTE_FLOW_ACTION_TYPE_SKIP_CMAN

Skips congestion management configuration. 🚧

Using rte_eth_cman_config_set(), the application can configure the ethdev Rx queue's congestion mechanism. This flow action allows you to skip the congestion configuration applied to the given ethdev Rx queue. ✨


RTE_FLOW_ACTION_TYPE_IPV6_EXT_PUSH

RTE_FLOW_ACTION_TYPE_IPV6_EXT_PUSH 📥

Pushes an IPv6 extension into an IPv6 packet.

See also: struct rte_flow_action_ipv6_ext_push


RTE_FLOW_ACTION_TYPE_IPV6_EXT_REMOVE

RTE_FLOW_ACTION_TYPE_IPV6_EXT_REMOVE 📤

Removes an IPv6 extension from an IPv6 packet whose type is provided in its configuration buffer.

See also: struct rte_flow_action_ipv6_ext_remove


RTE_FLOW_ACTION_TYPE_INDIRECT_LIST

An action handle to reference a flow actions list. 📋

See also: struct rte_flow_action_indirect_list


RTE_FLOW_ACTION_TYPE_PROG

Program action. 🧑‍💻 These actions are defined by the program currently loaded on the device. For example, these actions are applicable to devices that can be programmed through the P4 language.

See also: struct rte_flow_action_prog


RTE_FLOW_ACTION_TYPE_NAT64

NAT64 translation of IPv4/IPv6 headers. 🔄

See also: struct rte_flow_action_nat64


RTE_FLOW_ACTION_TYPE_JUMP_TO_TABLE_INDEX

RTE_FLOW_ACTION_TYPE_JUMP_TO_TABLE_INDEX, 🦘

Redirects packets to a particular index in a flow table.

See also: struct rte_flow_action_jump_to_table_index


Definition at line 2590 of file rte_flow.h.


enum rte_flow_quota_mode

⚠️ Warning: EXPERIMENTAL: this API may change without prior notice. 👀

QUOTA operational mode. 🎛️

See also: struct rte_flow_action_quota


Enumerator

RTE_FLOW_QUOTA_MODE_PACKET

Counts packets. 🔢

  • RTE_FLOW_QUOTA_MODE_L2 — counts packet bytes starting from L2. yes bestie, from the top, layer 2, all of it 💖
  • RTE_FLOW_QUOTA_MODE_L3 — counts packet bytes starting from L3 instead. pick your lane ✨

Definition at line 3276 of file rte_flow.h.


enum rte_flow_update_quota_op

⚠️ EXPERIMENTAL: this API may change without prior notice. like fr fr, it might just ghost you 😭

Indirect QUOTA update operations. okay so you're not setting the quota directly, you're telling the hardware what kind of update to do to it. iconic delegation 💅

See also: struct rte_flow_update_quota

Enumerator

  • RTE_FLOW_UPDATE_QUOTA_SET — set a new quota value. brand new number, who dis 🌸
  • RTE_FLOW_UPDATE_QUOTA_ADD — increase the quota value. just add to the pile, no cap 📈

Definition at line 3315 of file rte_flow.h.


enum rte_flow_nat64_type

NAT64 translation type for IP headers. translating between the v6 and v4 universes, glow-up edition 🦋

Enumerator

  • RTE_FLOW_NAT64_6TO4 — IPv6 to IPv4 header translation.
  • RTE_FLOW_NAT64_4TO6 — IPv4 to IPv6 header translation.

Definition at line 3607 of file rte_flow.h.


enum rte_flow_conntrack_state

The state of a TCP connection. it's giving relationship status, except the relationship is a 3-way handshake 💀

Enumerator

  • RTE_FLOW_CONNTRACK_STATE_SYN_RECV — a SYN-ACK packet was seen.
  • RTE_FLOW_CONNTRACK_STATE_ESTABLISHED — the 3-way handshake was done. they're official now 🫶
  • RTE_FLOW_CONNTRACK_STATE_FIN_WAIT — the first FIN packet was received to close the connection.
  • RTE_FLOW_CONNTRACK_STATE_CLOSE_WAIT — the first FIN was ACKed.
  • RTE_FLOW_CONNTRACK_STATE_LAST_ACK — the second FIN was received, and it's waiting for the last ACK.
  • RTE_FLOW_CONNTRACK_STATE_TIME_WAIT — the second FIN was ACKed, and the connection was closed. it's over, periodt 🌈

Definition at line 3953 of file rte_flow.h.


enum rte_flow_conntrack_tcp_last_index

The last passed TCP packet flags of a connection. literally "what did the last packet flag look like" — receipts, basically 🎀

Enumerator

  • RTE_FLOW_CONNTRACK_FLAG_NONE — no flag.
  • RTE_FLOW_CONNTRACK_FLAG_SYN — with SYN flag.
  • RTE_FLOW_CONNTRACK_FLAG_SYNACK — with SYNACK flag.
  • RTE_FLOW_CONNTRACK_FLAG_FIN — with FIN flag.
  • RTE_FLOW_CONNTRACK_FLAG_ACK — with ACK flag.
  • RTE_FLOW_CONNTRACK_FLAG_RST — with RST flag. the dramatic exit 💅

Definition at line 3971 of file rte_flow.h.


enum rte_flow_modify_op

Operation types for the MODIFY_FIELD action. three little modes, that's it, that's the whole menu ✨

Enumerator

  • RTE_FLOW_MODIFY_SET — set a new value.
  • RTE_FLOW_MODIFY_ADD — add a value to a field.
  • RTE_FLOW_MODIFY_SUB — subtract a value from a field.

Definition at line 4123 of file rte_flow.h.


enum rte_flow_error_type

Verbose error types. mostly, these give you the type of the object referenced by struct rte_flow_error.cause — i.e. which thing we're blaming when it all goes wrong 🙈

Enumerator

  • RTE_FLOW_ERROR_TYPE_NONE — no error. we love a clean slate 💖
  • RTE_FLOW_ERROR_TYPE_UNSPECIFIED — cause unspecified. the classic "it's not you it's… something"
  • RTE_FLOW_ERROR_TYPE_HANDLE — flow rule (handle).
  • RTE_FLOW_ERROR_TYPE_ATTR_GROUP — group field.
  • RTE_FLOW_ERROR_TYPE_ATTR_PRIORITY — priority field.
  • RTE_FLOW_ERROR_TYPE_ATTR_INGRESS — ingress field.
  • RTE_FLOW_ERROR_TYPE_ATTR_EGRESS — egress field.
  • RTE_FLOW_ERROR_TYPE_ATTR_TRANSFER — transfer field.
  • RTE_FLOW_ERROR_TYPE_ATTR — attributes structure.
  • RTE_FLOW_ERROR_TYPE_ITEM_NUM — pattern length.
  • RTE_FLOW_ERROR_TYPE_ITEM_SPEC — item specification.
  • RTE_FLOW_ERROR_TYPE_ITEM_LAST — item specification range.
  • RTE_FLOW_ERROR_TYPE_ITEM_MASK — item specification mask.
  • RTE_FLOW_ERROR_TYPE_ITEM — specific pattern item.
  • RTE_FLOW_ERROR_TYPE_ACTION_NUM — number of actions.
  • RTE_FLOW_ERROR_TYPE_ACTION_CONF — action configuration.
  • RTE_FLOW_ERROR_TYPE_ACTION — specific action.
  • RTE_FLOW_ERROR_TYPE_STATE — current device state.

Definition at line 4346 of file rte_flow.h.


enum rte_flow_conv_op

Conversion operations for flow API objects. this is the shapeshifter enum, bestie, it does a lot of different little jobs 🧚

See also: rte_flow_conv()

Enumerator

  • RTE_FLOW_CONV_OP_NONE — no operation to perform. rte_flow_conv() simply returns 0. lowkey the chillest option here 💜
  • RTE_FLOW_CONV_OP_ATTR — convert an attributes structure. this is a basic copy of an attributes structure.
    • src type:
const struct rte_flow_attr *
  • dst type:
struct rte_flow_attr *
  • RTE_FLOW_CONV_OP_ITEM — convert a single item. duplicates spec, last and mask but not outside objects.
    • src type:
const struct rte_flow_item *
  • dst type:
struct rte_flow_item *
  • RTE_FLOW_CONV_OP_ITEM_MASK — convert a single item mask. duplicates only mask. ok minimalist queen ✨
    • src type:
const struct rte_flow_item *
  • dst type:
struct rte_flow_item *
  • RTE_FLOW_CONV_OP_ACTION — convert a single action. duplicates conf but not outside objects.
    • src type:
const struct rte_flow_action *
  • dst type:
struct rte_flow_action *
  • RTE_FLOW_CONV_OP_PATTERN — convert an entire pattern. duplicates all pattern items at once with the same constraints as RTE_FLOW_CONV_OP_ITEM.
    • src type:
const struct rte_flow_item *
  • dst type:
struct rte_flow_item *
  • RTE_FLOW_CONV_OP_ACTIONS — convert a list of actions. duplicates the entire list of actions at once with the same constraints as RTE_FLOW_CONV_OP_ACTION.
    • src type:
const struct rte_flow_action *
  • dst type:
struct rte_flow_action *
  • RTE_FLOW_CONV_OP_RULE — convert a complete flow rule description. comprises attributes, pattern and actions together at once with the usual constraints. the whole fit, head to toe 🔥
    • src type:
const struct rte_flow_conv_rule *
  • dst type:
struct rte_flow_conv_rule *
  • RTE_FLOW_CONV_OP_ITEM_NAME — convert an item type to its name string. writes a NUL-terminated string to dst. Like snprintf(), the returned value excludes the terminator which is always written nonetheless.
    • src type:
(const void *)enum rte_flow_item_type
  • dst type:
char *
  • RTE_FLOW_CONV_OP_ACTION_NAME — convert an action type to its name string. writes a NUL-terminated string to dst. Like snprintf(), the returned value excludes the terminator which is always written nonetheless.
    • src type:
(const void *)enum rte_flow_action_type
  • dst type:
char *
  • RTE_FLOW_CONV_OP_ITEM_NAME_PTR — convert an item type to a pointer to the item name. retrieves the item name pointer from its type. the string itself is not copied; instead, a unique pointer to an internal static constant storage is written to dst.
    • src type:
(const void *)enum rte_flow_item_type
  • dst type:
const char **
  • RTE_FLOW_CONV_OP_ACTION_NAME_PTR — convert an action type to a pointer to the action name. retrieves the action name pointer from its type. the string itself is not copied; instead, a unique pointer to an internal static constant storage is written to dst.
    • src type:
(const void *)enum rte_flow_action_type
  • dst type:
const char **

Definition at line 4412 of file rte_flow.h.


enum rte_flow_table_insertion_type

⚠️ EXPERIMENTAL: this API may change without prior notice. she's still in her testing era 💅

Template table flow rules insertion type. how do the rules get in there, bestie? three ways 🎀

Enumerator

  • RTE_FLOW_TABLE_INSERTION_TYPE_PATTERN — pattern-based insertion.
  • RTE_FLOW_TABLE_INSERTION_TYPE_INDEX — index-based insertion.
  • RTE_FLOW_TABLE_INSERTION_TYPE_INDEX_WITH_PATTERN — index-based insertion with pattern. okay versatile ✨

Definition at line 5907 of file rte_flow.h.


enum rte_flow_table_hash_func

⚠️ EXPERIMENTAL: this API may change without prior notice.

Template table hash index calculation function. pick your hash math, babe 🔢

Enumerator

  • RTE_FLOW_TABLE_HASH_FUNC_DEFAULT — default hash calculation.
  • RTE_FLOW_TABLE_HASH_FUNC_LINEAR — linear hash calculation.
  • RTE_FLOW_TABLE_HASH_FUNC_CRC32 — 32-bit checksum hash calculation.
  • RTE_FLOW_TABLE_HASH_FUNC_CRC16 — 16-bit checksum hash calculation.

Definition at line 5928 of file rte_flow.h.


enum rte_flow_op_status

⚠️ EXPERIMENTAL: this API may change without prior notice.

Asynchronous operation status. did the async thing cook, or did it burn 😭

Enumerator

  • RTE_FLOW_OP_SUCCESS — the operation was completed successfully. ate and left no crumbs 🔥
  • RTE_FLOW_OP_ERROR — the operation was not completed successfully. it's giving flop, unfortunately 💀

Definition at line 6368 of file rte_flow.h.


enum rte_flow_query_update_mode

⚠️ EXPERIMENTAL: this API may change without prior notice.

Query and update operational mode. which one happens first, bestie? that's the whole question 👀

See also:

  • rte_flow_action_handle_query_update()
  • rte_flow_async_action_handle_query_update()

Enumerator

  • RTE_FLOW_QU_QUERY_FIRST — query before update.
  • RTE_FLOW_QU_UPDATE_FIRST — query after update. okay so the label says "update first" and the description says query after — and yes, same thing, we did clock that 🙈

Definition at line 6593 of file rte_flow.h.


enum rte_flow_encap_hash_field

⚠️ EXPERIMENTAL: this API may change without prior notice.

Destination field type for the hash calculation, when the encap action is used. and listen — the encap field implies the size, meaning XXX_SRC_PORT hash len is 2 bytes, while XXX_NVGRE_FLOW_ID hash len is 1 byte. the field IS the length, no separate arg, periodt 💅

See also: function rte_flow_calc_encap_hash

Enumerator

  • RTE_FLOW_ENCAP_HASH_FIELD_SRC_PORT — calculate hash placed in the UDP source port field.
  • RTE_FLOW_ENCAP_HASH_FIELD_NVGRE_FLOW_ID — calculate hash placed in the NVGRE flow ID field.

Definition at line 6990 of file rte_flow.h.


🛠️ Function Documentation 🛠️

__rte_experimental int rte_flow_dev_dump ( uint16_t port_id, struct rte_flow * flow, FILE * file, struct rte_flow_error * error )

⚠️ EXPERIMENTAL: this API may change without prior notice.

Dump hardware internal representation information of rte flow to file. peek behind the curtain, bestie — the hardware's actual internal glow-up of your rule 👑

Parameters

  • port_id — the port identifier of the Ethernet device.
  • flow — the pointer of flow rule to dump. Dump all rules if NULL. no faves, we dumping everyone 🌈
  • file — a pointer to a file for output.
  • error — perform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.

Returns

0 on success, a negative value otherwise.


__rte_experimental int rte_flow_dynf_metadata_avail ( void ) [inline], [static]

Check if the mbuf dynamic field for metadata is registered. is it there or not, simple as 💖

Returns

True if registered, false otherwise.

Definition at line 4596 of file rte_flow.h.


__rte_experimental int rte_flow_dynf_metadata_register ( void )

Register the mbuf dynamic field and flag for metadata. 🎀

This function must be called prior to use the SET_META action in order to register the dynamic mbuf field. Otherwise, the data cannot be delivered to the application. literally no registration = no data, do not skip this step bestie 😭

Returns

0 on success, a negative errno value otherwise and rte_errno is set.


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 )

Check whether a flow rule can be created on a given port. vibe check before you commit, essentially ✨

The flow rule gets validated for correctness, and also for whether the device would actually accept it given sufficient resources. It's checked against the current device mode and queue config, and it may optionally also be validated against existing flow rules and device resources. Bestie, this one has zero effect on the target device — it's a vibe check, not a commitment. 💅

The returned value is only guaranteed to stay valid as long as nobody successfully calls rte_flow_create() or rte_flow_destroy() in the meantime, and as long as no device parameter that affects flow rules in any way gets modified — because collisions or resource limitations can happen (though in those cases EINVAL should not be returned, so like... it's not that kind of failure).

Parameters

  • port_id — Port identifier of Ethernet device.
  • attr — Flow rule attributes.
  • pattern — Pattern specification (list terminated by the END pattern item).
  • actions — Associated actions (list terminated by the END action).
  • error — Perform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.

Returns

0 if the flow rule is valid and can be created. A negative errno value otherwise (rte_errno is also set). The following errors are defined:

  • -ENOSYS: underlying device does not support this functionality.
  • -EIO: underlying device is removed.
  • -EINVAL: unknown or invalid rule specification.
  • -ENOTSUP: valid but unsupported rule specification (e.g. partial bit-masks are unsupported).
  • -EEXIST: collision with an existing rule. Only returned if device supports flow rule collision checking and there was a flow rule collision. Not receiving this return code is no guarantee that creating the rule will not fail due to a collision.
  • -ENOMEM: not enough memory to execute the function, or if the device supports resource validation, resource limitation on the device.
  • -EBUSY: action cannot be performed due to busy device resources, may succeed if the affected queues or even the entire port are in a stopped state (see rte_eth_dev_rx_queue_stop() and rte_eth_dev_stop()).

🌈 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)

Create a flow rule on a given port. ✨

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)

Parameters

  • port_id — Port identifier of Ethernet device.
  • attr — Flow rule attributes.
  • pattern — Pattern specification (list terminated by the END pattern item).
  • actions — Associated actions (list terminated by the END action).
  • error — Perform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.

Returns

A valid handle in case of success, NULL otherwise and rte_errno is set to the positive version of one of the error codes defined for rte_flow_validate().


💖 int rte_flow_destroy (uint16_t port_id, struct rte_flow * flow, struct rte_flow_error * error)

Destroy a flow rule on a given port.

int rte_flow_destroy (uint16_t port_id, struct rte_flow * flow, struct rte_flow_error * error)

Not being able to destroy a flow rule handle can happen when other flow rules depend on it, and destroying it would result in an inconsistent state. 😭

This function is only guaranteed to succeed if handles are destroyed in reverse order of their creation. iykyk.

Parameters

  • port_id — Port identifier of Ethernet device.
  • flow — Flow rule handle to destroy.
  • error — Perform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.

Returns

0 on success, a negative errno value otherwise and rte_errno is set.


🧚 __rte_experimental int rte_flow_actions_update (uint16_t port_id, struct rte_flow * flow, const struct rte_flow_action actions[], struct rte_flow_error * error)

Update a flow rule with new actions on a given port.

__rte_experimental int rte_flow_actions_update (uint16_t port_id, struct rte_flow * flow, const struct rte_flow_action actions[], struct rte_flow_error * error)

Parameters

  • port_id — Port identifier of Ethernet device.
  • flow — Flow rule handle to update.
  • actions — Associated actions (list terminated by the END action).
  • error — Perform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.

Returns

0 on success, a negative errno value otherwise and rte_errno is set.


🎀 int rte_flow_flush (uint16_t port_id, struct rte_flow_error * error)

Destroy all flow rules associated with a port. All of them. Every single one. 🫶

int rte_flow_flush (uint16_t port_id, struct rte_flow_error * error)

In the unlikely event of failure, handles are still considered destroyed and no longer valid, but the port must be assumed to be in an inconsistent state. That part matters, bestie.

Parameters

  • port_id — Port identifier of Ethernet device.
  • error — Perform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.

Returns

0 on success, a negative errno value otherwise and rte_errno is set.


🦋 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)

Query an existing flow rule.

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)

This function lets you retrieve flow-specific data, like counters. 🔢 The data is gathered by special actions which must be present in the flow rule definition — no action in the rule, no data to gather.

See also

RTE_FLOW_ACTION_TYPE_COUNT

Parameters

  • port_id — Port identifier of Ethernet device.
  • flow — Flow rule handle to query.
  • action — Action definition as defined in original flow rule.
  • data — Pointer to storage for the associated query data type.
  • error — Perform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.

Returns

0 on success, a negative errno value otherwise and rte_errno is set.


👑 int rte_flow_isolate (uint16_t port_id, int set, struct rte_flow_error * error)

Restrict ingress traffic to the defined flow rules. Main character energy: if it's not in a flow rule, it's not coming in. 💅

int rte_flow_isolate (uint16_t port_id, int set, struct rte_flow_error * error)

Isolated mode guarantees that all ingress traffic comes from defined flow rules only (current and future). When enabled with a bifurcated driver, non-matched packets are routed to the kernel driver interface. When disabled (the default), there may be some default rules routing traffic to the DPDK port.

Besides making ingress more deterministic, it lets PMDs safely reuse resources that would otherwise be assigned to handling the remaining traffic — stuff like global RSS configuration settings, VLAN filters, MAC address entries, legacy filter API rules and so on — in order to expand the set of possible flow rule types. ✨

Calling this function as soon as possible after device initialization, ideally before the first call to rte_eth_dev_configure(), is recommended to avoid possible failures due to conflicting settings. Don't wait on it, fr fr.

Once effective, leaving isolated mode may not be possible depending on PMD implementation. 😭

Additionally, the following functionality has no effect on the underlying port and may return errors such as ENOTSUP ("not supported"):

  • Toggling promiscuous mode.
  • Toggling allmulticast mode.
  • Configuring MAC addresses.
  • Configuring multicast addresses.
  • Configuring VLAN filters.
  • Configuring Rx filters through the legacy API (e.g. FDIR).
  • Configuring global RSS settings.

Parameters

  • port_id — Port identifier of Ethernet device.
  • set — Nonzero to enter isolated mode, attempt to leave it otherwise.
  • error — Perform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.

Returns

0 on success, a negative errno value otherwise and rte_errno is set.


🔥 int rte_flow_error_set (struct rte_flow_error * error, int code, enum rte_flow_error_type type, const void * cause, const char * message)

Initialize flow error structure.

int rte_flow_error_set (struct rte_flow_error * error, int code, enum rte_flow_error_type type, const void * cause, const char * message)

Parameters

  • error — Pointer to flow error structure (may be NULL).
  • code — Related error code (rte_errno).
  • type — Cause field and error types.
  • cause — Object responsible for the error.
  • message — Human-readable error message.

Returns

Negative error code (errno value) and rte_errno is set.


💀 __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)

Deprecated Copy an rte_flow rule description.

__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)
This interface is kept for compatibility with older applications but is implemented as a wrapper to rte_flow_conv(). It is deprecated due to its lack of flexibility and reliance on a type unusable with C++ programs (struct rte_flow_desc).

Parameters

  • fd — Flow rule description.
  • len — Total size of allocated data for the flow description.
  • attr — Flow rule attributes.
  • items — Pattern specification (list terminated by the END pattern item).
  • actions — Associated actions (list terminated by the END action).

Returns

If len is greater or equal to the size of the flow, the total size of the flow description and its data. If len is lower than the size of the flow, the number of bytes that would have been written to desc had it been sufficient. Nothing is written.


🌸 __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)

Flow object conversion helper. 🧚

__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)

This function converts various flow API objects into a pre-allocated destination buffer. Peep enum rte_flow_conv_op for the possible operations and the details about each of them.

Since the destination buffer must be large enough, it works in a manner reminiscent of snprintf():

  • If size is 0, dst may be a NULL pointer, otherwise dst must be non-NULL.
  • If positive, the returned value represents the number of bytes needed to store the conversion of src to dst according to op regardless of the size parameter.
  • Since no more than size bytes can be written to dst, output is truncated and may be inconsistent when the returned value is larger than that.
  • In case of conversion error, a negative error code is returned and dst contents are unspecified.

Parameters

  • op — Operation to perform, related to the object type of dst.
  • dst — Destination buffer address. Must be suitably aligned by the caller.
  • size — Destination buffer size in bytes.
  • src — Source object to copy. Depending on op, its type may differ from that of dst.
  • error — Perform verbose error reporting if not NULL. Initialized in case of error only.

Returns

The number of bytes required to convert src to dst on success, a negative errno value otherwise and rte_errno is set.

See also

rte_flow_conv_op


💜 __rte_experimental int rte_flow_get_aged_flows (uint16_t port_id, void ** contexts, uint32_t nb_contexts, struct rte_flow_error * error)

Get aged-out flows of a given port.

__rte_experimental int rte_flow_get_aged_flows (uint16_t port_id, void ** contexts, uint32_t nb_contexts, struct rte_flow_error * error)

RTE_ETH_EVENT_FLOW_AGED ping goes off the second even ONE new aged-out flow shows up after the last time you called rte_flow_get_aged_flows. 💀 So like, you can totally call this function to scoop up those aged flows async from inside the event callback, OR sync whenever you want, event or no event. Pick your vibe.

ok but fr fr be careful: it is not safe to call rte_flow_get_aged_flows at the same time as other flow functions from multiple threads. That's a recipe for chaos bestie, don't do it. 🙈

Parameters ✨

  • port_id — Port identifier of Ethernet device.
  • contexts — The address of an array of pointers to the aged-out flows contexts.
  • nb_contexts — The length of context array pointers.
  • error — Perform verbose error reporting if not NULL. Initialized in case of error only.

Returns 💖

  • if nb_contexts is 0, return the amount of all aged contexts.
  • if nb_contexts is not 0, return the amount of aged flows reported in the context array, otherwise negative errno value.

See also 🫶

  • rte_flow_action_age
  • RTE_ETH_EVENT_FLOW_AGED

🌸 __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)

Warning ⚠️ EXPERIMENTAL: this API may change without prior notice. It's giving "we might redo this at any moment" energy, so heads up.

Get the aged-out flows of a given port on the given flow queue. 🎀

If your application configures the port attribute with RTE_FLOW_PORT_FLAG_STRICT_QUEUE, then surprise — there is no RTE_ETH_EVENT_FLOW_AGED event at all, and you MUST call this function to get the aged flows synchronously. No event to wait for, you're on your own, queen. 💅

If your application configures the port attribute without RTE_FLOW_PORT_FLAG_STRICT_QUEUE, then RTE_ETH_EVENT_FLOW_AGED will be triggered as soon as at least one new aged-out flow is detected on any flow queue after the last call to rte_flow_get_q_aged_flows. Also — cute detail — the queue_id will be ignored. This function can be called to get the aged flows asynchronously from the event callback, or synchronously regardless of the event. ✨

Parameters 🌈

  • port_id — Port identifier of Ethernet device.
  • queue_id — Flow queue to query. Ignored when RTE_FLOW_PORT_FLAG_STRICT_QUEUE not set.
  • contexts — The address of an array of pointers to the aged-out flows contexts.
  • nb_contexts — The length of context array pointers.
  • error — Perform verbose error reporting if not NULL. Initialized in case of error only.

Returns 🍓

  • if nb_contexts is 0, return the amount of all aged contexts.
  • if nb_contexts is not 0, return the amount of aged flows reported in the context array, otherwise negative errno value.

See also 👑

  • rte_flow_action_age
  • RTE_ETH_EVENT_FLOW_AGED
  • rte_flow_port_flag

💜 __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)

Warning ⚠️ EXPERIMENTAL: this API may change without prior notice.

Create an indirect action object that can be used in flow rules via its handle. The created object handle has single state and configuration across all the flow rules using it — one handle, one truth, main character energy. 👑

Parameters 🎀

  • port_id — The port identifier of the Ethernet device.
  • conf — Action configuration for the indirect action object creation.
  • action — Specific configuration of the indirect action object.
  • error — Perform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.

Returns ✨

A valid handle in case of success, NULL otherwise and rte_errno is set to one of the error codes defined:

  • (ENODEV) if port_id invalid.
  • (ENOSYS) if underlying device does not support this functionality.
  • (EIO) if underlying device is removed.
  • (EINVAL) if action invalid.
  • (ENOTSUP) if action valid but unsupported.

🦋 __rte_experimental int rte_flow_action_handle_destroy (uint16_t port_id, struct rte_flow_action_handle * handle, struct rte_flow_error * error)

Warning ⚠️ EXPERIMENTAL: this API may change without prior notice.

Destroy indirect action by handle. Bye bye, gone, no longer iconic. 💀

Parameters 💖

  • port_id — The port identifier of the Ethernet device.
  • handle — Handle for the indirect action object to be destroyed.
  • error — Perform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.

Returns 🌸

  • (0) if success.
  • (-ENODEV) if port_id invalid.
  • (-ENOSYS) if underlying device does not support this functionality.
  • (-EIO) if underlying device is removed.
  • (-ENOENT) if action pointed by action handle was not found.
  • (-EBUSY) if action pointed by action handle still used by some rules — rte_errno is also set.

🌈 __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)

Warning ⚠️ EXPERIMENTAL: this API may change without prior notice.

Update in-place the action configuration and / or state pointed by action handle, using the configuration provided as the update argument. The update of the action configuration affects all flow rules reusing the action via handle. The update general pointer provides the ability of partial updating — so like, you don't have to redo the whole thing, just the bits you want. 💅

Parameters 🍓

  • port_id — The port identifier of the Ethernet device.
  • handle — Handle for the indirect action object to be updated.
  • update — Update profile specification used to modify the action pointed by handle. update could be with the same type of the immediate action corresponding to the handle argument when creating, or a wrapper structure includes action configuration to be updated and bit fields to indicate the member of fields inside the action to update.
  • error — Perform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.

Returns ✨

  • (0) if success.
  • (-ENODEV) if port_id invalid.
  • (-ENOSYS) if underlying device does not support this functionality.
  • (-EIO) if underlying device is removed.
  • (-EINVAL) if update invalid.
  • (-ENOTSUP) if update valid but unsupported.
  • (-ENOENT) if indirect action object pointed by handle was not found — rte_errno is also set.

🧚 __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)

Warning ⚠️ EXPERIMENTAL: this API may change without prior notice.

Query the direct action by the corresponding indirect action object handle. 👑

Retrieve action-specific data such as counters. Data is gathered by a special action which may be present/referenced in more than one flow rule definition.

See also 🫶

RTE_FLOW_ACTION_TYPE_COUNT

Parameters 🌸

  • port_id — Port identifier of Ethernet device.
  • handle — Handle for the action object to query.
  • data — Pointer to storage for the associated query data type.
  • error — Perform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.

Returns 💖

0 on success, a negative errno value otherwise and rte_errno is set.


💜 __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)

Allocate an array of actions to be used in rte_flow_create, to implement tunnel-decap-set for the given tunnel. Sample usage: actions vxlan_decap / tunnel-decap-set(tunnel properties) / jump group 0 / end 🎀

Parameters 🦋

  • port_id — Port identifier of Ethernet device.
  • tunnel — Tunnel properties.
  • actions — Array of actions to be allocated by the PMD. This array should be concatenated with the actions array provided to rte_flow_create.
  • num_of_actions — Number of actions allocated.
  • error — Perform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.

Returns ✨

0 on success, a negative errno value otherwise and rte_errno is set.


🍓 __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)

Allocate an array of items to be used in rte_flow_create, to implement tunnel-match for the given tunnel. Sample usage: pattern tunnel-match(tunnel properties) / outer-header-matches / inner-header-matches / end 🌈

Parameters 👑

  • port_id — Port identifier of Ethernet device.
  • tunnel — Tunnel properties.
  • items — Array of items to be allocated by the PMD. This array should be concatenated with the items array provided to rte_flow_create.
  • num_of_items — Number of items allocated.
  • error — Perform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.

Returns 💖

0 on success, a negative errno value otherwise and rte_errno is set.


🌸 __rte_experimental uint64_t rte_flow_restore_info_dynflag (void )

When a mbuf arrives from HW, you may need to call rte_flow_get_restore_info() to retrieve some metadata. This function returns the associated mbuf ol_flags. ✨

Note: the dynamic flag is registered during a call to rte_eth_rx_metadata_negotiate() with RTE_ETH_RX_METADATA_TUNNEL_ID. Don't forget that step bestie, it's lowkey required. 🎀

Returns 🫶

The offload flag indicating rte_flow_get_restore_info() must be called.


🦋 __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)

If a mbuf contains the rte_flow_restore_info_dynflag() flag in ol_flags, populate the current packet processing state. 💅

One should negotiate tunnel metadata delivery from the NIC to the HW.

See also 💜

  • rte_eth_rx_metadata_negotiate()
  • RTE_ETH_RX_METADATA_TUNNEL_ID

Parameters ⭐

  • port_id — Port identifier of Ethernet device.
  • m — Mbuf struct.
  • info — Restore information. Upon success contains the HW state.
  • error — Perform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.

Returns 🌈

0 on success, a negative errno value otherwise and rte_errno is set.


🎀 __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)

Release the action array as allocated by rte_flow_tunnel_decap_set. Clean up after yourself, bestie, it's called being a responsible icon. 👑

Parameters 🍓

  • port_id — Port identifier of Ethernet device.
  • actions — Array of actions to be released.
  • num_of_actions — Number of elements in actions array.
  • error — Perform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.

Returns — 0 on success, a negative errno value otherwise and rte_errno is set. ✨


🎀 rte_flow_tunnel_item_release

__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)

Okay so bestie, this one releases the item array that rte_flow_tunnel_match allocated for you. It's the cleanup bestie — hand back what you borrowed, the way that good housekeeping literally is self care 💅

Parameters

  • port_id — the port identifier of the Ethernet device, bestie. Gotta know which device we're talking to 🦋
  • items — the array of items you want released.
  • num_of_items — how many elements are chilling in that item array.
  • error — does verbose error reporting if it's not NULL. PMDs initialize this structure only in the case of an error, so don't go reading it when things went fine 🙈

Returns — 0 on success, a negative errno value otherwise and rte_errno is set. 🍓


👑 rte_flow_pick_transfer_proxy

int rte_flow_pick_transfer_proxy (uint16_t port_id, uint16_t * proxy_port_id, struct rte_flow_error * error)

Get a proxy port to manage "transfer" flows. It's giving backstage-pass energy, no cap 🎟️

So managing "transfer" flows requires that the user communicate them via a port which has the privilege to control the embedded switch. And here's the tea: for some vendors, all ports in a given switching domain have this privilege. For other vendors? Only one port does. Not all heroes wear capes etc. 😭

This API indicates such a privileged port (a "proxy") for a given port in the same switching domain.

Note — if the PMD serving port_id doesn't have the corresponding method implemented, the API will return port_id via proxy_port_id. So you still get a port back, it's just… the one you gave it. Lowkey iconic of it 🫶

Parameters

  • port_id — indicates the port to get a "proxy" for.
  • proxy_port_id — indicates the "proxy" port.
  • error — if not NULL, allows the PMD to provide a verbose report in case of error. Verbose is the vibe 🌸

Returns — 0 on success, a negative error code otherwise. 💜


🦋 rte_flow_flex_item_create

__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)
Warning — EXPERIMENTAL: this API may change without prior notice. It's a ✨situationship✨ with the API, fr fr. Don't build your whole personality on it.

Create the flex item with the specified configuration over the Ethernet device. Slay 💅

Parameters

  • port_id — port identifier of Ethernet device.
  • conf — item configuration.
  • error — perform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.

Returns — non-NULL opaque pointer on success, NULL otherwise and rte_errno is set. ⭐


🌈 rte_flow_flex_item_release

__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)

Release the flex item on the specified Ethernet device. Let it go, let it gooo 🧚

Parameters

  • port_id — port identifier of Ethernet device.
  • handle — handle of the item existing on the specified device.
  • error — perform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.

Returns — 0 on success, a negative errno value otherwise and rte_errno is set. 💖


⭐ rte_flow_info_get

__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)
Warning — EXPERIMENTAL: this API may change without prior notice. 🚨

Get information about flow engine resources. Like, tell me everything, I'm nosy and I deserve to know 👀

Parameters

  • port_id — port identifier of Ethernet device.
  • port_info — a pointer to a structure of type rte_flow_port_info to be filled with the resources information of the port.
  • queue_info — a pointer to a structure of type rte_flow_queue_info to be filled with the asynchronous queues information.
  • error — perform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.

Returns — 0 on success, a negative errno value otherwise and rte_errno is set. 🌸


🎀 rte_flow_configure

__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)
Warning — EXPERIMENTAL: this API may change without prior notice. 🙈

Configure the port's flow API engine. Main character setup energy, honestly ✨

This API can only be invoked before the application starts using the rest of the flow library functions. Read that again, bestie. Before. If you're already deep in flow-library business, this door is closed for you 🚪

The API can be invoked multiple times to change the settings. The port, however, may reject changes and keep the old config. Not me asking nicely and getting left on read 💀

Parameters in configuration attributes must not exceed numbers of resources returned by the rte_flow_info_get API. So go ask rte_flow_info_get first, okay? Manners 💅

Parameters

  • port_id — port identifier of Ethernet device.
  • port_attr — port configuration attributes.
  • nb_queue — number of flow queues to be configured.
  • queue_attr — array that holds attributes for each flow queue. Number of elements is set in port_attr.nb_queues.
  • error — perform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.

Returns — 0 on success, a negative errno value otherwise and rte_errno is set. 💜


🦋 rte_flow_pattern_template_create

__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)
Warning — EXPERIMENTAL: this API may change without prior notice. 😭

Create a flow pattern template. It's giving template queen 👑

So the pattern template defines common matching fields without values. For example — matching on a 5 tuple TCP flow, the template will be eth(null) + IPv4(source + dest) + TCP(s_port + d_port), while the values for each rule will be set during the flow rule creation. The number and order of items in the template must be the same at the rule creation. Same length, same order, no improvising 🎯

Parameters

  • port_id — port identifier of Ethernet device.
  • template_attr — pattern template attributes.
  • pattern — pattern specification (list terminated by the END pattern item). The spec member of an item is not used unless the end member is used.
  • error — perform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.

Returns — handle on success, NULL otherwise and rte_errno is set. ⭐


🌈 rte_flow_pattern_template_destroy

__rte_experimental int rte_flow_pattern_template_destroy (uint16_t port_id, struct rte_flow_pattern_template * pattern_template, struct rte_flow_error * error)
Warning — EXPERIMENTAL: this API may change without prior notice. 🚨

Destroy the flow pattern template. Bye bestie, you were iconic 💅

This function may be called only when there are no more tables referencing this template. No tables, no exceptions. If something still points at it, you can't just poof it, that's not how this works 🙈

Parameters

  • port_id — port identifier of Ethernet device.
  • pattern_template — handle of the template to be destroyed.
  • error — perform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.

Returns — 0 on success, a negative errno value otherwise and rte_errno is set. 🍓


👑 rte_flow_actions_template_create

__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)
Warning — EXPERIMENTAL: this API may change without prior notice. 💀

Create a flow actions template. The sibling of the pattern template, matching energy, matching slay ✨

So the actions template holds a list of action types without values. For example, the template to change TCP ports is TCP(s_port + d_port), while values for each rule will be set during the flow rule creation. And once again — the number and order of actions in the template must be the same at the rule creation. Consistency is the whole flex 🎯

Parameters

  • port_id — port identifier of Ethernet device.
  • template_attr — template attributes.
  • actions — associated actions (list terminated by the END action). The spec member is only used if the masks spec is non-zero.
  • masks — list of actions that marks which of the action's member is constant. A mask has the same format as the corresponding action. If the action field in masks is not 0, the corresponding value in an action from actions will be the part of the template and used in all flow rules. The order of actions in masks is the same as in actions. In case of indirect actions present in actions, the actual action type should be present in mask. (iykyk, but also literally write it correctly or it breaks 🙈)
  • error — perform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.

Returns — handle on success, NULL otherwise and rte_errno is set. 🌸


💖 rte_flow_actions_template_destroy

__rte_experimental int rte_flow_actions_template_destroy (uint16_t port_id, struct rte_flow_actions_template * actions_template, struct rte_flow_error * error)
Warning — EXPERIMENTAL: this API may change without prior notice. 😭

Destroy the flow actions template. Ghost it (responsibly) 🫶

This function may be called only when there are no more tables referencing this template. Same rule as its pattern-template twin, no cap. Referenced template = hands off 🚫

Parameters

  • port_id — port identifier of Ethernet device.
  • actions_template — handle to the template to be destroyed.
  • error — perform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.

Returns — 0 on success, a negative errno value otherwise and rte_errno is set. 💜


🎀 rte_flow_template_table_resizable

__rte_experimental bool rte_flow_template_table_resizable (__rte_unused uint16_t port_id, const struct rte_flow_template_table_attr * tbl_attr)
Warning — EXPERIMENTAL: this API may change without prior notice. 🚨

Query whether a table can be resized. Just asking questions, that's all 👀

Parameters

  • port_id — port identifier of Ethernet device. (It's marked __rte_unused, so the compiler knows not to start drama about it 💅)
  • tbl_attr — template table.

Returns — true if the table can be resized. ✅


🌈 rte_flow_template_table_create

__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)
Warning — EXPERIMENTAL: this API may change without prior notice. 🙈

Create a flow template table. The whole ensemble, the full fit, the final look 👑

A template table consists of multiple pattern templates and actions templates associated with a single set of rule attributes (group ID, priority and traffic direction). One vibe, many looks. Go off 💅

Each rule is free to use any combination of pattern and actions templates and specify particular values for items and actions it would like to change. Mix and match, bestie, that's the point 🦋

Parameters

  • port_id — port identifier of Ethernet device.
  • table_attr — template table attributes.
  • pattern_templates — array of pattern templates to be used in this table.
  • nb_pattern_templates — the number of pattern templates in the pattern_templates array.
  • actions_templates — array of actions templates to be used in this table.
  • nb_actions_templates — the number of actions templates in the actions_templates array.
  • error — perform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.

Returns — handle on success, NULL otherwise and rte_errno is set. ⭐

rte_flow_template_table_destroy</p> 🎀

__rte_experimental int rte_flow_template_table_destroy(uint16_t port_id,
    struct rte_flow_template_table *template_table,
    struct rte_flow_error *error)
Warning — EXPERIMENTAL: this API may change without prior notice. 👀

Okay so this one is your little goodbye moment — it destroys a flow template table. Poof. Gone. ✨

But listen bestie, the rule is: you can only call this when there are no more flow rules referencing this table. Like, nobody's still holding onto it. If someone is, that's not it. 🙅‍♀️

Parameters:

  • port_id — port identifier of the Ethernet device.
  • template_table — handle to the table you're about to destroy 🫡
  • error — performs verbose error reporting if not NULL. PMDs initialize this structure in case of error only.

Returns:

  • 0 on success, a negative errno value otherwise, and rte_errno is set.

rte_flow_group_set_miss_actions 💜

__rte_experimental int rte_flow_group_set_miss_actions(uint16_t port_id,
    uint32_t group_id, const struct rte_flow_group_attr *attr,
    const struct rte_flow_action actions[],
    struct rte_flow_error *error)
Warning — EXPERIMENTAL: this API may change without prior notice. 👀

Sets the group miss actions — as in, what happens when nothing in the group matches. The "miss" girlies get their moment. 💅

Parameters:

  • port_id — port identifier of the Ethernet device.
  • group_id — identifier of a group to set miss actions for.
  • attr — group attributes.
  • actions — list of group miss actions.
  • error — performs verbose error reporting if not NULL. PMDs initialize this structure in case of error only.

Returns:

  • 0 on success, a negative errno value otherwise, and rte_errno is set.

rte_flow_async_create 🦋

__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)
Warning — EXPERIMENTAL: this API may change without prior notice. 👀

Enqueue a rule creation operation. It doesn't create it right this second — it enqueues it, like dropping a message in the group chat and walking away because the vibe will handle itself. 📨

Parameters:

  • port_id — port identifier of the Ethernet device.
  • queue_id — flow queue used to insert the rule.
  • op_attr — rule creation operation attributes.
  • template_table — template table to select templates from.
  • pattern — list of pattern items to be used. The list order should match the order in the pattern template. The spec is the only relevant member of the item that's being used.
  • pattern_template_index — pattern template index in the table.
  • actions — list of actions to be used. The list order should match the order in the actions template.
  • actions_template_index — actions template index in the table.
  • user_data — the user data that will be returned on the completion events.
  • error — performs verbose error reporting if not NULL. PMDs initialize this structure in case of error only.

Returns:

  • Handle on success, NULL otherwise, and rte_errno is set.
⚠️ Big note bestie — the rule handle doesn't mean that the rule has been populated. Only the completion result indicates whether there was success or failure. Do not @ me. The handle is not the same as "it's done." 😭

rte_flow_async_create_by_index 🧚

__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)
Warning — EXPERIMENTAL: this API may change without prior notice. 👀

Enqueue a rule creation operation — index edition. 📇

Parameters:

  • port_id — port identifier of the Ethernet device.
  • queue_id — flow queue used to insert the rule.
  • op_attr — rule creation operation attributes.
  • template_table — template table to select templates from.
  • rule_index — rule index in the table.
  • actions — list of actions to be used. The list order should match the order in the actions template.
  • actions_template_index — actions template index in the table.
  • user_data — the user data that will be returned on the completion events.
  • error — performs verbose error reporting if not NULL. PMDs initialize this structure in case of error only.

Returns:

  • Handle on success, NULL otherwise, and rte_errno is set. Again: the rule handle doesn't mean that the rule has been populated. Only the completion result says if it was a slay or a fail. 💅

rte_flow_async_create_by_index_with_pattern 🌸

__rte_experimental struct rte_flow *
    rte_flow_async_create_by_index_with_pattern(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_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)
Warning — EXPERIMENTAL: this API may change without prior notice. 👀

Enqueue a rule creation by index with pattern operation. Key detail: packets are only matched if there is a rule inserted at the index. No rule at that index → no match. That's the whole plot. 🎬

Parameters:

  • port_id — port identifier of the Ethernet device.
  • queue_id — flow queue used to insert the rule.
  • op_attr — rule creation operation attributes.
  • template_table — template table to select templates from.
  • rule_index — rule index in the table. 🚨 Inserting a rule to an already occupied index results in undefined behavior. Not cute, not fun, don't do it.
  • pattern — list of pattern items to be used. The list order should match the order in the pattern template. The spec is the only relevant member of the item that's being used.
  • pattern_template_index — pattern template index in the table.
  • actions — list of actions to be used. The list order should match the order in the actions template.
  • actions_template_index — actions template index in the table.
  • user_data — the user data that will be returned on the completion events.
  • error — performs verbose error reporting if not NULL. PMDs initialize this structure in case of error only.

Returns:

  • Handle on success, NULL otherwise, and rte_errno is set. Yep, you already know: the rule handle doesn't mean that the rule has been populated. Only the completion result indicates success or failure. 🫶

rte_flow_async_destroy 🔥

__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)
Warning — EXPERIMENTAL: this API may change without prior notice. 👀

Enqueue a rule destruction operation. 💀

This function enqueues a destruction operation on the queue. And here's the important part: the application should assume that after calling this function the rule handle is not valid anymore. It's over, she's gone, the handle is a ghost. 👻 The completion indicates the full removal of the rule from the HW.

Parameters:

  • port_id — port identifier of the Ethernet device.
  • queue_id — flow queue which is used to destroy the rule. 🚨 This must match the queue on which the rule was created. No queue-hopping, bestie.
  • op_attr — rule destruction operation attributes.
  • flow — flow handle to be destroyed.
  • user_data — the user data that will be returned on the completion events.
  • error — performs verbose error reporting if not NULL. PMDs initialize this structure in case of error only.

Returns:

  • 0 on success, a negative errno value otherwise, and rte_errno is set.

rte_flow_async_actions_update ⭐

__rte_experimental int rte_flow_async_actions_update(uint16_t port_id,
    uint32_t queue_id, const struct rte_flow_op_attr *op_attr,
    struct rte_flow *flow, const struct rte_flow_action actions[],
    uint8_t actions_template_index, void *user_data,
    struct rte_flow_error *error)
Warning — EXPERIMENTAL: this API may change without prior notice. 👀

Enqueue a rule update operation. Glow-up arc activated. ✨

Parameters:

  • port_id — port identifier of the Ethernet device.
  • queue_id — flow queue used to insert the rule.
  • op_attr — rule creation operation attributes.
  • flow — flow rule to be updated.
  • actions — list of actions to be used. The list order should match the order in the actions template.
  • actions_template_index — actions template index in the table.
  • user_data — the user data that will be returned on the completion events.
  • error — performs verbose error reporting if not NULL. PMDs initialize this structure in case of error only.

Returns:

  • 0 on success, a negative errno value otherwise, and rte_errno is set.

rte_flow_push 🎀

__rte_experimental int rte_flow_push(uint16_t port_id, uint32_t queue_id,
    struct rte_flow_error *error)
Warning — EXPERIMENTAL: this API may change without prior notice. 👀

Push all internally stored rules to the HW. 📤

Postponed rules are rules that were inserted with the postpone flag set. This is the moment you notify the HW about a whole batch of rules that the SW prepared — so you can reduce the number of communications between the HW and SW. Efficiency, we love her. 💅

Parameters:

  • port_id — port identifier of the Ethernet device.
  • queue_id — flow queue to be pushed.
  • error — performs verbose error reporting if not NULL. PMDs initialize this structure in case of error only.

Returns:

  • 0 on success, a negative errno value otherwise, and rte_errno is set.

rte_flow_pull 🫶

__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)
Warning — EXPERIMENTAL: this API may change without prior notice. 👀

Pull an rte flow operation. 📥

The application must invoke this function in order to complete the flow rule offloading and to retrieve the flow rule operation status. You literally can't skip this one — no pulling, no results. 😤

Parameters:

  • port_id — port identifier of the Ethernet device.
  • queue_id — flow queue which is used to pull the operation.
  • res — array of results that will be set.
  • n_res — maximum number of results that can be returned. This value is equal to the size of the res array.
  • error — performs verbose error reporting if not NULL. PMDs initialize this structure in case of error only.

Returns:

  • Number of results that were pulled, a negative errno value otherwise, and rte_errno is set.

rte_flow_async_action_handle_create 🌈

__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)
Warning — EXPERIMENTAL: this API may change without prior notice. 👀

Enqueue an indirect action creation operation. 🎀

See also:

  • rte_flow_action_handle_create

Looks like we're mid-parameters, so let's just keep the party going 💅

  • port_id — Port identifier of Ethernet device.
  • queue_id — Flow queue which is used to create the rule.
  • op_attr — Indirect action creation operation attributes.
  • indir_action_conf — Action configuration for the indirect action object creation.
  • action — Specific configuration of the indirect action object.
  • user_data — The user data that will be returned on the completion events.
  • error — Perform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.

Returns

A valid handle in case of success, NULL otherwise and rte_errno is set.


rte_flow_async_action_handle_destroy 🌈

__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)
⚠️ EXPERIMENTAL: this API may change without prior notice. bestie this is not the stable stuff, okay? it might glow up and change shape on you 🙈

Enqueue indirect action destruction operation. 🫶 And listen — the destroy queue must be the same as the queue on which the action was created. No switching up. it's giving loyalty test fr fr.

Parameters

  • port_id — Port identifier of Ethernet device.
  • queue_id — Flow queue which is used to destroy the rule.
  • op_attr — Indirect action destruction operation attributes.
  • action_handle — Handle for the indirect action object to be destroyed.
  • user_data — The user data that will be returned on the completion events.
  • error — Perform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.

Returns

0 on success, a negative errno value otherwise and rte_errno is set. ✨


rte_flow_async_action_handle_update 🦋

__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)
⚠️ EXPERIMENTAL: this API may change without prior notice. no cap, it can shift on you 💀

Enqueue indirect action update operation. glowed up? no, updated 💅

See also

rte_flow_action_handle_create

Parameters

  • port_id — Port identifier of Ethernet device.
  • queue_id — Flow queue which is used to update the rule.
  • op_attr — Indirect action update operation attributes.
  • action_handle — Handle for the indirect action object to be updated.
  • update — Update profile specification used to modify the action pointed by handle. update could be with the same type of the immediate action corresponding to the handle argument when creating, or a wrapper structure includes action configuration to be updated and bit fields to indicate the member of fields inside the action to update.
  • user_data — The user data that will be returned on the completion events.
  • error — Perform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.

Returns

0 on success, a negative errno value otherwise and rte_errno is set.


rte_flow_async_action_handle_query 🎀

__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)
⚠️ EXPERIMENTAL: this API may change without prior notice. she's experimental, she's sensitive, she may change 🌸

Enqueue indirect action query operation. 🔍

Retrieve action-specific data such as counters. Data is gathered by special action which may be present/referenced in more than one flow rule definition. Data will be available only when completion event returns — like, don't rush her, she'll tell you when she's ready 😌

See also

rte_flow_async_action_handle_query

Parameters

  • port_id — Port identifier of Ethernet device.
  • queue_id — Flow queue which is used to query the action.
  • op_attr — Indirect action update operation attributes.
  • action_handle — Handle for the action object to query.
  • data — Pointer to storage for the associated query data type. The out data will be available only when completion event returns from rte_flow_pull.
  • user_data — The user data that will be returned on the completion events.
  • error — Perform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.

Returns

0 on success, a negative errno value otherwise and rte_errno is set.


rte_flow_action_handle_query_update 👑

__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)
⚠️ EXPERIMENTAL: this API may change without prior notice. iconic but unstable, iykyk 💅

Query and/or update indirect flow action. If both query and update not NULL, the function atomically queries and updates indirect action. Query and update are carried in order specified in the mode parameter. If either query or update is NULL, the function executes complementing operation. so efficient, we love a multitasker ✨

Parameters

  • port_id — Port identifier of Ethernet device.
  • handle — Handle for the indirect action object to be updated.
  • update — If not NULL, update profile specification used to modify the action pointed by handle.
  • query — If not NULL pointer to storage for the associated query data type.
  • mode — Operational mode.
  • error — Perform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.

Returns

0 on success, a negative errno value otherwise and rte_errno is set.

  • (-ENODEV) if port_id invalid.
  • (-ENOTSUP) if underlying device does not support this functionality.
  • (-EINVAL) if handle or mode invalid or both query and update are NULL.

rte_flow_async_action_handle_query_update 🧚

__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)
⚠️ EXPERIMENTAL: this API may change without prior notice. fr fr, still in her experimental era 🙈

Enqueue async indirect flow action query and/or update. two things at once, main character energy 🌟

Parameters

  • port_id — Port identifier of Ethernet device.
  • queue_id — Flow queue which is used to update the rule.
  • attr — Indirect action update operation attributes.
  • handle — Handle for the indirect action object to be updated.
  • update — If not NULL, update profile specification used to modify the action pointed by handle.
  • query — If not NULL, pointer to storage for the associated query data type. Query result returned on async completion event.
  • mode — Operational mode.
  • user_data — The user data that will be returned on async completion event.
  • error — Perform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.

Returns

0 on success, a negative errno value otherwise and rte_errno is set.

  • (-ENODEV) if port_id invalid.
  • (-ENOTSUP) if underlying device does not support this functionality.
  • (-EINVAL) if handle or mode invalid or both update and query are NULL.

rte_flow_action_list_handle_create 🍓

__rte_experimental struct rte_flow_action_list_handle *
    rte_flow_action_list_handle_create(uint16_t port_id,
    const struct rte_flow_indir_action_conf *conf,
    const struct rte_flow_action *actions,
    struct rte_flow_error *error)
⚠️ EXPERIMENTAL: this API may change without prior notice. 💀

Create an indirect flow action object from flow actions list. The object is identified by a unique handle. The handle has single state and configuration across all the flow rules using it — one queen, many rules, that's the vibe 👑

Parameters

  • port_id — The port identifier of the Ethernet device.
  • conf — Action configuration for the indirect action list creation.
  • actions — Specific configuration of the indirect action lists.
  • error — Perform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.

Returns

A valid handle in case of success, NULL otherwise and rte_errno is set to one of the error codes defined:

  • (-ENODEV) if port_id invalid.
  • (-ENOSYS) if underlying device does not support this functionality.
  • (-EIO) if underlying device is removed.
  • (-EINVAL) if actions list invalid.
  • (-ENOTSUP) if action list element valid but unsupported.

rte_flow_async_action_list_handle_create 🌈

__rte_experimental struct rte_flow_action_list_handle *
    rte_flow_async_action_list_handle_create(uint16_t port_id,
    uint32_t queue_id, const struct rte_flow_op_attr *attr,
    const struct rte_flow_indir_action_conf *conf,
    const struct rte_flow_action *actions, void *user_data,
    struct rte_flow_error *error)
⚠️ EXPERIMENTAL: this API may change without prior notice. lowkey might change, highkey still experimental 🫶

Async function call to create an indirect flow action object from flow actions list. The object is identified by a unique handle. The handle has single state and configuration across all the flow rules using it. same energy, just queued up instead of blocking ✨

Parameters

  • port_id — The port identifier of the Ethernet device.
  • queue_id — Flow queue which is used to update the rule.
  • attr — Indirect action update operation attributes.
  • conf — Action configuration for the indirect action list creation.
  • actions — Specific configuration of the indirect action list.
  • user_data — The user data that will be returned on async completion event.
  • error — Perform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.

Returns

A valid handle in case of success, NULL otherwise and rte_errno is set to one of the error codes defined:

  • (-ENODEV) if port_id invalid.
  • (-ENOSYS) if underlying device does not support this functionality.
  • (-EIO) if underlying device is removed.
  • (-EINVAL) if actions list invalid.
  • (-ENOTSUP) if action list element valid but unsupported.

rte_flow_action_list_handle_destroy 🎀

__rte_experimental int rte_flow_action_list_handle_destroy(uint16_t port_id,
    struct rte_flow_action_list_handle *handle,
    struct rte_flow_error *error)
⚠️ EXPERIMENTAL: this API may change without prior notice. don't get too attached, she's experimental 💅

Destroy indirect actions list by handle. breaking up with the whole list at once, clean and final 🦋

Parameters

  • port_id — The port identifier of the Ethernet device.
  • handle — Handle for the indirect actions list to be destroyed.
  • error — Perform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.

Returns

  • (0) if success.
  • (-ENODEV) if port_id invalid.
  • (-ENOSYS) if underlying device does not support this functionality.
  • (-EIO) if underlying device is removed.
  • (-ENOENT) if actions list pointed by action handle was not found.
  • (-EBUSY) if actions list pointed by action handle still used

✨ rte_flow_async_action_list_handle_destroy ✨

__rte_experimental int rte_flow_async_action_list_handle_destroy(uint16_t port_id, uint32_t queue_id, const struct rte_flow_op_attr * op_attr, struct rte_flow_action_list_handle * handle, void * user_data, struct rte_flow_error * error)
⚠️ EXPERIMENTAL: this API may change without prior notice.

Okay so bestie, this one enqueues the destruction of an indirect action list 💅 — like, you're not doing it right this second, you're putting the destroy op in the queue.

The one thing you cannot mess up: the destroy queue has to be the same queue the action was created on. Same queue or it's not happening, fr fr.

Parameters 🫶

  • port_id — Port identifier of Ethernet device.
  • queue_id — Flow queue which is used to destroy the rule.
  • op_attr — Indirect action destruction operation attributes.
  • handle — Handle for the indirect action object to be destroyed.
  • user_data — The user data that will be returned on the completion events.
  • error — Perform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.

Returns

  • (0) if success.
  • (-ENODEV) if port_id invalid.
  • (-ENOSYS) if underlying device does not support this functionality.
  • (-EIO) if underlying device is removed.
  • (-ENOENT) if actions list pointed by action handle was not found.
  • (-EBUSY) if actions list pointed by action handle still used

✨ rte_flow_action_list_handle_query_update ✨

__rte_experimental int rte_flow_action_list_handle_query_update(uint16_t port_id, const struct rte_flow_action_list_handle * handle, const void ** update, void ** query, enum rte_flow_query_update_mode mode, struct rte_flow_error * error)
⚠️ EXPERIMENTAL: this API may change without prior notice.

Query and/or update an indirect flow actions list, iconic behaviour honestly 🦋.

If both query and update are not NULL, the function atomically queries and updates the indirect action — yes, both, in one go, no in-between 👑. Query and update get carried out in the order specified in the mode parameter. And if either query or update is NULL, the function just does the other one (the complementing operation). Simple as.

Parameters 💖

  • port_id — Port identifier of Ethernet device.
  • handle — Handle for the indirect actions list object to be updated.
  • update — If the action list handle was created from n actions A1 / A2 ... An / END, a non-NULL update parameter is an array [U1, U2, ... Un] where Ui points to Ai update context, or NULL if Ai should not be updated.
  • query — If the action list handle was created from n actions A1 / A2 ... An / END, a non-NULL query parameter is an array [Q1, Q2, ... Qn] where Qi points to Ai query context, or NULL if Ai should not be queried.
  • mode — Operational mode.
  • error — Perform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.

Returns

  • (0) if success.
  • (-ENODEV) if port_id invalid.
  • (-ENOTSUP) if underlying device does not support this functionality.
  • (-EINVAL) if handle or mode invalid or both query and update are NULL.

✨ rte_flow_async_action_list_handle_query_update ✨

__rte_experimental int rte_flow_async_action_list_handle_query_update(uint16_t port_id, uint32_t queue_id, const struct rte_flow_op_attr * attr, const struct rte_flow_action_list_handle * handle, const void ** update, void ** query, enum rte_flow_query_update_mode mode, void * user_data, struct rte_flow_error * error)
⚠️ EXPERIMENTAL: this API may change without prior notice.

Enqueue an async indirect flow actions list query and/or update 🌈.

If both query and update are not NULL, the function atomically queries and updates the indirect action. Query and update are carried out in the order specified in the mode parameter. If either query or update is NULL, the function executes the complementing operation.

Parameters 🎀

  • port_id — Port identifier of Ethernet device.
  • queue_id — Flow queue which is used to update the rule.
  • attr — Indirect action update operation attributes.
  • handle — Handle for the indirect actions list object to be updated.
  • update — If the action list handle was created from n actions A1 / A2 ... An / END, a non-NULL update parameter is an array [U1, U2, ... Un] where Ui points to Ai update context, or NULL if Ai should not be updated.
  • query — If the action list handle was created from n actions A1 / A2 ... An / END, a non-NULL query parameter is an array [Q1, Q2, ... Qn] where Qi points to Ai query context, or NULL if Ai should not be queried. Query result returned on async completion event.
  • mode — Operational mode.
  • user_data — The user data that will be returned on async completion event.
  • error — Perform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.

Returns

  • (0) if success.
  • (-ENODEV) if port_id invalid.
  • (-ENOTSUP) if underlying device does not support this functionality.
  • (-EINVAL) if handle or mode invalid or both update and query are NULL.

✨ rte_flow_calc_table_hash ✨

__rte_experimental int rte_flow_calc_table_hash(uint16_t port_id, const struct rte_flow_template_table * table, const struct rte_flow_item pattern[], uint8_t pattern_template_index, uint32_t * hash, struct rte_flow_error * error)
⚠️ EXPERIMENTAL: this API may change without prior notice.

Calculate the hash for a given pattern in a given table as calculated by the HW 👑

Like, you're asking the hardware "hey what hash would you make for this?" — the software is simulating the hardware's own result, no cap.

Parameters ⭐

  • port_id — Port identifier of Ethernet device.
  • table — The table the SW wishes to simulate.
  • pattern — The values to be used in the hash calculation.
  • pattern_template_index — The pattern index in the table to be used for the calculation.
  • hash — Used to return the calculated hash.
  • error — Perform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.

Returns

  • (0) if success.
  • (-ENODEV) if port_id invalid.
  • (-ENOTSUP) if underlying device does not support this functionality.

✨ rte_flow_calc_encap_hash ✨

__rte_experimental int rte_flow_calc_encap_hash(uint16_t port_id, const struct rte_flow_item pattern[], enum rte_flow_encap_hash_field dest_field, uint8_t hash_len, uint8_t * hash, struct rte_flow_error * error)
⚠️ EXPERIMENTAL: this API may change without prior notice.

Simulate the HW hash calculation that happens when an encap action is being used 🦋. This hash can be stored in the tunnel outer header to improve packet distribution — cute and functional, we love to see it.

Parameters 💜

  • port_id — Port identifier of Ethernet device.
  • pattern — The values to be used in the hash calculation.
  • dest_field — Type of destination field for hash calculation.
  • hash_len — The length of the hash pointer in bytes. Should be according to dest_field.
  • hash — Used to return the calculated hash. It will be written in network order, so hash[0] is the MSB. The number of bytes is based on the destination field type.
  • error — Perform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.

Returns

  • (0) if success.
  • (-ENODEV) if port_id invalid.
  • (-ENOTSUP) if underlying device does not support this functionality.
  • (-EINVAL) if pattern doesn't hold enough information to calculate the hash or the dst is not supported.

✨ rte_flow_template_table_resize ✨

__rte_experimental int rte_flow_template_table_resize(uint16_t port_id, struct rte_flow_template_table * table, uint32_t nb_rules, struct rte_flow_error * error)
⚠️ EXPERIMENTAL: this API may change without prior notice.

Update the template table for a new flow rules capacity 🔥 — glow-up era for your table.

Parameters 🌸

  • port_id — Port identifier of Ethernet device.
  • table — Template table to modify.
  • nb_rules — New flow rules capacity.
  • error — Perform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.

Returns

  • (0) if success.
  • (-ENODEV) if port_id invalid.
  • (-ENOTSUP) if underlying device does not support this functionality.
  • (-EINVAL) if table is not resizable or table resize to nb_rules is not supported or unrecoverable table error.

✨ rte_flow_async_update_resized ✨

__rte_experimental int rte_flow_async_update_resized(uint16_t port_id, uint32_t queue, const struct rte_flow_op_attr * attr, struct rte_flow * rule, void * user_data, struct rte_flow_error * error)
⚠️ EXPERIMENTAL: this API may change without prior notice.

Update a rule for the new table configuration after a table resize 🧚.

You must call this for each rule created before the table resize — every single one, no skipping, bestie 😭. And if you call it for a rule that was created after the table resize? It just returns success. Easy.

Parameters 💫

  • port_id — Port identifier of Ethernet device.
  • queue — Flow queue for async operation.
  • attr — Async operation attributes.
  • rule — Flow rule to update.
  • user_data — The user data that will be returned on async completion event.
  • error — Perform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.

Returns

  • (0) if success.
  • (-ENODEV) if port_id invalid.
  • (-ENOTSUP) if underlying device does not support this functionality.
  • (-EINVAL) if table was not resized. If rule cannot be updated after table resize, unrecoverable table error.

✨ rte_flow_template_table_resize_complete ✨

__rte_experimental int rte_flow_template_table_resize_complete(uint16_t port_id, struct rte_flow_template_table * table, struct rte_flow_error * error)
⚠️ EXPERIMENTAL: this API may change without prior notice.

Resume normal operational mode after the table was resized and the table rules were updated for the new table configuration 🫶. This is the "okay we're back, everything's chill" step.

Parameters 🍓

  • port_id — Port identifier of Ethernet device.
  • table — Template table that undergoing resize operation.
  • error — Perform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.

Returns

  • (0) if success.
  • (-ENODEV) if port_id invalid.
  • (-ENOTSUP) if underlying device does not support this functionality.
  • (-EBUSY) if not all table rules were updated.
  • (-EINVAL) if table cannot complete table resize, unrecoverable error.

📦 Variable Documentation 📦

🌟 rte_flow_item_quota_mask 🌟

const struct rte_flow_item_quota rte_flow_item_quota_mask [static]

Initial value:

= {
    .state = (enum rte_flow_quota_state)0xff
}

Default mask for RTE_FLOW_ITEM_TYPE_QUOTA 👑

Definition at line 755 of file rte_flow.h.


🌟 rte_flow_item_higig2_hdr_mask 🌟

const struct rte_flow_item_higig2_hdr rte_flow_item_higig2_hdr_mask [static]

Initial value:

= {
    .hdr = {
        .ppt1 = {
            .classification = RTE_BE16(UINT16_MAX),
            .vid = RTE_BE16(0xfff),
        },
    },
}

Default mask for RTE_FLOW_ITEM_TYPE_HIGIG2 💖

Definition at line 771 of file rte_flow.h.


🌟 rte_flow_item_any_mask 🌟

const struct rte_flow_item_any rte_flow_item_any_mask [static]

Initial value:

= {
    .num = 0x00000000,
}

Default mask for RTE_FLOW_ITEM_TYPE_ANY ✨

Definition at line 798 of file rte_flow.h.

⭐ rte_flow_item_port_id_mask

Initial value:

= {
    .id = 0xffffffff,
}

Default mask for RTE_FLOW_ITEM_TYPE_PORT_ID. it's the "yes babe match the whole field" starter pack 🫶

Definition at line 823 of file rte_flow.h.


⭐ rte_flow_item_raw_mask

Initial value:

= {
    .relative = 1,
    .search = 1,
    .reserved = 0x3fffffff,
    .offset = 0xffffffff,
    .limit = 0xffff,
    .length = 0xffff,
    .pattern = NULL,
}

Default mask for RTE_FLOW_ITEM_TYPE_RAW. literally the blueprint for matching raw byte chaos, tyvm 💀

Definition at line 858 of file rte_flow.h.


🦋 rte_flow_item_eth_mask

Initial value:

= {
    .hdr.dst_addr.addr_bytes = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff },
    .hdr.src_addr.addr_bytes = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff },
    .hdr.ether_type = RTE_BE16(0x0000),
}

Default mask for RTE_FLOW_ITEM_TYPE_ETH. six bytes of 0xff on each MAC address, we love her 👑

Definition at line 905 of file rte_flow.h.


🌸 rte_flow_item_vlan_mask

Initial value:

= {
    .hdr.vlan_tci = RTE_BE16(0x0fff),
    .hdr.eth_proto = RTE_BE16(0x0000),
}

Default mask for RTE_FLOW_ITEM_TYPE_VLAN. that 0x0fff is lowkey doing so much work here, periodt ✨

Definition at line 946 of file rte_flow.h.


💜 rte_flow_item_ipv4_mask

Initial value:

= {
    .hdr = {
        .src_addr = RTE_BE32(0xffffffff),
        .dst_addr = RTE_BE32(0xffffffff),
    },
}

Default mask for RTE_FLOW_ITEM_TYPE_IPV4. both addrs fully masked, no crumbs left, iconic 🌈

Definition at line 965 of file rte_flow.h.


🎀 rte_flow_item_ipv6_mask

Initial value:

= {
    .hdr = {
        .src_addr = RTE_IPV6_MASK_FULL,
        .dst_addr = RTE_IPV6_MASK_FULL,
    },
}

Default mask for RTE_FLOW_ITEM_TYPE_IPV6. RTE_IPV6_MASK_FULL on both because 128 bits deserve the full treatment bestie 💅

Definition at line 1006 of file rte_flow.h.


🍓 rte_flow_item_icmp_mask

Initial value:

= {
    .hdr = {
        .icmp_type = 0xff,
        .icmp_code = 0xff,
    },
}

Default mask for RTE_FLOW_ITEM_TYPE_ICMP. 0xff type, 0xff code, match the whole thing fr fr 😭

Definition at line 1037 of file rte_flow.h.


⭐ rte_flow_item_udp_mask

Initial value:

= {
    .hdr = {
        .src_port = RTE_BE16(0xffff),
        .dst_port = RTE_BE16(0xffff),
    },
}

Default mask for RTE_FLOW_ITEM_TYPE_UDP. ports fully masked, she's not playing games ✨

Definition at line 1056 of file rte_flow.h.


🔥 rte_flow_item_tcp_mask

Initial value:

= {
    .hdr = {
        .src_port = RTE_BE16(0xffff),
        .dst_port = RTE_BE16(0xffff),
    },
}

Default mask for RTE_FLOW_ITEM_TYPE_TCP. same energy as UDP, different protocol, still slaying 🫶

Definition at line 1075 of file rte_flow.h.


💖 rte_flow_item_sctp_mask

Initial value:

= {
    .hdr = {
        .src_port = RTE_BE16(0xffff),
        .dst_port = RTE_BE16(0xffff),
    },
}

Default mask for RTE_FLOW_ITEM_TYPE_SCTP. yes bestie, the SCTP girlies get a full-port mask too 👑

Definition at line 1094 of file rte_flow.h.


🧚 rte_flow_item_vxlan_mask

Initial value:

= {
    .hdr.vni = { 0xff, 0xff, 0xff },
}

Default mask for RTE_FLOW_ITEM_TYPE_VXLAN. three bytes of VNI, fully masked, tunnel vibes only 🌈

Definition at line 1130 of file rte_flow.h.


💜 rte_flow_item_e_tag_mask

Initial value:

= {
    .rsvd_grp_ecid_b = RTE_BE16(0x3fff),
}

Default mask for RTE_FLOW_ITEM_TYPE_E_TAG. 0x3fff covers the group + ECID + reserved crew 🎀

Definition at line 1158 of file rte_flow.h.


🦋 rte_flow_item_nvgre_mask

Initial value:

= {
    .tni =  { 0xff, 0xff, 0xff },
}

Default mask for RTE_FLOW_ITEM_TYPE_NVGRE. TNI got that three-byte full mask treatment, no cap 🫶

Definition at line 1183 of file rte_flow.h.


⭐ rte_flow_item_mpls_mask

Initial value:

= {
    .label_tc_s = { 0xff, 0xff, 0xf0 },
}

Default mask for RTE_FLOW_ITEM_TYPE_MPLS. notice the 0xf0 at the end — that's not a typo bestie, that's finesse 💅

Definition at line 1203 of file rte_flow.h.


🌸 rte_flow_item_gre_mask

Initial value:

= {
    .protocol = RTE_BE16(0xffff),
}

Default mask for RTE_FLOW_ITEM_TYPE_GRE. protocol field, fully masked, obsessed 🔥

Definition at line 1224 of file rte_flow.h.


💀 rte_flow_item_fuzzy_mask

Initial value:

= {
    .thresh = 0xffffffff,
}

Default mask for RTE_FLOW_ITEM_TYPE_FUZZY. a whole 0xffffffff threshold because fuzzy matching is that girl 🍓

Definition at line 1272 of file rte_flow.h.


💖 rte_flow_item_gtp_mask

Initial value:

= {
    .hdr.teid = RTE_BE32(UINT32_MAX),
}

Default mask for RTE_FLOW_ITEM_TYPE_GTP. RTE_BE32(UINT32_MAX) for the TEID, maxed out and glowing ✨

Definition at line 1306 of file rte_flow.h.


🎀 rte_flow_item_esp_mask

Initial value:

= {
    .hdr = {
        .spi = RTE_BE32(0xffffffff),
    },
}

Default mask for RTE_FLOW_ITEM_TYPE_ESP. full 0xffffffff SPI mask, mysterious and powerful 🦋

Definition at line 1322 of file rte_flow.h.


🌈 rte_flow_item_geneve_mask

Initial value:

= {
    .vni =  { 0xff, 0xff, 0xff },
}

Default mask for RTE_FLOW_ITEM_TYPE_GENEVE. another three-byte VNI situation, she's consistent 💅

Definition at line 1347 of file rte_flow.h.


🧚 rte_flow_item_vxlan_gpe_mask

Initial value:

= {
    .hdr.vni =  { 0xff, 0xff, 0xff },
}

Deprecated 😭

See also

  • rte_flow_item_vxlan_mask
bestie this one is deprecated — the docs literally point you at rte_flow_item_vxlan_mask instead. go there, she's the moment.

Default mask for RTE_FLOW_ITEM_TYPE_VXLAN_GPE.

Definition at line 1384 of file rte_flow.h.


💜 rte_flow_item_arp_eth_ipv4_mask

Initial value:

= {
    .hdr.arp_data.arp_sha.addr_bytes = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff },
    .hdr.arp_data.arp_sip = RTE_BE32(UINT32_MAX),
    .hdr.arp_data.arp_tha.addr_bytes = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff },
    .hdr.arp_data.arp_tip = RTE_BE32(UINT32_MAX),
}

Default mask for RTE_FLOW_ITEM_TYPE_ARP_ETH_IPV4. four full masks stacked, this is the ARP glow-up ✨

Definition at line 1418 of file rte_flow.h.


⭐ rte_flow_item_ipv6_ext_mask

Initial value:

= {
    .next_hdr = 0xff,
}

Default mask for RTE_FLOW_ITEM_TYPE_IPV6_EXT. just the next header, fully masked, minimal queen 🎀

Definition at line 1443 of file rte_flow.h.


🍓 rte_flow_item_icmp6_mask

Initial value:

= {
    .type = 0xff,
    .code = 0xff,
}

Default mask for RTE_FLOW_ITEM_TYPE_ICMP6. type and code, both 0xff, both thriving 🔥

Definition at line 1475 of file rte_flow.h.


🦋 rte_flow_item_icmp6_nd_ns_mask

Initial value:

= {
    .target_addr = RTE_IPV6_MASK_FULL,
}

Default mask for RTE_FLOW_ITEM_TYPE_ICMP6_ND_NS. RTE_IPV6_MASK_FULL on the target address, because neighbor solicitation deserves the whole 128 bits 💅

Definition at line 1507 of file rte_flow.h.


🌸 rte_flow_item_icmp6_nd_na_mask

Initial value:

= {
    .target_addr = RTE_IPV6_MASK_FULL,
}

Default mask for RTE_FLOW_ITEM_TYPE_ICMP6_ND_NA. same full-address energy, this time for neighbor advertisement 👑

Definition at line 1532 of file rte_flow.h.


💖 rte_flow_item_icmp6_nd_opt_mask

Initial value:

= {
    .type = 0xff,
}

Default mask for RTE_FLOW_ITEM_TYPE_ICMP6_ND_OPT. one field, one 0xff, zero notes 🫶

Definition at line 1556 of file rte_flow.h.


🎀 rte_flow_item_icmp6_nd_opt_sla_eth_mask

Initial value:

= {
    .sla.addr_bytes = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff },
}

Default mask for RTE_FLOW_ITEM_TYPE_ICMP6_ND_OPT_SLA_ETH. six bytes of 0xff for the source link-layer address, immaculate ✨

Definition at line 1581 of file rte_flow.h.


🦋 rte_flow_item_icmp6_nd_opt_tla_eth_mask

Initial value:

= {
    .tla.addr_bytes = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff },
}

Default mask for RTE_FLOW_ITEM_TYPE_ICMP6_ND_OPT_TLA_ETH. twin of the SLA one but make it target link-layer 💅

Definition at line 1606 of file rte_flow.h.


⭐ rte_flow_item_meta_mask

Initial value:

= {
    .data = UINT32_MAX,
}

Default mask for RTE_FLOW_ITEM_TYPE_META. UINT32_MAX, the whole data field, no crumbs 🌈

Definition at line 1628 of file rte_flow.h.


🔥 rte_flow_item_gtp_psc_mask

Initial value:

= {
    .hdr.qfi = 0x3f,
}

Default mask for RTE_FLOW_ITEM_TYPE_GTP_PSC. 0x3f for the QFI because six bits is all she needs 🍓

Definition at line 1645 of file rte_flow.h.


💜 rte_flow_item_pppoe_proto_id_mask

Initial value:

= {
    .proto_id = RTE_BE16(0xffff),
}

Default mask for RTE_FLOW_ITEM_TYPE_PPPOE_PROTO_ID. full 0xffff on the protocol id, iconic behavior only 👑

Definition at line 1684 of file rte_flow.h.


🧚 rte_flow_item_tag_mask

Initial value:

= {
    .data = 0xffffffff,
    .index = 0xff,
}

Default mask for RTE_FLOW_ITEM_TYPE_TAG. data AND index both maxed out, she contains multitudes 💖

Definition at line 1704 of file rte_flow.h.


🌸 rte_flow_item_l2tpv3oip_mask

Initial value:

= {
    .session_id = RTE_BE32(UINT32_MAX),
}

Default mask for RTE_FLOW_ITEM_TYPE_L2TPV3OIP. RTE_BE32(UINT32_MAX) session id, fully matched, periodt ✨

Definition at line 1721 of file rte_flow.h.


⭐ rte_flow_item_mark_mask

Initial value:

= {
    .id = 0xffffffff,
}

Default mask for RTE_FLOW_ITEM_TYPE_MARK. whole 0xffffffff id, because marks are for matching (iykyk) 🫶

Definition at line 1751 of file rte_flow.h.


🌈 rte_flow_item_nsh_mask

Initial value:

= {
    .mdtype = 0xf,
    .next_proto = 0xff,
    .spi = 0xffffff,
    .sindex = 0xff,
}

Default mask for RTE_FLOW_ITEM_TYPE_NSH. four fields, four masks, one very thorough bestie 💅

Definition at line 1779 of file rte_flow.h.


🍓 rte_flow_item_igmp_mask

Initial value:

= {
    .group_addr = 0xffffffff,
}

Default mask for RTE_FLOW_ITEM_TYPE_IGMP. group address, fully masked, group chat energy fr fr 😭

Definition at line 1804 of file rte_flow.h.


🎀 rte_flow_item_ah_mask

Initial value:

= {
    .spi = 0xffffffff,
}

Default mask for RTE_FLOW_ITEM_TYPE_AH. full SPI mask, security header staying mysterious 🦋

Definition at line 1827 of file rte_flow.h.


💜 rte_flow_item_pfcp_mask

Initial value:

= {
    .s_field = 0x01,
    .seid = RTE_BE64(UINT64_C(0xffffffffffffffff)),
}

Default mask for RTE_FLOW_ITEM_TYPE_PFCP. a whole 64-bit RTE_BE64(UINT64_C(0xffffffffffffffff)) for seid, we are obsessed 🔥

Definition at line 1849 of file rte_flow.h.


🧚 rte_flow_item_ecpri_mask

Initial value:

= {
    .hdr = {
        .common = {
            .u32 = 0x0,
        },
    },
}

Default mask for RTE_FLOW_ITEM_TYPE_ECPRI. mask value 0x0 in there, and yes bestie that's exactly what the docs say, don't come for me 💀

Definition at line 1869 of file rte_flow.h.


⭐ rte_flow_item_geneve_opt_mask

Initial value:

= {
    .option_type = 0xff,
}

Default mask for RTE_FLOW_ITEM_TYPE_GENEVE_OPT. one 0xff on the option type, cute and effective, that's the whole vibe 🎀

Definition at line 1893 of file rte_flow.h.

🌸 rte_flow_item_conntrack_mask 🌸

const struct rte_flow_item_conntrack rte_flow_item_conntrack_mask [static]

okay so it starts off looking like this:

= {
    .flags = 0xffffffff,
}

This is the default mask for RTE_FLOW_ITEM_TYPE_CONNTRACK, bestie 💅

Defined at line 1984 of rte_flow.h.


🦋 rte_flow_item_ethdev_mask 🦋

const struct rte_flow_item_ethdev rte_flow_item_ethdev_mask [static]

and it's giving:

= {
    .port_id = 0xffff,
}

Default mask for items based on struct rte_flow_item_ethdev, no cap ✨

Defined at line 2000 of rte_flow.h.


🎀 rte_flow_item_l2tpv2_mask 🎀

const struct rte_flow_item_l2tpv2 rte_flow_item_l2tpv2_mask [static]

nesting hours, fr fr:

= {

    .hdr = {
        .common = {
            .flags_version = RTE_BE16(0xcb0f),
        },
    },
}

Default mask for RTE_FLOW_ITEM_TYPE_L2TPV2 — she's layered, she's iconic 💜

Defined at line 2019 of rte_flow.h.


🌈 rte_flow_item_ppp_mask 🌈

const struct rte_flow_item_ppp rte_flow_item_ppp_mask [static]

which lowkey looks like:

= {
    .hdr = {
        .addr = 0xff,
        .ctrl = 0xff,
        .proto_id = RTE_BE16(0xffff),
    }
}

Default mask for RTE_FLOW_ITEM_TYPE_PPP 🫶

Defined at line 2047 of rte_flow.h.


💖 rte_flow_item_ib_bth_mask 💖

const struct rte_flow_item_ib_bth rte_flow_item_ib_bth_mask [static]

and the initial value is:

= {
    .hdr = {
        .opcode = 0xff,
        .dst_qp =  { 0xff, 0xff, 0xff },
    },
}

Default mask for RTE_FLOW_ITEM_TYPE_IB_BTH, slay 🦋

Defined at line 2067 of rte_flow.h.


⭐ rte_flow_item_random_mask ⭐

const struct rte_flow_item_random rte_flow_item_random_mask [static]

starting out as:

= {
    .value = UINT32_MAX,
}

Default mask for RTE_FLOW_ITEM_TYPE_RANDOM 🌸

Defined at line 2089 of rte_flow.h.


🍓 rte_flow_item_meter_color_mask 🍓

const struct rte_flow_item_meter_color rte_flow_item_meter_color_mask
    [static]

(the long name wraps, she's just built different 😭) and her initial value is:

= {
    .color = RTE_COLORS,
}

Default mask for RTE_FLOW_ITEM_TYPE_METER_COLOR 💅

Defined at line 2316 of rte_flow.h.


🧚 rte_flow_item_aggr_affinity_mask 🧚

const struct rte_flow_item_aggr_affinity rte_flow_item_aggr_affinity_mask
    [static]

which kicks off as:

= {
    .affinity = 0xff,
}

Default mask for RTE_FLOW_ITEM_TYPE_AGGR_AFFINITY, periodt ✨

Defined at line 2342 of rte_flow.h.


💀 rte_flow_item_tx_queue_mask 💀

const struct rte_flow_item_tx_queue rte_flow_item_tx_queue_mask [static]

initial value moment:

= {
    .tx_queue = 0xffff,
}

Default mask for RTE_FLOW_ITEM_TX_QUEUE 🔥

Defined at line 2361 of rte_flow.h.


👑 rte_flow_item_ptype_mask 👑

const struct rte_flow_item_ptype rte_flow_item_ptype_mask [static]

and she's serving:

= {
    .packet_type = 0xffffffff,
}

Default mask for RTE_FLOW_ITEM_TYPE_PTYPE — last one on the list, closing the show 🌟

Defined at line 2378 of rte_flow.h.


💜 Author 💜

Generated automatically by Doxygen for DPDK from the source code. (yes bestie, a robot wrote this, not me, I'm just the translator 🫶)


aaaand that's a wrap on rte_flow.h 😭💖 every single mask, every single line number, all of it — we ate and left zero crumbs. This whole glow-up was pulled from the DPDK docs, Version 25.11.3, dated rte_flow.h(3) — so go forth, match some packets, and remember: masks are just vibes with a bitwise AND. mwah 💅✨🌈

📦 where this page comes from