rte_flow.h(3)

๐Ÿ“ฆ version 26.03, in nixos 26.05, nixpkgs unstable

๐Ÿ’– rte_flow.h ๐Ÿ’–

okay bestie, buckle up, because this is the manual page for rte_flow.h โ€” yes, that header โ€” and she is a whole icon. this is the flow API, the thing that lets you describe traffic patterns and tell the NIC what to do with them. it's giving main character energy and honestly it's a lot, so we're doing this together, one section at a time. no cap. ๐Ÿซถ


โœจ NAME โœจ

rte_flow.h โ€” literally the header file, that's the name, that's the vibe. ๐Ÿ’…


๐Ÿฆ‹ SYNOPSIS ๐Ÿฆ‹

so first things first, she pulls in a stack of other headers. like, all of them. don't ask, just let her cook:

#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'

(and yes, that last one is sitting there with single quotes, exactly like that, we don't question the queen's choices โœจ)


๐Ÿ’ซ Data Structures ๐Ÿ’ซ

brace yourself, this is the long part, but every single one of these structs is here for a reason and we are NOT skipping any. screenshot it, study it, slay it:

  • 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

likeโ€ฆ that's the whole guest list and every single one of them RSVP'd yes. ๐ŸŽ€


๐ŸŽ€ Macros ๐ŸŽ€

now the macros, and these are little bit-flag cuties. RTE_BIT32() and RTE_BIT64() are just making the bits, you know how it is:

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

then there's a whole separate little cluster of defines for the template table attribute flags ๐Ÿ‘‡

๐ŸŒธ Flags for template table attribute ๐ŸŒธ

okay so here's the tea: each bit is an optional hint for table specialization, offering a potential optimization at the driver layer. but bestie, hear me โ€” the driver can ignore the hints silently. like, it can just look at your cute little hint and be like "cool" and move on. also, and this is important, the hints do not replace any matching criteria. they're hints, not rules. periodt.

#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)
lowkey the most important line in this whole subsection: hints are hints. never assume the driver did anything with them. fr fr. ๐Ÿ’€

that's part 1 bestie, don't go anywhere, more is coming ๐Ÿ’œ

๐ŸŒˆ ENUMERATIONS ๐ŸŒˆ

Okay bestie, this is the big roster part โ€” every single enum in this header, in order, with every enumerator exactly as declared. No skipping, no shortcuts, we are reading the whole list ๐Ÿ’…

enum rte_flow_item_type

The main-character enum of the whole file: every pattern item type that exists. Here's the full list, and yes, all of them matter:

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
}

Yes, RTE_FLOW_ITEM_TYPE_COMPARE is last and it's giving "saved the spiciest for the end" energy ๐Ÿ”ฅ


enum rte_flow_quota_state

Two moods only, no in-between:

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 field gets interpreted โ€” four flavours, and the first one starts at zero:

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

Flex tunnel vibes, five settings, SINGLE = 0 gets the party started:

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

Every field you can point at, whole list, in order โ€” RTE_FLOW_FIELD_START = 0 and then it's off to the races:

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

The header literally just declares it:

enum rte_flow_item_compare_op

No enumerators listed here, so don't come for me โ€” that's all the page gives us ๐Ÿ™ˆ

enum rte_flow_action_type

The action side of the house, and it is long. Every value, verbatim:

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

Three modes, and the numbers start at 1 โ€” <pink>no zero, she doesn't do zero</pink>:

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

Two ways to update a quota: set it, or add to it:

enum rte_flow_update_quota_op {
    RTE_FLOW_UPDATE_QUOTA_SET,
    RTE_FLOW_UPDATE_QUOTA_ADD
}

enum rte_flow_nat64_type

NAT64 directions, with explicit values 0 and 1:

enum rte_flow_nat64_type {
    RTE_FLOW_NAT64_6TO4 = 0,
    RTE_FLOW_NAT64_4TO6 = 1
}

enum rte_flow_conntrack_state

The conntrack state machine, six states, all listed:

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

These are TCP flag bits, built with RTE_BIT32(...) โ€” keep the calls exactly as written:

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)
}
๐Ÿซถ Notice RTE_FLOW_CONNTRACK_FLAG_NONE is 0 and the rest are RTE_BIT32(n) โ€” that's not me being cute, that's literally the header.

enum rte_flow_modify_op

Three modify operations, SET at 0:

enum rte_flow_modify_op {
    RTE_FLOW_MODIFY_SET = 0,
    RTE_FLOW_MODIFY_ADD,
    RTE_FLOW_MODIFY_SUB
}

enum rte_flow_error_type

When something goes wrong, it's one of these. The whole error taxonomy, in order:

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

Conversion operations โ€” what you're converting to. Both the name variants and the pointer variants are here:

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 a rule gets inserted into a table โ€” three ways:

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

The hash function menu for flow tables ๐Ÿ“:

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

Two outcomes, that's it:

enum rte_flow_op_status {
    RTE_FLOW_OP_SUCCESS,
    RTE_FLOW_OP_ERROR
}

enum rte_flow_query_update_mode

Which comes first, the query or the update โ€” and the values are explicit:

enum rte_flow_query_update_mode {
    RTE_FLOW_QU_QUERY_FIRST = 1,
    RTE_FLOW_QU_UPDATE_FIRST
}
โœจ Heads up: RTE_FLOW_QU_QUERY_FIRST = 1, so RTE_FLOW_QU_UPDATE_FIRST follows it. That's what the header says, and I'm not touching it.

enum rte_flow_encap_hash_field

Last two of this batch โ€” encapsulation hash fields:

enum rte_flow_encap_hash_field {
    RTE_FLOW_ENCAP_HASH_FIELD_SRC_PORT,
    RTE_FLOW_ENCAP_HASH_FIELD_NVGRE_FLOW_ID
}

That's the entire enum block, bestie โ€” nothing dropped, nothing merged, `every last enumerator accounted for ๐Ÿ’š The structs and the rest of the header are still coming, so stay perched ๐Ÿ‘‘


โœจ Functions โœจ

okay bestie, this is the big one ๐Ÿ˜ญ โ€” literally every single rte_flow call you can make, in order, no skips, no "etc." We're doing all of them. Grab a snack ๐Ÿ“.


rte_flow_dev_dump โ€” experimental, and it's giving "show me what you got" energy ๐Ÿ’…

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

rte_flow_dynf_metadata_avail โ€” static, experimental, takes (void) because it wants nothing from you ๐Ÿ™ˆ

static __rte_experimental int rte_flow_dynf_metadata_avail (void)

rte_flow_dynf_metadata_register โ€” experimental, also (void), also unbothered ๐Ÿ’œ

__rte_experimental int rte_flow_dynf_metadata_register (void)

rte_flow_validate โ€” no __rte_experimental tag on this one, she's stable and confident โœจ

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)

rte_flow_create โ€” returns a struct rte_flow *, main character behavior ๐Ÿ‘‘

struct rte_flow * rte_flow_create (uint16_t port_id, const struct
    rte_flow_attr *attr, const struct rte_flow_item pattern[], const
    struct rte_flow_action actions[], struct rte_flow_error *error)

rte_flow_destroy โ€” the breakup arc ๐Ÿ’€

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

rte_flow_actions_update โ€” experimental glow-up, changing the fit without changing the girl ๐ŸŽ€

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

rte_flow_flush โ€” short signature, big "clean slate" energy ๐ŸŒˆ

int rte_flow_flush (uint16_t port_id, struct rte_flow_error *error)

rte_flow_query โ€” note that data is a void *, so she's flexible like that ๐Ÿฆ‹

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)

rte_flow_isolate โ€” takes an int set and honestly the parameter name is doing the whole explanation ๐Ÿซถ

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

rte_flow_error_set โ€” the one that fills in your struct rte_flow_error with code, type, cause and message. error-handling icon ๐Ÿ’…

int rte_flow_error_set (struct rte_flow_error *error, int code, enum
    rte_flow_error_type type, const void *cause, const char *message)
lowkey important: rte_flow_copy is marked __rte_deprecated ๐Ÿ˜ญ she's still in the list but the tag is right there in the signature, no cap.

rte_flow_copy โ€” deprecated, returns size_t, takes the whole rte_flow_desc + attr + items + actions set. retired legend ๐ŸŒธ

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

rte_flow_conv โ€” experimental, enum rte_flow_conv_op op decides the agenda โœจ

__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_flow_get_aged_flows โ€” experimental, hands you back void **contexts and there are nb_contexts of them โญ

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

rte_flow_get_q_aged_flows โ€” same vibe but with a uint32_t queue_id because she's queue-specific ๐ŸŽ€

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

rte_flow_action_handle_create โ€” experimental, returns struct rte_flow_action_handle *, takes a struct rte_flow_indir_action_conf *conf ๐Ÿ‘‘

__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_flow_action_handle_destroy โ€” experimental, the matching breakup ๐Ÿ’”

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

rte_flow_action_handle_update โ€” experimental, const void *update carries the new tea ๐Ÿต

__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_flow_action_handle_query โ€” experimental, and yes the handle is const here, she's just reading ๐Ÿ”

__rte_experimental int rte_flow_action_handle_query (uint16_t port_id,
    const struct rte_flow_action_handle *handle, void *data, struct
    rte_flow_error *error)

rte_flow_tunnel_decap_set โ€” experimental, struct rte_flow_action **actions + uint32_t *num_of_actions, double pointer princess ๐Ÿ’…

__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_flow_tunnel_match โ€” experimental, this time it hands back struct rte_flow_item **items and uint32_t *num_of_items ๐ŸŒธ

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

rte_flow_restore_info_dynflag โ€” experimental, returns uint64_t, (void) params, drama-free โญ

__rte_experimental uint64_t rte_flow_restore_info_dynflag (void)

rte_flow_get_restore_info โ€” experimental, wants a struct rte_mbuf *m and fills a struct rte_flow_restore_info *info ๐Ÿฆ‹

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

rte_flow_tunnel_action_decap_release โ€” experimental, the cleanup arc for your actions, bestie ๐Ÿงน

__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_flow_tunnel_item_release โ€” experimental, same energy but for struct rte_flow_item *items โœจ

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

rte_flow_pick_transfer_proxy โ€” no experimental tag, hands you a uint16_t *proxy_port_id ๐ŸŽ€

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

rte_flow_flex_item_create โ€” experimental, returns struct rte_flow_item_flex_handle *, flex is literally in the name and she earned it ๐Ÿ’ช

__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_flow_flex_item_release โ€” experimental, the const struct rte_flow_item_flex_handle *handle gets released, respectfully ๐ŸŒธ

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

rte_flow_info_get โ€” experimental, gives you struct rte_flow_port_info *port_info and struct rte_flow_queue_info *queue_info in one trip ๐Ÿซถ

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

rte_flow_configure โ€” experimental, and look at that const struct rte_flow_queue_attr *queue_attr[] with uint16_t nb_queue โ€” she's an array girlie now ๐Ÿ˜ญ

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

rte_flow_pattern_template_create โ€” experimental, template era begins, struct rte_flow_pattern_template * coming right up โœจ

__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_flow_pattern_template_destroy โ€” experimental, bye template ๐Ÿ‘‹

__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_flow_actions_template_create โ€” experimental, and note she takes both actions[] and masks[] โ€” yes queen, get both ๐Ÿ’…

__rte_experimental struct rte_flow_actions_template *
    rte_flow_actions_template_create (uint16_t port_id, const struct
    rte_flow_actions_template_attr *template_attr, const struct
    rte_flow_action actions[], const struct rte_flow_action masks[],
    struct rte_flow_error *error)

rte_flow_actions_template_destroy โ€” experimental, the matching goodbye ๐ŸŽ€

__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_flow_template_table_resizable โ€” experimental, returns bool, and the port_id is tagged __rte_unused because she literally does not need it, icon behavior ๐Ÿ’€

__rte_experimental bool rte_flow_template_table_resizable (__rte_unused
    uint16_t port_id, const struct rte_flow_template_table_attr
    *tbl_attr)

rte_flow_template_table_create โ€” experimental, biggest guest list of the night: pattern_templates[], nb_pattern_templates, actions_templates[], nb_actions_templates ๐ŸŒˆ

__rte_experimental struct rte_flow_template_table *
    rte_flow_template_table_create (uint16_t port_id, const struct
    rte_flow_template_table_attr *table_attr, struct
    rte_flow_pattern_template *pattern_templates[], uint8_t
    nb_pattern_templates, struct rte_flow_actions_template
    *actions_templates[], uint8_t nb_actions_templates, struct
    rte_flow_error *error)

rte_flow_template_table_destroy โ€” experimental, packing up ๐Ÿงณ

__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_flow_group_set_miss_actions โ€” experimental, uint32_t group_id + struct rte_flow_group_attr *attr + actions[], she's got range ๐ŸŒธ

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

okay and now the async girlies, aka the ones with a queue_id and user_data in every single signature ๐Ÿ˜ญ it's giving group chat where everyone has the same three friends.

rte_flow_async_create โ€” experimental, struct rte_flow *, and yes there's pattern_template_index and actions_template_index because why choose ๐Ÿ’…

__rte_experimental struct rte_flow * rte_flow_async_create (uint16_t
    port_id, uint32_t queue_id, const struct rte_flow_op_attr *op_attr,
    struct rte_flow_template_table *template_table, const struct
    rte_flow_item pattern[], uint8_t pattern_template_index, const
    struct rte_flow_action actions[], uint8_t actions_template_index,
    void *user_data, struct rte_flow_error *error)

rte_flow_async_create_by_index โ€” experimental, same but she swaps pattern[] for a uint32_t rule_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)

rte_flow_async_create_by_index_with_pattern โ€” experimental, and she said "why not both" and gave you rule_index plus pattern[] plus pattern_template_index. overachiever ๐Ÿ†

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

rte_flow_async_destroy โ€” experimental, async breakup, void *user_data gets to come along too ๐Ÿ˜ญ

__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_flow_async_actions_update โ€” experimental, async glow-up with an actions_template_index ๐Ÿ’…

__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_flow_push โ€” experimental, tiny signature, huge main character energy ๐Ÿ”ฅ

__rte_experimental int rte_flow_push (uint16_t port_id, uint32_t
    queue_id, struct rte_flow_error *error)

rte_flow_pull โ€” experimental, the other half of the push/pull duo, gives you struct rte_flow_op_result res[] all uint16_t n_res of them โญ

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

rte_flow_async_action_handle_create โ€” experimental, rte_flow_indir_action_conf *indir_action_conf (say that five times) ๐Ÿซถ

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

rte_flow_async_action_handle_destroy โ€” experimental, async handle breakup, no notes ๐ŸŒธ

__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_flow_async_action_handle_update โ€” experimental, const void *update + user_data, iconic combo ๐ŸŽ€

__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_flow_async_action_handle_query โ€” experimental, and the handle is const again because we are not touching her ๐Ÿ”

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

rte_flow_action_handle_query_update โ€” experimental, and bestie she does both, update and query, in one call. multitasking queen ๐Ÿ‘‘ plus there's an enum rte_flow_query_update_mode mode to pick the vibe

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

rte_flow_async_action_handle_query_update โ€” experimental, the async version, and heads up: her op attr param is named attr, not op_attr like the others. little name change, still her ๐Ÿ’…

__rte_experimental int rte_flow_async_action_handle_query_update
    (uint16_t port_id, uint32_t queue_id, const struct rte_flow_op_attr
    *attr, struct rte_flow_action_handle *handle, const void *update,
    void *query, enum rte_flow_query_update_mode mode, void *user_data,
    struct rte_flow_error *error)

rte_flow_action_list_handle_create โ€” experimental, new handle type just dropped: struct rte_flow_action_list_handle * โœจ

__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_flow_async_action_list_handle_create โ€” experimental, list handle but async, and again the op attr is called attr ๐ŸŒˆ

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

rte_flow_action_list_handle_destroy โ€” experimental, and yes she's spelled rte_flow_action_list_handle_* not rte_flow_action_handle_*, keep up bestie ๐Ÿ™ˆ

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

rte_flow_async_action_list_handle_destroy โ€” experimental, and we are literally mid-signature right here because the page keeps going in the next part ๐Ÿ˜ญ don't leave yet:

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

โ€ฆand the function list keeps rolling, no brakes, bestie ๐Ÿ’… here's the rest of it:

*op_attr, struct rte_flow_action_list_handle *handle, void *user_data,
struct rte_flow_error *error)

(that's the leftover tail end of the signature that spilled in from before, mwah ๐Ÿ’‹)

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

๐ŸŒธ Variables ๐ŸŒธ

okay so these are literally all the mask globals, and yes there are a lot of them โ€” every single one is static const, so don't come for me about it โœจ

  • 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

๐Ÿฆ‹ Detailed Description ๐Ÿฆ‹

RTE generic flow API โœจ

okay so the whole point of this interface: it gives you the ability to program packet matching and associated actions in hardware through flow rules. like, hardware-level matching, not vibes ๐Ÿ’…

Definition in file rte_flow.h.


๐ŸŽ€ Macro Definition Documentation ๐ŸŽ€

#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 is 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. It can be due to application command or 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.

#define RTE_FLOW_RESTORE_INFO_TUNNEL RTE_BIT64(0)

Indicate that the packet has a tunnel.

Definition at line 5232 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 5237 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 5242 of file rte_flow.h.

#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). no queue-hopping, bestie ๐Ÿšซ

Definition at line 5487 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. sharing is caring ๐Ÿซถ

Definition at line 5494 of file rte_flow.h.

#define RTE_FLOW_TABLE_SPECIALIZE_TRANSFER_WIRE_ORIG RTE_BIT32(0)

Specialize table for transfer flows which come only from wire. It allows 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.

ngl that last bit is a whole warning: it's a hint, not a filter โ€” and if your PMD supports it, non-wire traffic just gets ghosted ๐Ÿ’€

Definition at line 5885 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 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 5893 of file rte_flow.h.

#define RTE_FLOW_TABLE_SPECIALIZE_RESIZABLE RTE_BIT32(2)

Specialize table for resize.

Definition at line 5897 of file rte_flow.h.


๐Ÿ’œ Enumeration Type Documentation ๐Ÿ’œ

enum rte_flow_item_type

Matching pattern item types. iconic, honestly ๐Ÿ‘‘

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. order matters, no chaos allowed ๐Ÿงš
  • 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. the โœจthe endโœจ of your pattern, periodt
    • 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. chaos mode, but make it intentional ๐Ÿ™ˆ
    • 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.
    • See struct rte_flow_item_ipv4.
  • RTE_FLOW_ITEM_TYPE_IPV6
    • Matches an IPv6 header.
    • 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. 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] fuzzy pattern match, expect faster than default. Bestie this one is for devices that support the fuzzy matching option โ€” usually fuzzy matching is fast but the cost is accuracy. 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 โ€” matches a VXLAN-GPE header. See struct rte_flow_item_vxlan_gpe.
โš ๏ธ Deprecated โ€” yeah she's retired, don't build your whole thing on her. See also RTE_FLOW_ITEM_TYPE_VXLAN ๐Ÿ’€
  • 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. When this item present the K bit is implicitly matched as "1" in the default mask. ๐Ÿ‘‘

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. โœจ
  • 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. Heads up bestie: for some devices the application needs to enable integration checks in HW before using this item. 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. 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. Important vibe check: this value is not based on the packet data/headers, and the application shouldn't assume that this value is kept during the lifetime of the packet. 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 still in her testing era ๐Ÿ’…

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. Like, how do we even find where the field starts, bestie? ๐Ÿค”

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. ๐Ÿซฅ
  • 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 โ€” aka, is this flex item living her inner life or her outer life? ๐Ÿงš

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. 1๏ธโƒฃ
  • 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 ๐ŸŒธ

Packet header field IDs ๐Ÿ’… โ€” these are the little name-tags you'll be using with RTE_FLOW_ACTION_TYPE_MODIFY_FIELD and RTE_FLOW_ITEM_TYPE_COMPARE. Like, if you wanna point at a field and be like "that one", these are the IDs, periodt.

Enumerator โ€” and bestie, there's a lot, so buckle up ๐ŸŽ€

  • RTE_FLOW_FIELD_START โ€” Start of a packet. Like, the very beginning, the main character entrance โœจ
  • 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. ๐ŸŽฒ iconic honestly
  • 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. Like, what kind of comparison you're asking for, iykyk.

Definition at line 2540 of file rte_flow.h.


enum rte_flow_action_type ๐Ÿ‘‘

Action types โ€” the moment you've all been waiting for ๐Ÿ’…

Every possible action gets its own type, okay? An action can absolutely have an associated configuration object (a whole little struct of its own, main character energy). And several actions combined in one list can be assigned to a flow rule and get performed in order โ€” so like, the order literally matters, don't just shuffle them ๐ŸŒธ

They fall into three categories, bestie:

  • Actions that modify the fate of matching traffic โ€” like dropping it or assigning it a specific destination.
  • Actions that modify matching traffic contents or its properties โ€” that includes adding/removing encapsulation, encryption, compression, and marks.
  • Actions related to the flow rule itself โ€” stuff like updating counters or making it non-terminating.
๐Ÿšจ Big one: flow rules are terminating by default, so if you don't specify any action of the fate kind, the result is undefined behavior. Yeah. Both ingress AND egress. Not a vibe, so don't do it ๐Ÿ™ˆ

PASSTHRU, when it's supported, makes a flow rule non-terminating. Slay.

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. Literally just there to fill space, and honestly? relatable ๐Ÿ’€

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 โ€” 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. (Yes, really โ€” PASSTHRU wins, so be careful ๐Ÿ˜ญ)

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.

(โ€ฆand we're still going, bestie โ€” see you in the next part ๐Ÿงš)

See also: RTE_FLOW_ACTION_TYPE_MODIFY_FIELD

Modify the IPv4 destination address in the outermost IPv4 header, bestie โœจ

If the flow pattern does not define a valid RTE_FLOW_ITEM_TYPE_IPV4, then the PMD should return a RTE_FLOW_ERROR_TYPE_ACTION error. No vibes, no address, no service ๐Ÿ’…

See struct rte_flow_action_set_ipv4.


RTE_FLOW_ACTION_TYPE_SET_IPV6_SRC

โš ๏ธ Warning โ€” This is a legacy action. Like, it still works but it's giving "old money," not "new money" ๐Ÿ‘‘

See also: RTE_FLOW_ACTION_TYPE_MODIFY_FIELD

Modify the IPv6 source address in the outermost IPv6 header.

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

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

Modify the IPv6 destination address in the outermost IPv6 header.

If the flow pattern does not define a valid RTE_FLOW_ITEM_TYPE_IPV6, then the PMD should return a RTE_FLOW_ERROR_TYPE_ACTION error. That's the rule, iykyk ๐ŸŒธ

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

Modify the source port number in the outermost TCP/UDP header ๐ŸŽ€

If the flow pattern does not define a valid RTE_FLOW_ITEM_TYPE_TCP or RTE_FLOW_ITEM_TYPE_UDP, then 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

Modify the destination port number in the outermost TCP/UDP header.

If the flow pattern does not define a valid RTE_FLOW_ITEM_TYPE_TCP or RTE_FLOW_ITEM_TYPE_UDP, then the PMD should return a RTE_FLOW_ERROR_TYPE_ACTION error ๐Ÿ’€

See struct rte_flow_action_set_tp.


RTE_FLOW_ACTION_TYPE_MAC_SWAP

Swap the source and destination MAC addresses in the outermost Ethernet header. Literally just a little switcheroo ๐Ÿ”„

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

No associated configuration structure. Nothing to configure, she just does her thing โœจ


RTE_FLOW_ACTION_TYPE_DEC_TTL

โš ๏ธ Warning โ€” This is a legacy action.

See also: RTE_FLOW_ACTION_TYPE_MODIFY_FIELD

Decrease the TTL value directly.

No associated configuration structure. Zero config needed, so unbothered of her ๐Ÿซถ


RTE_FLOW_ACTION_TYPE_SET_TTL

โš ๏ธ Warning โ€” This is a legacy action.

See also: RTE_FLOW_ACTION_TYPE_MODIFY_FIELD

Set 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

Set the source MAC address from the matched flow.

If the flow pattern does not 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

Set the destination MAC address from the matched flow.

If the flow pattern does not 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

Increase the sequence number in the outermost TCP header. Little bump up โฌ†๏ธ

Action configuration specifies the value to increase the TCP sequence number as a big-endian 32 bit integer. conf type:

rte_be32_t *
๐Ÿšจ Using this action on non-matching traffic will result in undefined behavior. Don't do it, bestie, it's not cute ๐Ÿ’€

RTE_FLOW_ACTION_TYPE_DEC_TCP_SEQ

โš ๏ธ Warning โ€” This is a legacy action.

See also: RTE_FLOW_ACTION_TYPE_MODIFY_FIELD

Decrease the sequence number in the outermost TCP header. Little bump down โฌ‡๏ธ

Action configuration specifies the value to decrease the TCP sequence number as a big-endian 32 bit integer. conf type:

rte_be32_t *
๐Ÿšจ Using this action on non-matching traffic will result in undefined behavior. Same warning, same energy ๐Ÿ”ฅ

RTE_FLOW_ACTION_TYPE_INC_TCP_ACK

โš ๏ธ Warning โ€” This is a legacy action.

See also: RTE_FLOW_ACTION_TYPE_MODIFY_FIELD

Increase the acknowledgment number in the outermost TCP header.

Action configuration specifies the value to increase the TCP acknowledgment number as a big-endian 32 bit integer. conf type:

rte_be32_t *
๐Ÿšจ Using this action on non-matching traffic will result in undefined behavior. Undefined is not a personality trait, ok? ๐Ÿ’…

RTE_FLOW_ACTION_TYPE_DEC_TCP_ACK

โš ๏ธ Warning โ€” This is a legacy action.

See also: RTE_FLOW_ACTION_TYPE_MODIFY_FIELD

Decrease the acknowledgment number in the outermost TCP header.

Action configuration specifies the value to decrease the TCP acknowledgment number as a big-endian 32 bit integer. conf type:

rte_be32_t *
๐Ÿšจ Using this action on non-matching traffic will result in undefined behavior. You've been warned ๐Ÿซถ

RTE_FLOW_ACTION_TYPE_SET_TAG

โš ๏ธ Warning โ€” This is a legacy action.

See also: RTE_FLOW_ACTION_TYPE_MODIFY_FIELD

Set a Tag.

Tag is for internal flow usage only and is not delivered to the application. It's giving backstage pass, not front row ๐ŸŽŸ๏ธ

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

Set 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

Modify the IPv4 DSCP in the outermost IP header.

If the 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_dscp.


RTE_FLOW_ACTION_TYPE_SET_IPV6_DSCP

โš ๏ธ Warning โ€” This is a legacy action.

See also: RTE_FLOW_ACTION_TYPE_MODIFY_FIELD

Modify the IPv6 DSCP in the outermost IP header.

If the flow pattern does not 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

Report as an aged flow if the timeout passed without any matching on the flow. She waited, nobody came, so she's officially aged ๐Ÿ˜ญโŒ›

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. Like a little copy-paste moment, but make it networking ๐Ÿฆ‹

See struct rte_flow_action_sample.


RTE_FLOW_ACTION_TYPE_SHARED

Deprecated ๐Ÿšซ โ€” she's retired, she's moved on, don't @ her.

See also: RTE_FLOW_ACTION_TYPE_INDIRECT

Describe an action shared across multiple flow rules.

Allow multiple rules to reference the same action by handle (see struct rte_flow_shared_action). Sharing is caring, and it's also efficient ๐Ÿ’–


RTE_FLOW_ACTION_TYPE_MODIFY_FIELD

Modify a packet header field, tag, mark or metadata.

Allow the modification of an arbitrary header field via set, add and sub operations, or copying its content into tag, meta or mark for future processing. The main-character energy action, honestly ๐Ÿ‘‘

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]

Enable tracking a TCP connection state. She's keeping receipts on every handshake ๐Ÿ“‹

See also: struct rte_flow_action_conntrack.


RTE_FLOW_ACTION_TYPE_METER_COLOR

Color 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, send 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

Send 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. Nothing to set up, she just yeets them to the kernel โœจ


RTE_FLOW_ACTION_TYPE_QUOTA

Apply 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

Skip congestion management configuration.

Using rte_eth_cman_config_set(), the application can configure the ethdev Rx queue's congestion mechanism. This flow action allows to skip the congestion configuration applied to the given ethdev Rx queue. She's opting out, respectfully ๐Ÿ™ˆ


RTE_FLOW_ACTION_TYPE_IPV6_EXT_PUSH

RTE_FLOW_ACTION_TYPE_IPV6_EXT_PUSH

Push 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

Remove 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

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. Not a jump scare, a jump to ๐Ÿฆ˜

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. Cute but unstable, like all of us ๐Ÿ’€

QUOTA operational mode.

See also: struct rte_flow_action_quota

Enumerator

  • RTE_FLOW_QUOTA_MODE_PACKET โ€” Count packets. That's it, that's the mode ๐Ÿ“ฆ
  • RTE_FLOW_QUOTA_MODE_L2 โ€” counts packet bytes starting all the way from L2 ๐Ÿ’…
  • RTE_FLOW_QUOTA_MODE_L3 โ€” and this one counts packet bytes starting from L3, okurrr

Definition at line 3276 of file rte_flow.h.

enum rte_flow_update_quota_op

โš ๏ธ EXPERIMENTAL: this API may change without prior notice. bestie it is literally in beta, do not build your whole personality on it ๐Ÿ˜ญ

Indirect QUOTA update operations ๐Ÿ’ซ

See also struct rte_flow_update_quota

Enumerator

  • RTE_FLOW_UPDATE_QUOTA_SET โ€” set a brand new quota value ๐Ÿ†•
  • RTE_FLOW_UPDATE_QUOTA_ADD โ€” increase the quota value, just add to the pile ๐Ÿ’ธ

Definition at line 3315 of file rte_flow.h.

enum rte_flow_nat64_type

NAT64 translation type for IP headers ๐ŸŒ

Enumerator

  • RTE_FLOW_NAT64_6TO4 โ€” IPv6 to IPv4 headers translation, glow-down moment โœจ
  • RTE_FLOW_NAT64_4TO6 โ€” IPv4 to IPv6 headers translation, glow-up moment โœจ

Definition at line 3607 of file rte_flow.h.

enum rte_flow_conntrack_state

The state of a TCP connection ๐Ÿซถ (yes, we're doing the whole handshake-to-breakup arc)

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, it's giving "we need to talk" ๐Ÿ˜ฌ
  • RTE_FLOW_CONNTRACK_STATE_CLOSE_WAIT โ€” the first FIN was ACKed, receipts confirmed
  • RTE_FLOW_CONNTRACK_STATE_LAST_ACK โ€” the second FIN was received, just waiting on the last ACK, the suspense is unreal ๐Ÿ’€
  • RTE_FLOW_CONNTRACK_STATE_TIME_WAIT โ€” the second FIN was ACKed, connection was closed, it's over bestie ๐ŸŽ€

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 ๐Ÿšฉ (the flag lore)

Enumerator

  • RTE_FLOW_CONNTRACK_FLAG_NONE โ€” no flag, empty vibes
  • 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 MODIFY_FIELD action โœ๏ธ

Enumerator

  • RTE_FLOW_MODIFY_SET โ€” set a new value, fresh start ๐Ÿ’ซ
  • RTE_FLOW_MODIFY_ADD โ€” add a value to a field, plus plus plus โž•
  • RTE_FLOW_MODIFY_SUB โ€” subtract a value from a field, minus minus minus โž–

Definition at line 4123 of file rte_flow.h.

enum rte_flow_error_type

Verbose error types ๐Ÿšจ โ€” the "who did this" of the flow API

Most of them provide the type of the object referenced by struct rte_flow_error.cause.

Enumerator

  • RTE_FLOW_ERROR_TYPE_NONE โ€” no error, we love a peaceful queen ๐Ÿ‘‘
  • RTE_FLOW_ERROR_TYPE_UNSPECIFIED โ€” cause unspecified, the mystery era ๐Ÿ™ˆ
  • 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 4345 of file rte_flow.h.

enum rte_flow_conv_op

Conversion operations for flow API objects ๐Ÿ”„

See also rte_flow_conv()

Enumerator

  • RTE_FLOW_CONV_OP_NONE โ€” no operation to perform. rte_flow_conv() simply returns 0. honestly the laziest icon and we respect it ๐Ÿ’…
  • RTE_FLOW_CONV_OP_ATTR โ€” convert 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.
    • 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.
    • src type: const struct rte_flow_conv_rule *
    • dst type: struct rte_flow_conv_rule *
  • RTE_FLOW_CONV_OP_ITEM_NAME โ€” convert 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 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 item type to pointer to item name. Retrieves 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. no cap, it's sharing the same string ๐Ÿซถ
    • src type: (const void *)enum rte_flow_item_type
    • dst type: const char **
  • RTE_FLOW_CONV_OP_ACTION_NAME_PTR โ€” convert action type to pointer to action name. Retrieves 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 4411 of file rte_flow.h.

enum rte_flow_table_insertion_type

โš ๏ธ EXPERIMENTAL: this API may change without prior notice.

Template table flow rules insertion type ๐Ÿงฉ

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

Definition at line 5906 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 ๐Ÿ”ข

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 5927 of file rte_flow.h.

enum rte_flow_op_status

โš ๏ธ EXPERIMENTAL: this API may change without prior notice.

Asynchronous operation status โณ

Enumerator

  • RTE_FLOW_OP_SUCCESS โ€” the operation was completed successfully, we ate and left no crumbs ๐Ÿ”ฅ
  • RTE_FLOW_OP_ERROR โ€” the operation was not completed successfully, it's giving flop ๐Ÿ˜ญ

Definition at line 6367 of file rte_flow.h.

enum rte_flow_query_update_mode

โš ๏ธ EXPERIMENTAL: this API may change without prior notice.

Query and update operational mode ๐Ÿ”

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

Definition at line 6592 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 encap action is used. 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 ๐ŸŽฏ

See also function rte_flow_calc_encap_hash

Enumerator

  • RTE_FLOW_ENCAP_HASH_FIELD_SRC_PORT โ€” calculate hash placed in UDP source port field
  • RTE_FLOW_ENCAP_HASH_FIELD_NVGRE_FLOW_ID โ€” calculate hash placed in NVGRE flow ID field

Definition at line 6989 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 ๐Ÿ—‚๏ธ like, spill the hardware tea onto a file

Parameters

  • port_id โ€” the port identifier of the Ethernet device
  • flow โ€” the pointer of flow rule to dump. Dump all rules if NULL ๐Ÿ‘€
  • 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 mbuf dynamic field for metadata is registered ๐Ÿท๏ธ

Returns

True if registered, false otherwise.

Definition at line 4595 of file rte_flow.h.

__rte_experimental int rte_flow_dynf_metadata_register (void)

Register mbuf dynamic field and flag for metadata ๐Ÿ“

This function must be called prior to use SET_META action in order to register the dynamic mbuf field. Otherwise, the data cannot be delivered to application. no cap, skip this step and your data is ghosting you ๐Ÿ‘ป

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 ๐Ÿ•ต๏ธโ€โ™€๏ธ like a vibe check but for flow rules

Like, the whole point is a vibe check on your rule โ€” is it correct, and could the device actually accept it if it had the resources? It gets checked against the current device mode and queue configuration. You can also optionally have it validated against existing flow rules and device resources. And the iconic part: this function has no effect on the target device. Zero. Nada. It's a look, not a touch. ๐Ÿซถ

The returned value is only guaranteed to stay valid as long as nobody sneaks in a successful rte_flow_create() or rte_flow_destroy() call in the meantime, and no device parameter that affects flow rules in any way gets modified โ€” because collisions and resource limitations could happen (although in those cases EINVAL should not be returned, bestie).

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 the 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()).

๐Ÿ’… rte_flow_create

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. This is the moment, the main character move, the actually do it of the whole flow API. โœจ

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().


๐Ÿฆ‹ rte_flow_destroy

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. Bye bestie ๐Ÿ‘‹

Failing to destroy a flow rule handle can happen when other flow rules depend on it and destroying it would leave everything in an inconsistent state. Messy.

This function is only guaranteed to succeed if handles are destroyed in reverse order of their creation. So like, undo your stuff in the order you did it, okay?

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_flow_actions_update

__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. Glow-up for an existing rule, no rebuild needed. ๐Ÿ’–

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.


๐ŸŒธ rte_flow_flush

int rte_flow_flush (uint16_t port_id, struct rte_flow_error * error)

Destroy all flow rules associated with a port. The full clear-the-group-chat move. ๐Ÿงน

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. So like, it's giving "we cleaned up but at what cost".

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.


๐Ÿ” rte_flow_query

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. This is the spill the tea function โ€” it lets you retrieve flow-specific data such as counters. The data gets gathered by special actions which must be present in the flow rule definition. No action, no data, no tea. ๐Ÿต

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 the 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.


๐Ÿšง rte_flow_isolate

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

Restrict ingress traffic to the defined flow rules. Gatekeeping, but make it networking. ๐Ÿ’…

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 handle the remaining traffic โ€” think 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. Reuse era. โ™ป๏ธ

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.

Once it's effective, leaving isolated mode may not be possible depending on the PMD implementation. So like, read the room before you commit. ๐Ÿ˜ฌ

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.


๐ŸŽ€ rte_flow_error_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. It's the "okay so here's exactly what went wrong and why" builder. ๐Ÿซถ

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_flow_copy

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

This interface is kept for compatibility with older applications but is implemented as a wrapper to rte_flow_conv(). It's deprecated because of its lack of flexibility and its reliance on a type that's unusable with C++ programs (struct rte_flow_desc). Legacy behavior, ngl. ๐Ÿ™ˆ

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. Classic measure-twice situation.


๐ŸŒˆ rte_flow_conv

__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. It performs conversion of various flow API objects into a pre-allocated destination buffer. See enum rte_flow_conv_op for the possible operations and the deets on 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_flow_get_aged_flows

__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. ๐Ÿ•ฐ๏ธ

...and like, the RTE_ETH_EVENT_FLOW_AGED event fires off the moment at least one brand-new aged-out flow gets spotted after your last call to rte_flow_get_aged_flows ๐Ÿ‘€. So you can totally call this function to scoop up those aged flows either asynchronously from inside the event callback, or synchronously whenever you feel like it regardless of the event. But bestie, hear me: it is not safe to call rte_flow_get_aged_flows at the same time as other flow functions from multiple threads. Don't do that. ๐Ÿ’€

Parameters

  • port_id โ€” port identifier of the Ethernet device.
  • contexts โ€” the address of an array of pointers to the aged-out flows contexts.
  • nb_contexts โ€” the length of the context array pointers.
  • error โ€” does verbose error reporting if it's not NULL. Only gets initialized in the case of an error, bestie.

Returns

If nb_contexts is 0, it returns the amount of all aged contexts. If nb_contexts is not 0, it returns the amount of aged flows reported in the context array. Otherwise? Negative errno value, obviously. ๐Ÿ˜ญ

See also

rte_flow_action_age

RTE_ETH_EVENT_FLOW_AGED

๐ŸŒ€ rte_flow_get_q_aged_flows

__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)
โš ๏ธ EXPERIMENTAL: this API may change without prior notice. It's giving "we might switch it up on you" energy, so don't get too attached.

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

Okay so here's the tea โ˜• โ€” if the application configures the port attribute with RTE_FLOW_PORT_FLAG_STRICT_QUEUE, then there's no RTE_ETH_EVENT_FLOW_AGED event at all, and you must call this function to get the aged flows synchronously. No event, no chill. ๐Ÿซถ

If the application configures the port attribute without RTE_FLOW_PORT_FLAG_STRICT_QUEUE, then the RTE_ETH_EVENT_FLOW_AGED event gets triggered once 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, and this is the fun bit, the queue_id gets ignored. โœจ So you can call this function to get the aged flows asynchronously from the event callback, or synchronously regardless of the event. Either way, it ate.

Parameters

  • port_id โ€” port identifier of the Ethernet device.
  • queue_id โ€” flow queue to query. Ignored when RTE_FLOW_PORT_FLAG_STRICT_QUEUE isn't set.
  • contexts โ€” the address of an array of pointers to the aged-out flows contexts.
  • nb_contexts โ€” the length of the context array pointers.
  • error โ€” does verbose error reporting if it's not NULL. Initialized only in the case of error.

Returns

If nb_contexts is 0, you get the amount of all aged contexts. If nb_contexts is not 0, you get 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_flow_action_handle_create

__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)
โš ๏ธ EXPERIMENTAL: this API may change without prior notice.

Create an indirect action object that you can use in flow rules via its handle, periodt. And the created object handle has a single state and configuration across all the flow rules that use it โ€” like one brain cell shared by many rules, but make it iconic. ๐Ÿงš

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 โ€” does verbose error reporting if it's not NULL. PMDs initialize this structure only in case of error.

Returns

A valid handle on success, NULL otherwise, and rte_errno gets set to one of these error codes, bestie:

  • (ENODEV) if port_id is invalid.
  • (ENOSYS) if the underlying device doesn't support this functionality.
  • (EIO) if the underlying device is removed.
  • (EINVAL) if the action is invalid.
  • (ENOTSUP) if the action is valid but unsupported.

๐Ÿ’ฅ rte_flow_action_handle_destroy

__rte_experimental int rte_flow_action_handle_destroy(uint16_t port_id,
                                                      struct rte_flow_action_handle *handle,
                                                      struct rte_flow_error *error)
โš ๏ธ EXPERIMENTAL: this API may change without prior notice.

Destroy an indirect action by its handle. Bye bestie, you had a good run. ๐Ÿ‘‹

Parameters

  • port_id โ€” the port identifier of the Ethernet device.
  • handle โ€” handle for the indirect action object to be destroyed.
  • error โ€” does verbose error reporting if it's not NULL. PMDs initialize this structure only in case of error.

Returns

  • (0) if success. Slay.
  • (-ENODEV) if port_id is invalid.
  • (-ENOSYS) if the underlying device doesn't support this functionality.
  • (-EIO) if the underlying device is removed.
  • (-ENOENT) if the action pointed to by the action handle was not found.
  • (-EBUSY) if the action pointed to by the action handle is still used by some rules โ€” rte_errno is also set.

๐Ÿ”„ rte_flow_action_handle_update

__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)
โš ๏ธ EXPERIMENTAL: this API may change without prior notice.

Update in-place the action configuration and/or state pointed to by the action handle, using the configuration you pass in as the update argument. The update of the action configuration affects all flow rules reusing that action via the handle โ€” so like, one glow-up, everyone feels it. โœจ And the update general pointer gives you the ability to do partial updating. Fancy.

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 to by handle. And update could be the same type as the immediate action corresponding to the handle argument when creating, or a wrapper structure that includes the action configuration to be updated plus bit fields to indicate which members of the fields inside the action to update. Both valid, iykyk.
  • error โ€” does verbose error reporting if it's not NULL. PMDs initialize this structure only in case of error.

Returns

  • (0) if success. ๐Ÿ’–
  • (-ENODEV) if port_id is invalid.
  • (-ENOSYS) if the underlying device doesn't support this functionality.
  • (-EIO) if the underlying device is removed.
  • (-EINVAL) if the update is invalid.
  • (-ENOTSUP) if the update is valid but unsupported.
  • (-ENOENT) if the indirect action object pointed to by handle was not found. rte_errno is also set.

๐Ÿ” rte_flow_action_handle_query

__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)
โš ๏ธ EXPERIMENTAL: this API may change without prior notice.

Query the direct action by the corresponding indirect action object handle. ๐Ÿ•ต๏ธโ€โ™€๏ธ Retrieve action-specific data like counters โ€” the data gets gathered by a special action which may be present/referenced in more than one flow rule definition. So one little counter, many rules, no cap.

See also

RTE_FLOW_ACTION_TYPE_COUNT

Parameters

  • port_id โ€” port identifier of the Ethernet device.
  • handle โ€” handle for the action object to query.
  • data โ€” pointer to storage for the associated query data type.
  • error โ€” does verbose error reporting if it's not NULL. PMDs initialize this structure only in case of error.

Returns

0 on success, a negative errno value otherwise, and rte_errno is set. ๐Ÿ’…


๐Ÿš‡ rte_flow_tunnel_decap_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. The sample usage is literally: actions vxlan_decap / tunnel-decap-set(tunnel properties) / jump group 0 / end. Main character energy from start to finish. ๐Ÿ‘‘

Parameters

  • port_id โ€” port identifier of the 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 โ€” does verbose error reporting if it's not NULL. PMDs initialize this structure only in case of error.

Returns

0 on success, a negative errno value otherwise, and rte_errno is set. ๐Ÿซถ


๐ŸŽฏ rte_flow_tunnel_match

__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, as iconic as ever: pattern tunnel-match(tunnel properties) / outer-header-matches / inner-header-matches / end. ๐ŸŒธ

Parameters

  • port_id โ€” port identifier of the 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 โ€” does verbose error reporting if it's not NULL. PMDs initialize this structure only in case of error.

Returns

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


๐Ÿท๏ธ rte_flow_restore_info_dynflag

__rte_experimental uint64_t rte_flow_restore_info_dynflag(void)

So when you receive a mbuf from the HW, you might need to call rte_flow_get_restore_info() to retrieve some metadata. This function returns the associated mbuf ol_flags. That's it, that's the whole vibe. ๐Ÿฆ‹

๐Ÿ“Œ Note: the dynamic flag gets registered during a call to rte_eth_rx_metadata_negotiate() with RTE_ETH_RX_METADATA_TUNNEL_ID.

Returns

The offload flag indicating that rte_flow_get_restore_info() must be called. ๐Ÿ”ฅ


๐Ÿง  rte_flow_get_restore_info

__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. Basically "hey, the mbuf said something, go read it". ๐Ÿ“–

One should negotiate tunnel metadata delivery from the NIC to the HW โ€” like, actually do that part, bestie. ๐Ÿ˜ญ

See also

rte_eth_rx_metadata_negotiate()

RTE_ETH_RX_METADATA_TUNNEL_ID

Parameters

  • port_id โ€” port identifier of the Ethernet device.
  • m โ€” mbuf struct.
  • info โ€” restore information. Upon success it contains the HW state.
  • error โ€” does verbose error reporting if it's not NULL. PMDs initialize this structure only in case of error.

Returns

0 on success, a negative errno value otherwise, and rte_errno is set. ๐ŸŽ€


๐Ÿ—‘๏ธ rte_flow_tunnel_action_decap_release

__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. Cleanup era, we love to see it. ๐Ÿงน

Parameters

  • port_id โ€” port identifier of the Ethernet device.
  • actions โ€” array of actions to be released.
  • num_of_actions โ€” number of elements in the actions array.
  • error โ€” does verbose error reporting if it's not NULL. PMDs initialize this structure only in case of error.

Returns: 0 on success, a negative errno value otherwise and rte_errno is set. (That's the tail end of the function above โ€” we move on, bestie โœจ)


๐Ÿฆ‹ 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 this one is literally the cleanup crew ๐Ÿงน โ€” it releases the item array that was allocated by rte_flow_tunnel_match. You made the mess, now you tidy it, that's the vibe.

Parameters

  • port_id โ€” Port identifier of Ethernet device.
  • items โ€” Array of items to be released.
  • num_of_items โ€” Number of elements in item 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_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 ๐Ÿ’… โ€” main character port energy, honestly.

So here's the tea: managing "transfer" flows requires that the user communicate them via a port which has the privilege to control the embedded switch. For some vendors, all ports in a given switching domain have this privilege. For other vendors, it's only one port. Iconic of them.

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. No cap, it just hands you back what you gave 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 verbose report in case of error

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. โš ๏ธ (she's still in her testing era, be nice to her)

Create the flex item with specified configuration over the Ethernet device. Build-a-flex-item workshop, we love to see it ๐ŸŽ€

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. Bye bestie, thanks for the memories ๐Ÿ‘‹โœจ

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. It's giving "let me check what we're working with first" ๐Ÿ”

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. Set her up, she deserves it ๐Ÿ’…

Important deets, and I mean important:

  • This API can only be invoked before the application starts using the rest of the flow library functions. Timing is everything, bestie โฐ
  • The API can be invoked multiple times to change the settings. The port, however, may reject changes and keep the old config. Rude but valid.
  • Parameters in configuration attributes must not exceed numbers of resources returned by the rte_flow_info_get API. Do not over-order at the drive-thru, fr fr ๐Ÿ“

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 flow pattern template. The pattern template defines common matching fields without values. Think of it as the blank spreadsheet before anyone types in it ๐Ÿ“‹โœจ

For example, matching on 5 tuple TCP flow, the template will be eth(null) + IPv4(source + dest) + TCP(s_port + d_port), while 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. Consistency is the moment.

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 flow pattern template. Closure era ๐Ÿฆ‹

This function may be called only when there are no more tables referencing this template. Check your references first, or it's gonna be a whole thing ๐Ÿ˜ญ

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 flow actions template. 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. The number and order of actions in the template must be the same at the rule creation. Again with the consistency โ€” she's a Virgo, I don't make the rules โ™

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 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.
  • 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 flow actions template. Same energy, different template ๐Ÿ’€

This function may be called only when there are no more tables referencing this template. No dangling references, bestie, that's not the vibe.

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 a lil vibe check on your table ๐Ÿ“โœจ (yes, port_id is __rte_unused โ€” she's there for moral support ๐Ÿซถ)

Parameters

  • port_id โ€” Port identifier of Ethernet device.
  • 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 flow template table. The moment we've all been waiting for ๐Ÿ‘‘

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

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, it's giving build-your-own-adventure ๐ŸŒˆ

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 ๐ŸŒธ

__rte_experimental int rte_flow_template_table_destroy (uint16_t port_id,
    struct rte_flow_template_table * template_table, struct rte_flow_error *
    error)
โš ๏ธ EXPERIMENTAL: this API may change without prior notice.

Destroy flow template table. Bestie, this function may be called only when there are no more flow rules referencing this table. So do your vibe check first, okay? ๐Ÿ’…

Parameters

  • port_id โ€” Port identifier of Ethernet device.
  • template_table โ€” Handle to the table 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_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)
โš ๏ธ EXPERIMENTAL: this API may change without prior notice.

Set group miss actions. Itโ€™s giving โ€œwhat happens when nobody matchesโ€ energy. โœจ

Parameters

  • port_id โ€” Port identifier of Ethernet device.
  • group_id โ€” Identifier of a group to set miss actions for.
  • attr โ€” Group attributes.
  • actions โ€” List of group miss actions.
  • 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_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)
โš ๏ธ EXPERIMENTAL: this API may change without prior notice.

Enqueue rule creation operation. Queue it up, bestie. ๐Ÿงš

Parameters

  • port_id โ€” Port identifier of 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 is 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 โ€” 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. Important bestie: the rule handle doesnโ€™t mean that the rule has been populated. Only the completion result indicates whether there was success or failure. ๐Ÿ˜ญ


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)
โš ๏ธ EXPERIMENTAL: this API may change without prior notice.

Enqueue rule creation operation. Same async slay, but now youโ€™re picking by index. ๐ŸŽ€

Parameters

  • port_id โ€” Port identifier of 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 โ€” 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. The rule handle doesnโ€™t mean that the rule has been populated. Only the completion result indicates that if there was success or failure. ๐Ÿ’œ


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)
โš ๏ธ EXPERIMENTAL: this API may change without prior notice.

Enqueue rule creation by index with pattern operation. Packets are only matched if there is a rule inserted at the index. So yes, the index has to actually be doing something, bestie. โœจ

Parameters

  • port_id โ€” Port identifier of 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 already occupied index results in undefined behavior. No cap โ€” do not do this. ๐Ÿ’€
  • 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 is 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 โ€” 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. The rule handle doesnโ€™t mean that the rule has been populated. Only the completion result indicates that if there was 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)
โš ๏ธ EXPERIMENTAL: this API may change without prior notice.

Enqueue rule destruction operation. Itโ€™s the โ€œbye bestieโ€ of flow rules. ๐Ÿซถ

This function enqueues a destruction operation on the queue. Application should assume that after calling this function the rule handle is not valid anymore. Completion indicates the full removal of the rule from the HW. So donโ€™t go using that handle after this, okay? ๐Ÿ™ˆ

Parameters

  • port_id โ€” Port identifier of Ethernet device.
  • queue_id โ€” Flow queue which is used to destroy the rule. This must match the queue on which the rule was created.
  • 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 โ€” 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_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)
โš ๏ธ EXPERIMENTAL: this API may change without prior notice.

Enqueue rule update operation. Same rule, new actions โ€” a little glow-up moment. โœจ

Parameters

  • port_id โ€” Port identifier of 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 โ€” 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_push ๐Ÿš€

__rte_experimental int rte_flow_push (uint16_t port_id, uint32_t queue_id,
    struct rte_flow_error * error)
โš ๏ธ 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. Can be used to notify the HW about batch of rules prepared by the SW to reduce the number of communications between the HW and SW. Itโ€™s giving โ€œsend the whole group chat at onceโ€ energy. ๐Ÿฆ‹

Parameters

  • port_id โ€” Port identifier of Ethernet device.
  • queue_id โ€” Flow queue to be pushed.
  • 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_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)
โš ๏ธ EXPERIMENTAL: this API may change without prior notice.

Pull a 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. Basically: come collect your results, bestie. ๐Ÿ’…

Parameters

  • port_id โ€” Port identifier of 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 โ€” Perform 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)
โš ๏ธ EXPERIMENTAL: this API may change without prior notice.

Enqueue indirect action creation operation. The async handle creation moment has arrived. ๐Ÿงš

See also: rte_flow_action_handle_create ๐Ÿ‘‘

โœจ Parameters โœจ

Okay bestie, here's the parameter tea for this one โ€” names stay exactly as written, no creative spelling ๐Ÿ’…:

  • 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. Slay. ๐Ÿซถ


rte_flow_async_action_handle_destroy

๐Ÿšจ Warning โ€” EXPERIMENTAL: this API may change without prior notice.
__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)

Enqueue indirect action destruction operation. Important vibe check: the destroy queue must be the same as the queue on which the action was created. No queue-switching, bestie โ€” that's the rule. ๐Ÿ’…

โœจ 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

๐Ÿšจ Warning โ€” EXPERIMENTAL: this API may change without prior notice.
__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)

Enqueue indirect action update operation.

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

๐Ÿšจ Warning โ€” EXPERIMENTAL: this API may change without prior notice.
__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)

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.

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

๐Ÿšจ Warning โ€” EXPERIMENTAL: this API may change without prior notice.
__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/or update indirect flow action. If both query and update are 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.

โœจ 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

๐Ÿšจ Warning โ€” EXPERIMENTAL: this API may change without prior notice.
__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)

Enqueue async indirect flow action query and/or update

โœจ 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

๐Ÿšจ Warning โ€” EXPERIMENTAL: this API may change without prior notice.
__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)

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.

โœจ 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

๐Ÿšจ Warning โ€” EXPERIMENTAL: this API may change without prior notice.
__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)

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.

โœจ 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

๐Ÿšจ Warning โ€” EXPERIMENTAL: this API may change without prior notice.
__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)

Destroy indirect actions list by handle.

โœจ 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. bestie this is a vibes-only, no-guarantees situation, fr fr.

So this one enqueues the destruction operation for an indirect action list. Enqueue, not do-it-right-now โ€” it's async, it's giving "I'll get to it." And the rule you cannot skip: the destroy queue must be the same as the queue on which the action was created. Same queue or it's not happening, periodt. ๐Ÿ’…

Parameters (the receipts ๐Ÿงพ)

  • 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 (the moment of truth โœจ)

  • (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
๐Ÿ’€ Yes, (-EBUSY) means it's still being used. Can't destroy something that's out there living its life. Wait your turn.

๐Ÿฆ‹ 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.

This is the combo meal ๐Ÿ” โ€” query and/or update an indirect flow actions list. If both query and update are not NULL, the function atomically queries and updates the indirect action. Query and update are carried in order specified in the mode parameter. And if either query or update is NULL, the function executes the complementing operation. (Yeah, the original says "ether" โ€” we're keeping it, grammatical icon behavior. ๐Ÿ˜Œ)

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 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 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.

Same energy as above, but async โ€” it enqueues the query and/or update of an async indirect flow actions list. If both query and update are not NULL, the function atomically queries and updates the indirect action. Query and update are carried in order specified in the mode parameter. If either query or update is NULL, the function executes the complementing operation. Slay, but make it queued. ๐Ÿ”ฅ

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 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 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.

This one calculates the hash for a given pattern in a given table as calculated by the HW. Like, not our math, the hardware's math โ€” we're just asking it to show its work. ๐Ÿค“โœจ

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 gets done when an encap action is being used. This hash can be stored in the tunnel outer header to improve packet distribution โ€” iconic load-balancing behavior, no cap. ๐Ÿ“ฆโžก๏ธ๐Ÿ“ฆ

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 dest 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. Basically glow-up time for your table โ€” it's getting more room. ๐Ÿ’…โœจ

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. Must be called for each rule created before the table resize. If called for a rule created after the table resize, it returns success. (So yeah, worst case you get a friendly little 0. ๐Ÿซถ)

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. The finale of the resize arc โ€” curtains up, back to business. ๐ŸŽฌ

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

๐Ÿ“ 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.


๐Ÿ 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.

okay so we're still in the mask aisle of the rte_flow.h store and it is stacked ๐Ÿ’… these are all [static] const defaults โ€” here's every single one, no skips, no cap:

  • const struct rte_flow_item_any rte_flow_item_any_mask [static] โ€” the default mask for RTE_FLOW_ITEM_TYPE_ANY, literally the chillest one here.
Initial value:
= {
    .num = 0x00000000,
}

Definition at line 798 of file rte_flow.h.

  • const struct rte_flow_item_port_id rte_flow_item_port_id_mask [static] โ€” default mask for RTE_FLOW_ITEM_TYPE_PORT_ID.
Initial value:
= {
    .id = 0xffffffff,
}

Definition at line 823 of file rte_flow.h.

  • const struct rte_flow_item_raw rte_flow_item_raw_mask [static] โ€” default mask for RTE_FLOW_ITEM_TYPE_RAW. she's got layers, bestie: relative, search, reserved, offset, limit, length and pattern, all at once ๐Ÿซถ
Initial value:
= {
    .relative = 1,
    .search = 1,
    .reserved = 0x3fffffff,
    .offset = 0xffffffff,
    .limit = 0xffff,
    .length = 0xffff,
    .pattern = NULL,
}

Definition at line 858 of file rte_flow.h.

  • const struct rte_flow_item_eth rte_flow_item_eth_mask [static] โ€” default mask for RTE_FLOW_ITEM_TYPE_ETH, serving six bytes of dst_addr, six of src_addr, plus an ether_type moment ๐Ÿ’–
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),
}

Definition at line 905 of file rte_flow.h.

  • const struct rte_flow_item_vlan rte_flow_item_vlan_mask [static] โ€” default mask for RTE_FLOW_ITEM_TYPE_VLAN.
Initial value:
= {
    .hdr.vlan_tci = RTE_BE16(0x0fff),
    .hdr.eth_proto = RTE_BE16(0x0000),
}

Definition at line 946 of file rte_flow.h.

  • const struct rte_flow_item_ipv4 rte_flow_item_ipv4_mask [static] โ€” default mask for RTE_FLOW_ITEM_TYPE_IPV4, and yes it's both addresses at full 0xffffffff, iconic โœจ
Initial value:
= {
    .hdr = {
        .src_addr = RTE_BE32(0xffffffff),
        .dst_addr = RTE_BE32(0xffffffff),
    },
}

Definition at line 965 of file rte_flow.h.

  • const struct rte_flow_item_ipv6 rte_flow_item_ipv6_mask [static] โ€” default mask for RTE_FLOW_ITEM_TYPE_IPV6, running RTE_IPV6_MASK_FULL on both sides like the main character she is ๐Ÿ‘‘
Initial value:
= {
    .hdr = {
        .src_addr = RTE_IPV6_MASK_FULL,
        .dst_addr = RTE_IPV6_MASK_FULL,
    },
}

Definition at line 1006 of file rte_flow.h.

  • const struct rte_flow_item_icmp rte_flow_item_icmp_mask [static] โ€” default mask for RTE_FLOW_ITEM_TYPE_ICMP: icmp_type and icmp_code, both 0xff.
Initial value:
= {
    .hdr = {
        .icmp_type = 0xff,
        .icmp_code = 0xff,
    },
}

Definition at line 1037 of file rte_flow.h.

  • const struct rte_flow_item_udp rte_flow_item_udp_mask [static] โ€” default mask for RTE_FLOW_ITEM_TYPE_UDP, src_port + dst_port, both RTE_BE16(0xffff) ๐Ÿฆ‹
Initial value:
= {
    .hdr = {
        .src_port = RTE_BE16(0xffff),
        .dst_port = RTE_BE16(0xffff),
    },
}

Definition at line 1056 of file rte_flow.h.

  • const struct rte_flow_item_tcp rte_flow_item_tcp_mask [static] โ€” default mask for RTE_FLOW_ITEM_TYPE_TCP. same energy as UDP's, different protocol, we love consistency.
Initial value:
= {
    .hdr = {
        .src_port = RTE_BE16(0xffff),
        .dst_port = RTE_BE16(0xffff),
    },
}

Definition at line 1075 of file rte_flow.h.

  • const struct rte_flow_item_sctp rte_flow_item_sctp_mask [static] โ€” default mask for RTE_FLOW_ITEM_TYPE_SCTP, ports again, RTE_BE16(0xffff) both ๐ŸŽ€
Initial value:
= {
    .hdr = {
        .src_port = RTE_BE16(0xffff),
        .dst_port = RTE_BE16(0xffff),
    },
}

Definition at line 1094 of file rte_flow.h.

  • const struct rte_flow_item_vxlan rte_flow_item_vxlan_mask [static] โ€” default mask for RTE_FLOW_ITEM_TYPE_VXLAN, just the three-byte .hdr.vni getting the all-0xff treatment.
Initial value:
= {
    .hdr.vni = { 0xff, 0xff, 0xff },
}

Definition at line 1130 of file rte_flow.h.

  • const struct rte_flow_item_e_tag rte_flow_item_e_tag_mask [static] โ€” default mask for RTE_FLOW_ITEM_TYPE_E_TAG.
Initial value:
= {
    .rsvd_grp_ecid_b = RTE_BE16(0x3fff),
}

Definition at line 1158 of file rte_flow.h.

  • const struct rte_flow_item_nvgre rte_flow_item_nvgre_mask [static] โ€” default mask for RTE_FLOW_ITEM_TYPE_NVGRE, covering tni with three 0xff bytes ๐ŸŒธ
Initial value:
= {
    .tni =  { 0xff, 0xff, 0xff },
}

Definition at line 1183 of file rte_flow.h.

  • const struct rte_flow_item_mpls rte_flow_item_mpls_mask [static] โ€” default mask for RTE_FLOW_ITEM_TYPE_MPLS. note the 0xf0 in that third byte, not 0xff, and that's not a typo bestie, that's just what it is ๐Ÿ’€
Initial value:
= {
    .label_tc_s = { 0xff, 0xff, 0xf0 },
}

Definition at line 1203 of file rte_flow.h.

  • const struct rte_flow_item_gre rte_flow_item_gre_mask [static] โ€” default mask for RTE_FLOW_ITEM_TYPE_GRE, one lonely protocol field at RTE_BE16(0xffff).
Initial value:
= {
    .protocol = RTE_BE16(0xffff),
}

Definition at line 1224 of file rte_flow.h.

  • const struct rte_flow_item_fuzzy rte_flow_item_fuzzy_mask [static] โ€” default mask for RTE_FLOW_ITEM_TYPE_FUZZY, and yes the name is unserious, thresh is 0xffffffff, moving on ๐Ÿงš
Initial value:
= {
    .thresh = 0xffffffff,
}

Definition at line 1272 of file rte_flow.h.

  • const struct rte_flow_item_gtp rte_flow_item_gtp_mask [static] โ€” default mask for RTE_FLOW_ITEM_TYPE_GTP, teid set to RTE_BE32(UINT32_MAX).
Initial value:
= {
    .hdr.teid = RTE_BE32(UINT32_MAX),
}

Definition at line 1306 of file rte_flow.h.

  • const struct rte_flow_item_esp rte_flow_item_esp_mask [static] โ€” default mask for RTE_FLOW_ITEM_TYPE_ESP, spi at RTE_BE32(0xffffffff) ๐Ÿ”ฅ
Initial value:
= {
    .hdr = {
        .spi = RTE_BE32(0xffffffff),
    },
}

Definition at line 1322 of file rte_flow.h.

  • const struct rte_flow_item_geneve rte_flow_item_geneve_mask [static] โ€” default mask for RTE_FLOW_ITEM_TYPE_GENEVE, three 0xff bytes of vni.
Initial value:
= {
    .vni =  { 0xff, 0xff, 0xff },
}

Definition at line 1347 of file rte_flow.h.

  • const struct rte_flow_item_vxlan_gpe rte_flow_item_vxlan_gpe_mask [static] โ€” default mask for RTE_FLOW_ITEM_TYPE_VXLAN_GPE.
Initial value:
= {
    .hdr.vni =  { 0xff, 0xff, 0xff },
}
โš ๏ธ Deprecated, bestie. the page says see also rte_flow_item_vxlan_mask โ€” so go look at that one instead ๐Ÿ˜ญ

Definition at line 1384 of file rte_flow.h.

  • const struct rte_flow_item_arp_eth_ipv4 rte_flow_item_arp_eth_ipv4_mask [static] โ€” default mask for RTE_FLOW_ITEM_TYPE_ARP_ETH_IPV4, and she's thorough: arp_sha, arp_sip, arp_tha, arp_tip all covered ๐Ÿซถ
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),
}

Definition at line 1418 of file rte_flow.h.

  • const struct rte_flow_item_ipv6_ext rte_flow_item_ipv6_ext_mask [static] โ€” default mask for RTE_FLOW_ITEM_TYPE_IPV6_EXT, just next_hdr = 0xff.
Initial value:
= {
    .next_hdr = 0xff,
}

Definition at line 1443 of file rte_flow.h.

  • const struct rte_flow_item_icmp6 rte_flow_item_icmp6_mask [static] โ€” default mask for RTE_FLOW_ITEM_TYPE_ICMP6. type and code, both 0xff, no drama ๐Ÿ’œ
Initial value:
= {
    .type = 0xff,
    .code = 0xff,
}

Definition at line 1475 of file rte_flow.h.

  • const struct rte_flow_item_icmp6_nd_ns rte_flow_item_icmp6_nd_ns_mask [static] โ€” default mask for RTE_FLOW_ITEM_TYPE_ICMP6_ND_NS, target_addr getting the full RTE_IPV6_MASK_FULL glow-up โœจ
Initial value:
= {
    .target_addr = RTE_IPV6_MASK_FULL,
}

Definition at line 1507 of file rte_flow.h.

  • const struct rte_flow_item_icmp6_nd_na rte_flow_item_icmp6_nd_na_mask [static] โ€” default mask for RTE_FLOW_ITEM_TYPE_ICMP6_ND_NA. same RTE_IPV6_MASK_FULL treatment, she and her sister are twinning.
Initial value:
= {
    .target_addr = RTE_IPV6_MASK_FULL,
}

Definition at line 1532 of file rte_flow.h.

  • const struct rte_flow_item_icmp6_nd_opt rte_flow_item_icmp6_nd_opt_mask [static] โ€” default mask for RTE_FLOW_ITEM_TYPE_ICMP6_ND_OPT.
Initial value:
= {
    .type = 0xff,
}

Definition at line 1556 of file rte_flow.h.

  • const struct rte_flow_item_icmp6_nd_opt_sla_eth rte_flow_item_icmp6_nd_opt_sla_eth_mask [static] โ€” default mask for RTE_FLOW_ITEM_TYPE_ICMP6_ND_OPT_SLA_ETH, six 0xff bytes of sla.addr_bytes.
Initial value:
= {
    .sla.addr_bytes = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff },
}

Definition at line 1581 of file rte_flow.h.

  • const struct rte_flow_item_icmp6_nd_opt_tla_eth rte_flow_item_icmp6_nd_opt_tla_eth_mask [static] โ€” default mask for RTE_FLOW_ITEM_TYPE_ICMP6_ND_OPT_TLA_ETH, same six bytes but on tla.addr_bytes this time.
Initial value:
= {
    .tla.addr_bytes = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff },
}

Definition at line 1606 of file rte_flow.h.

  • const struct rte_flow_item_meta rte_flow_item_meta_mask [static] โ€” default mask for RTE_FLOW_ITEM_TYPE_META, data straight up UINT32_MAX ๐Ÿ‘‘
Initial value:
= {
    .data = UINT32_MAX,
}

Definition at line 1628 of file rte_flow.h.

  • const struct rte_flow_item_gtp_psc rte_flow_item_gtp_psc_mask [static] โ€” default mask for RTE_FLOW_ITEM_TYPE_GTP_PSC, and qfi is 0x3f โ€” six bits, not eight, 0x3f, write that down ๐ŸŽ€
Initial value:
= {
    .hdr.qfi = 0x3f,
}

Definition at line 1645 of file rte_flow.h.

  • const struct rte_flow_item_pppoe_proto_id rte_flow_item_pppoe_proto_id_mask [static] โ€” default mask for RTE_FLOW_ITEM_TYPE_PPPOE_PROTO_ID.
Initial value:
= {
    .proto_id = RTE_BE16(0xffff),
}

Definition at line 1684 of file rte_flow.h.

  • const struct rte_flow_item_tag rte_flow_item_tag_mask [static] โ€” default mask for RTE_FLOW_ITEM_TYPE_TAG, data at 0xffffffff and index at 0xff, she does both ๐Ÿ’…
Initial value:
= {
    .data = 0xffffffff,
    .index = 0xff,
}

Definition at line 1704 of file rte_flow.h.

  • const struct rte_flow_item_l2tpv3oip rte_flow_item_l2tpv3oip_mask [static] โ€” default mask for RTE_FLOW_ITEM_TYPE_L2TPV3OIP, session_id at RTE_BE32(UINT32_MAX).
Initial value:
= {
    .session_id = RTE_BE32(UINT32_MAX),
}

Definition at line 1721 of file rte_flow.h.

  • const struct rte_flow_item_mark rte_flow_item_mark_mask [static] โ€” default mask for RTE_FLOW_ITEM_TYPE_MARK, .id all the way up ๐ŸŒˆ
Initial value:
= {
    .id = 0xffffffff,
}

Definition at line 1751 of file rte_flow.h.

  • const struct rte_flow_item_nsh rte_flow_item_nsh_mask [static] โ€” default mask for RTE_FLOW_ITEM_TYPE_NSH, and she's the overachiever of the group chat: mdtype 0xf, next_proto 0xff, spi 0xffffff, sindex 0xff ๐Ÿ”ฅ
Initial value:
= {
    .mdtype = 0xf,
    .next_proto = 0xff,
    .spi = 0xffffff,
    .sindex = 0xff,
}

Definition at line 1779 of file rte_flow.h.

okay bestie, we made it to the very last lilโ€™ stretch of the variable docs โ€” these are all the default mask baddies, and yes, every single one is getting its moment. ๐Ÿ’…โœจ

  • const struct rte_flow_item_igmp rte_flow_item_igmp_mask [static] โ€” default mask for RTE_FLOW_ITEM_TYPE_IGMP. Initial value:
= {
    .group_addr = 0xffffffff,
}

Definition at line 1804 of file rte_flow.h.

  • const struct rte_flow_item_ah rte_flow_item_ah_mask [static] โ€” default mask for RTE_FLOW_ITEM_TYPE_AH. Initial value:
= {
    .spi = 0xffffffff,
}

Definition at line 1827 of file rte_flow.h.

  • const struct rte_flow_item_pfcp rte_flow_item_pfcp_mask [static] โ€” default mask for RTE_FLOW_ITEM_TYPE_PFCP. Initial value:
= {
    .s_field = 0x01,
    .seid = RTE_BE64(UINT64_C(0xffffffffffffffff)),
}

Definition at line 1849 of file rte_flow.h.

  • const struct rte_flow_item_ecpri rte_flow_item_ecpri_mask [static] โ€” default mask for RTE_FLOW_ITEM_TYPE_ECPRI. Initial value:
= {
    .hdr = {
        .common = {
            .u32 = 0x0,
        },
    },
}

Definition at line 1869 of file rte_flow.h.

  • const struct rte_flow_item_geneve_opt rte_flow_item_geneve_opt_mask [static] โ€” default mask for RTE_FLOW_ITEM_TYPE_GENEVE_OPT. Initial value:
= {
    .option_type = 0xff,
}

Definition at line 1893 of file rte_flow.h.

  • const struct rte_flow_item_conntrack rte_flow_item_conntrack_mask [static] โ€” default mask for RTE_FLOW_ITEM_TYPE_CONNTRACK. Initial value:
= {
    .flags = 0xffffffff,
}

Definition at line 1984 of file rte_flow.h.

  • const struct rte_flow_item_ethdev rte_flow_item_ethdev_mask [static] โ€” default mask for items based on struct rte_flow_item_ethdev. Initial value:
= {
    .port_id = 0xffff,
}

Definition at line 2000 of file rte_flow.h.

  • const struct rte_flow_item_l2tpv2 rte_flow_item_l2tpv2_mask [static] โ€” default mask for RTE_FLOW_ITEM_TYPE_L2TPV2. Initial value:
= {
    .hdr = {
        .common = {
            .flags_version = RTE_BE16(0xcb0f),
        },
    },
}

Definition at line 2019 of file rte_flow.h.

  • const struct rte_flow_item_ppp rte_flow_item_ppp_mask [static] โ€” default mask for RTE_FLOW_ITEM_TYPE_PPP. Initial value:
= {
    .hdr = {
        .addr = 0xff,
        .ctrl = 0xff,
        .proto_id = RTE_BE16(0xffff),
    }
}

Definition at line 2047 of file rte_flow.h.

  • const struct rte_flow_item_ib_bth rte_flow_item_ib_bth_mask [static] โ€” default mask for RTE_FLOW_ITEM_TYPE_IB_BTH. Initial value:
= {
    .hdr = {
        .opcode = 0xff,
        .dst_qp =  { 0xff, 0xff, 0xff },
    },
}

Definition at line 2067 of file rte_flow.h.

  • const struct rte_flow_item_random rte_flow_item_random_mask [static] โ€” default mask for RTE_FLOW_ITEM_TYPE_RANDOM. Initial value:
= {
    .value = UINT32_MAX,
}

Definition at line 2089 of file rte_flow.h.

  • const struct rte_flow_item_meter_color rte_flow_item_meter_color_mask [static] โ€” default mask for RTE_FLOW_ITEM_TYPE_METER_COLOR. Initial value:
= {
    .color = RTE_COLORS,
}

Definition at line 2316 of file rte_flow.h.

  • const struct rte_flow_item_aggr_affinity rte_flow_item_aggr_affinity_mask [static] โ€” default mask for RTE_FLOW_ITEM_TYPE_AGGR_AFFINITY. Initial value:
= {
    .affinity = 0xff,
}

Definition at line 2342 of file rte_flow.h.

  • const struct rte_flow_item_tx_queue rte_flow_item_tx_queue_mask [static] โ€” default mask for RTE_FLOW_ITEM_TX_QUEUE. Initial value:
= {
    .tx_queue = 0xffff,
}

Definition at line 2361 of file rte_flow.h.

  • const struct rte_flow_item_ptype rte_flow_item_ptype_mask [static] โ€” default mask for RTE_FLOW_ITEM_TYPE_PTYPE. Initial value:
= {
    .packet_type = 0xffffffff,
}

Definition at line 2378 of file rte_flow.h.


๐ŸŒธ AUTHOR ๐ŸŒธ

Generated automatically by Doxygen for DPDK from the source code. iconic behavior, no notes. ๐ŸŽ€


source: DPDK ยท version: 26.03.0 ยท page: rte_flow.h(3) โ€” and thatโ€™s the whole glow-up, bestie. slay. ๐Ÿ’–โœจ

๐Ÿ“ฆ where this page comes from