rte_flow.h(3)
๐ 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_attrstruct rte_flow_item_quotastruct rte_flow_item_higig2_hdrstruct rte_flow_item_anystruct rte_flow_item_port_idstruct rte_flow_item_rawstruct rte_flow_item_ethstruct rte_flow_item_vlanstruct rte_flow_item_ipv4struct rte_flow_item_ipv6struct rte_flow_item_ipv6_routing_extstruct rte_flow_item_icmpstruct rte_flow_item_udpstruct rte_flow_item_tcpstruct rte_flow_item_sctpstruct rte_flow_item_vxlanstruct rte_flow_item_e_tagstruct rte_flow_item_nvgrestruct rte_flow_item_mplsstruct rte_flow_item_grestruct rte_flow_item_gre_optstruct rte_flow_item_macsecstruct rte_flow_item_fuzzystruct rte_flow_item_gtpstruct rte_flow_item_espstruct rte_flow_item_genevestruct rte_flow_item_vxlan_gpestruct rte_flow_item_arp_eth_ipv4struct rte_flow_item_ipv6_extstruct rte_flow_item_ipv6_frag_extstruct rte_flow_item_icmp6struct rte_flow_item_icmp6_echostruct rte_flow_item_icmp6_nd_nsstruct rte_flow_item_icmp6_nd_nastruct rte_flow_item_icmp6_nd_optstruct rte_flow_item_icmp6_nd_opt_sla_ethstruct rte_flow_item_icmp6_nd_opt_tla_ethstruct rte_flow_item_metastruct rte_flow_item_gtp_pscstruct rte_flow_item_pppoestruct rte_flow_item_pppoe_proto_idstruct rte_flow_item_tagstruct rte_flow_item_l2tpv3oipstruct rte_flow_item_markstruct rte_flow_item_nshstruct rte_flow_item_igmpstruct rte_flow_item_ahstruct rte_flow_item_pfcpstruct rte_flow_item_ecpristruct rte_flow_item_geneve_optstruct rte_flow_item_integritystruct rte_flow_item_conntrackstruct rte_flow_item_ethdevstruct rte_flow_item_l2tpv2struct rte_flow_item_pppstruct rte_flow_item_ib_bthstruct rte_flow_item_randomstruct rte_flow_itemstruct rte_flow_item_flexstruct rte_flow_item_flex_fieldstruct rte_flow_item_flex_linkstruct rte_flow_item_flex_confstruct rte_flow_item_meter_colorstruct rte_flow_item_aggr_affinitystruct rte_flow_item_tx_queuestruct rte_flow_item_ptypestruct rte_flow_field_datastruct rte_flow_item_comparestruct rte_flow_action_quotastruct rte_flow_query_quotastruct rte_flow_update_quotastruct rte_flow_action_markstruct rte_flow_action_jumpstruct rte_flow_action_queuestruct rte_flow_action_agestruct rte_flow_query_agestruct rte_flow_update_agestruct rte_flow_action_countstruct rte_flow_query_countstruct rte_flow_action_rssstruct rte_flow_action_vfstruct rte_flow_action_port_idstruct rte_flow_action_meterstruct rte_flow_action_securitystruct rte_flow_action_nat64struct rte_flow_action_of_push_vlanstruct rte_flow_action_of_set_vlan_vidstruct rte_flow_action_of_set_vlan_pcpstruct rte_flow_action_of_pop_mplsstruct rte_flow_action_of_push_mplsstruct rte_flow_action_vxlan_encapstruct rte_flow_action_nvgre_encapstruct rte_flow_action_raw_encapstruct rte_flow_action_raw_decapstruct rte_flow_action_set_ipv4struct rte_flow_action_set_ipv6struct rte_flow_action_ipv6_ext_pushstruct rte_flow_action_ipv6_ext_removestruct rte_flow_action_set_tpstruct rte_flow_action_set_ttlstruct rte_flow_action_set_macstruct rte_flow_action_set_tagstruct rte_flow_action_set_metastruct rte_flow_action_set_dscpstruct rte_flow_tcp_dir_paramstruct rte_flow_action_conntrackstruct rte_flow_modify_conntrackstruct rte_flow_action_meter_colorstruct rte_flow_action_ethdevstruct rte_flow_action_modify_fieldstruct rte_flow_action_meter_markstruct rte_flow_update_meter_markstruct rte_flow_indirect_update_flow_meter_markstruct rte_flow_action_prog_argumentstruct rte_flow_action_progstruct rte_flow_action_jump_to_table_indexstruct rte_flow_actionstruct rte_flow_action_samplestruct rte_flow_errorstruct rte_flow_conv_rulestruct rte_flow_descstruct rte_flow_indir_action_confstruct rte_flow_restore_infostruct rte_flow_port_infostruct rte_flow_queue_infostruct rte_flow_port_attrstruct rte_flow_queue_attrstruct rte_flow_pattern_template_attrstruct rte_flow_actions_template_attrstruct rte_flow_template_table_attrstruct rte_flow_op_attrstruct rte_flow_op_resultstruct 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)
}
๐ซถ NoticeRTE_FLOW_CONNTRACK_FLAG_NONEis0and the rest areRTE_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, soRTE_FLOW_QU_UPDATE_FIRSTfollows 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_copyis 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_maskstatic const struct rte_flow_item_higig2_hdr rte_flow_item_higig2_hdr_maskstatic const struct rte_flow_item_any rte_flow_item_any_maskstatic const struct rte_flow_item_port_id rte_flow_item_port_id_maskstatic const struct rte_flow_item_raw rte_flow_item_raw_maskstatic const struct rte_flow_item_eth rte_flow_item_eth_maskstatic const struct rte_flow_item_vlan rte_flow_item_vlan_maskstatic const struct rte_flow_item_ipv4 rte_flow_item_ipv4_maskstatic const struct rte_flow_item_ipv6 rte_flow_item_ipv6_maskstatic const struct rte_flow_item_icmp rte_flow_item_icmp_maskstatic const struct rte_flow_item_udp rte_flow_item_udp_maskstatic const struct rte_flow_item_tcp rte_flow_item_tcp_maskstatic const struct rte_flow_item_sctp rte_flow_item_sctp_maskstatic const struct rte_flow_item_vxlan rte_flow_item_vxlan_maskstatic const struct rte_flow_item_e_tag rte_flow_item_e_tag_maskstatic const struct rte_flow_item_nvgre rte_flow_item_nvgre_maskstatic const struct rte_flow_item_mpls rte_flow_item_mpls_maskstatic const struct rte_flow_item_gre rte_flow_item_gre_maskstatic const struct rte_flow_item_fuzzy rte_flow_item_fuzzy_maskstatic const struct rte_flow_item_gtp rte_flow_item_gtp_maskstatic const struct rte_flow_item_esp rte_flow_item_esp_maskstatic const struct rte_flow_item_geneve rte_flow_item_geneve_maskstatic const struct rte_flow_item_vxlan_gpe rte_flow_item_vxlan_gpe_maskstatic const struct rte_flow_item_arp_eth_ipv4 rte_flow_item_arp_eth_ipv4_maskstatic const struct rte_flow_item_ipv6_ext rte_flow_item_ipv6_ext_maskstatic const struct rte_flow_item_icmp6 rte_flow_item_icmp6_maskstatic const struct rte_flow_item_icmp6_nd_ns rte_flow_item_icmp6_nd_ns_maskstatic const struct rte_flow_item_icmp6_nd_na rte_flow_item_icmp6_nd_na_maskstatic const struct rte_flow_item_icmp6_nd_opt rte_flow_item_icmp6_nd_opt_maskstatic const struct rte_flow_item_icmp6_nd_opt_sla_eth rte_flow_item_icmp6_nd_opt_sla_eth_maskstatic const struct rte_flow_item_icmp6_nd_opt_tla_eth rte_flow_item_icmp6_nd_opt_tla_eth_maskstatic const struct rte_flow_item_meta rte_flow_item_meta_maskstatic const struct rte_flow_item_gtp_psc rte_flow_item_gtp_psc_maskstatic const struct rte_flow_item_pppoe_proto_id rte_flow_item_pppoe_proto_id_maskstatic const struct rte_flow_item_tag rte_flow_item_tag_maskstatic const struct rte_flow_item_l2tpv3oip rte_flow_item_l2tpv3oip_maskstatic const struct rte_flow_item_mark rte_flow_item_mark_maskstatic const struct rte_flow_item_nsh rte_flow_item_nsh_maskstatic const struct rte_flow_item_igmp rte_flow_item_igmp_maskstatic const struct rte_flow_item_ah rte_flow_item_ah_maskstatic const struct rte_flow_item_pfcp rte_flow_item_pfcp_maskstatic const struct rte_flow_item_ecpri rte_flow_item_ecpri_maskstatic const struct rte_flow_item_geneve_opt rte_flow_item_geneve_opt_maskstatic const struct rte_flow_item_conntrack rte_flow_item_conntrack_maskstatic const struct rte_flow_item_ethdev rte_flow_item_ethdev_maskstatic const struct rte_flow_item_l2tpv2 rte_flow_item_l2tpv2_maskstatic const struct rte_flow_item_ppp rte_flow_item_ppp_maskstatic const struct rte_flow_item_ib_bth rte_flow_item_ib_bth_maskstatic const struct rte_flow_item_random rte_flow_item_random_maskstatic const struct rte_flow_item_meter_color rte_flow_item_meter_color_maskstatic const struct rte_flow_item_aggr_affinity rte_flow_item_aggr_affinity_maskstatic const struct rte_flow_item_tx_queue rte_flow_item_tx_queue_maskstatic 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
ANYmay also stand for several protocol layers. - See
struct rte_flow_item_any.
- Matches any protocol in place of the current layer, a single
RTE_FLOW_ITEM_TYPE_PORT_ID- Deprecated ๐ฉ
- See also:
RTE_FLOW_ITEM_TYPE_PORT_REPRESENTORRTE_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. Seestruct rte_flow_item_tcp. ๐งฆRTE_FLOW_ITEM_TYPE_SCTPโ matches a SCTP header. Seestruct rte_flow_item_sctp. ๐RTE_FLOW_ITEM_TYPE_VXLANโ matches a VXLAN header. Seestruct rte_flow_item_vxlan. ๐ฆRTE_FLOW_ITEM_TYPE_E_TAGโ matches a E_TAG header. Seestruct rte_flow_item_e_tag. ๐RTE_FLOW_ITEM_TYPE_NVGREโ matches a NVGRE header. Seestruct rte_flow_item_nvgre. โจRTE_FLOW_ITEM_TYPE_MPLSโ matches a MPLS header. Seestruct rte_flow_item_mpls. ๐RTE_FLOW_ITEM_TYPE_GREโ matches a GRE header. Seestruct 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. Seestruct rte_flow_item_fuzzy. โกRTE_FLOW_ITEM_TYPE_GTPโ matches a GTP header. Configure flow for GTP packets. Seestruct rte_flow_item_gtp. ๐ซถRTE_FLOW_ITEM_TYPE_GTPCโ matches a GTP header. Configure flow for GTP-C packets. Seestruct rte_flow_item_gtp. ๐RTE_FLOW_ITEM_TYPE_GTPUโ matches a GTP header. Configure flow for GTP-U packets. Seestruct rte_flow_item_gtp. ๐RTE_FLOW_ITEM_TYPE_ESPโ matches a ESP header. Seestruct rte_flow_item_esp. ๐ฅRTE_FLOW_ITEM_TYPE_GENEVEโ matches a GENEVE header. Seestruct rte_flow_item_geneve. ๐ธRTE_FLOW_ITEM_TYPE_VXLAN_GPEโ matches a VXLAN-GPE header. Seestruct 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. Seestruct rte_flow_item_arp_eth_ipv4. ๐RTE_FLOW_ITEM_TYPE_IPV6_EXTโ matches the presence of any IPv6 extension header. Seestruct rte_flow_item_ipv6_ext. ๐ฆRTE_FLOW_ITEM_TYPE_ICMP6โ matches any ICMPv6 header. Seestruct rte_flow_item_icmp6. ๐RTE_FLOW_ITEM_TYPE_ICMP6_ND_NSโ matches an ICMPv6 neighbor discovery solicitation. Seestruct rte_flow_item_icmp6_nd_ns. ๐RTE_FLOW_ITEM_TYPE_ICMP6_ND_NAโ matches an ICMPv6 neighbor discovery advertisement. Seestruct rte_flow_item_icmp6_nd_na. โจRTE_FLOW_ITEM_TYPE_ICMP6_ND_OPTโ matches the presence of any ICMPv6 neighbor discovery option. Seestruct 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. Seestruct 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. Seestruct rte_flow_item_icmp6_nd_opt_tla_eth. ๐ซถRTE_FLOW_ITEM_TYPE_MARKโ matches specified mark field. Seestruct rte_flow_item_mark. ๐RTE_FLOW_ITEM_TYPE_METAโ [META] matches a metadata value. Seestruct 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 type0x85. Seestruct rte_flow_item_gtp_psc. ๐งRTE_FLOW_ITEM_TYPE_PPPOESโ matches a PPPoE header. Configure flow for PPPoE session packets. Seestruct rte_flow_item_pppoe. ๐ธRTE_FLOW_ITEM_TYPE_PPPOEDโ matches a PPPoE header. Configure flow for PPPoE discovery packets. Seestruct 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. Seestruct rte_flow_item_pppoe_proto_id. ๐RTE_FLOW_ITEM_TYPE_NSHโ matches Network service header (NSH). Seestruct rte_flow_item_nsh. ๐ฆRTE_FLOW_ITEM_TYPE_IGMPโ matches Internet Group Management Protocol (IGMP). Seestruct rte_flow_item_igmp. ๐RTE_FLOW_ITEM_TYPE_AHโ matches IP Authentication Header (AH). Seestruct rte_flow_item_ah. ๐ฅRTE_FLOW_ITEM_TYPE_HIGIG2โ matches a HIGIG header. seestruct rte_flow_item_higig2_hdr. โจRTE_FLOW_ITEM_TYPE_TAGโ [META] matches a tag value. Seestruct rte_flow_item_tag. ๐ท๏ธRTE_FLOW_ITEM_TYPE_L2TPV3OIPโ matches a L2TPv3 over IP header. Configure flow for L2TPv3 over IP packets. Seestruct rte_flow_item_l2tpv3oip. ๐RTE_FLOW_ITEM_TYPE_PFCPโ matches PFCP Header. Seestruct rte_flow_item_pfcp. ๐ซถRTE_FLOW_ITEM_TYPE_ECPRIโ matches eCPRI Header. Configure flow for eCPRI over ETH or UDP packets. Seestruct rte_flow_item_ecpri. โกRTE_FLOW_ITEM_TYPE_IPV6_FRAG_EXTโ matches the presence of IPv6 fragment extension header. Seestruct rte_flow_item_ipv6_frag_ext. ๐ฆRTE_FLOW_ITEM_TYPE_GENEVE_OPTโ matches Geneve Variable Length Option. Seestruct 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 alsostruct rte_flow_item_integrity. ๐ก๏ธRTE_FLOW_ITEM_TYPE_CONNTRACKโ [META] matches conntrack state. See alsostruct rte_flow_item_conntrack. ๐งตRTE_FLOW_ITEM_TYPE_PORT_REPRESENTORโ [META] matches traffic entering the embedded switch from the given ethdev. See alsostruct 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 alsostruct 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 alsostruct rte_flow_item_flex. ๐RTE_FLOW_ITEM_TYPE_L2TPV2โ matches L2TPv2 Header. Seestruct rte_flow_item_l2tpv2. ๐RTE_FLOW_ITEM_TYPE_PPPโ matches PPP Header. Seestruct rte_flow_item_ppp. ๐RTE_FLOW_ITEM_TYPE_GRE_OPTIONโ matches GRE optional fields. Seestruct rte_flow_item_gre_opt. โจRTE_FLOW_ITEM_TYPE_MACSECโ matches MACsec Ethernet Header. Seestruct rte_flow_item_macsec. ๐RTE_FLOW_ITEM_TYPE_METER_COLORโ matches Meter Color Marker. Seestruct rte_flow_item_meter_color. ๐จRTE_FLOW_ITEM_TYPE_IPV6_ROUTING_EXTโ matches the presence of IPv6 routing extension header. See alsostruct rte_flow_item_ipv6_routing_ext. ๐ฆRTE_FLOW_ITEM_TYPE_ICMP6_ECHO_REQUESTโ matches an ICMPv6 echo request. See alsostruct rte_flow_item_icmp6_echo. ๐ฃRTE_FLOW_ITEM_TYPE_ICMP6_ECHO_REPLYโ matches an ICMPv6 echo reply. See alsostruct rte_flow_item_icmp6_echo. ๐ฌRTE_FLOW_ITEM_TYPE_QUOTAโ Match Quota state. See alsostruct 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 number1. See alsostruct rte_flow_item_aggr_affinity. ๐ซRTE_FLOW_ITEM_TYPE_TX_QUEUEโ Match Tx queue number. This is valid only for egress rules. See alsostruct rte_flow_item_tx_queue๐คRTE_FLOW_ITEM_TYPE_IB_BTHโ matches an InfiniBand base transport header in RoCE packet. See alsostruct rte_flow_item_ib_bth. ๐งRTE_FLOW_ITEM_TYPE_PTYPEโ matches the packet type as defined inrte_mbuf_ptype. Seestruct 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 alsostruct rte_flow_item_random. ๐ฒRTE_FLOW_ITEM_TYPE_COMPAREโ Match packet with various comparison types. Seestruct 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 honestlyRTE_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 setsRTE_MBUF_F_RX_FDIRandRTE_MBUF_F_RX_FDIR_IDmbuf 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 toMARKwithout a specific value; only sets theRTE_MBUF_F_RX_FDIRmbuf 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 toQUEUE, 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_REPRESENTORRTE_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_REPRESENTORRTE_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_REPRESENTORRTE_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โ ImplementsOFPAT_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โ ImplementsOFPAT_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โ ImplementsOFPAT_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โ ImplementsOFPAT_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โ ImplementsOFPAT_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โ ImplementsOFPAT_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 inrte_flow_action_vxlan_encapaction 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 byRFC7348) then the PMD should return aRTE_FLOW_ERROR_TYPE_ACTIONerror. ๐
RTE_FLOW_ACTION_TYPE_NVGRE_ENCAPโ Encapsulate flow in NVGRE tunnel defined in therte_flow_action_nvgre_encapaction 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 byRFC7637) then the PMD should return aRTE_FLOW_ERROR_TYPE_ACTIONerror. ๐
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 validRTE_FLOW_ITEM_TYPE_IPV4, then the PMD should return aRTE_FLOW_ERROR_TYPE_ACTIONerror. ๐
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 confirmedRTE_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 vibesRTE_FLOW_CONNTRACK_FLAG_SYNโ with SYN flagRTE_FLOW_CONNTRACK_FLAG_SYNACKโ with SYNACK flagRTE_FLOW_CONNTRACK_FLAG_FINโ with FIN flagRTE_FLOW_CONNTRACK_FLAG_ACKโ with ACK flagRTE_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 fieldRTE_FLOW_ERROR_TYPE_ATTR_PRIORITYโ priority fieldRTE_FLOW_ERROR_TYPE_ATTR_INGRESSโ ingress fieldRTE_FLOW_ERROR_TYPE_ATTR_EGRESSโ egress fieldRTE_FLOW_ERROR_TYPE_ATTR_TRANSFERโ transfer fieldRTE_FLOW_ERROR_TYPE_ATTRโ attributes structureRTE_FLOW_ERROR_TYPE_ITEM_NUMโ pattern lengthRTE_FLOW_ERROR_TYPE_ITEM_SPECโ item specificationRTE_FLOW_ERROR_TYPE_ITEM_LASTโ item specification rangeRTE_FLOW_ERROR_TYPE_ITEM_MASKโ item specification maskRTE_FLOW_ERROR_TYPE_ITEMโ specific pattern itemRTE_FLOW_ERROR_TYPE_ACTION_NUMโ number of actionsRTE_FLOW_ERROR_TYPE_ACTION_CONFโ action configurationRTE_FLOW_ERROR_TYPE_ACTIONโ specific actionRTE_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 returns0. 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 *
- src type:
RTE_FLOW_CONV_OP_ITEMโ convert a single item. Duplicatesspec,lastandmaskbut not outside objects.- src type:
const struct rte_flow_item * - dst type:
struct rte_flow_item *
- src type:
RTE_FLOW_CONV_OP_ITEM_MASKโ convert a single item mask. Duplicates onlymask.- src type:
const struct rte_flow_item * - dst type:
struct rte_flow_item *
- src type:
RTE_FLOW_CONV_OP_ACTIONโ convert a single action. Duplicatesconfbut not outside objects.- src type:
const struct rte_flow_action * - dst type:
struct rte_flow_action *
- src type:
RTE_FLOW_CONV_OP_PATTERNโ convert an entire pattern. Duplicates all pattern items at once with the same constraints asRTE_FLOW_CONV_OP_ITEM.- src type:
const struct rte_flow_item * - dst type:
struct rte_flow_item *
- src type:
RTE_FLOW_CONV_OP_ACTIONSโ convert a list of actions. Duplicates the entire list of actions at once with the same constraints asRTE_FLOW_CONV_OP_ACTION.- src type:
const struct rte_flow_action * - dst type:
struct rte_flow_action *
- src type:
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 *
- src type:
RTE_FLOW_CONV_OP_ITEM_NAMEโ convert item type to its name string. Writes a NUL-terminated string todst. Likesnprintf(), the returned value excludes the terminator which is always written nonetheless.- src type:
(const void *)enum rte_flow_item_type - dst type:
char *
- src type:
RTE_FLOW_CONV_OP_ACTION_NAMEโ convert action type to its name string. Writes a NUL-terminated string todst. Likesnprintf(), the returned value excludes the terminator which is always written nonetheless.- src type:
(const void *)enum rte_flow_action_type - dst type:
char *
- src type:
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 todst. no cap, it's sharing the same string ๐ซถ- src type:
(const void *)enum rte_flow_item_type - dst type:
const char **
- src type:
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 todst.- src type:
(const void *)enum rte_flow_action_type - dst type:
const char **
- src type:
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 insertionRTE_FLOW_TABLE_INSERTION_TYPE_INDEXโ index-based insertionRTE_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 calculationRTE_FLOW_TABLE_HASH_FUNC_LINEARโ linear hash calculationRTE_FLOW_TABLE_HASH_FUNC_CRC32โ 32-bit checksum hash calculationRTE_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 updateRTE_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 fieldRTE_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 deviceflowโ the pointer of flow rule to dump. Dump all rules ifNULL๐fileโ a pointer to a file for outputerrorโ perform verbose error reporting if notNULL. 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 notNULL. 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 (seerte_eth_dev_rx_queue_stop()andrte_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 notNULL. 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 notNULL. 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 notNULL. 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 notNULL. 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 notNULL. 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 notNULL. 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 beNULL).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
sizeis0,dstmay be aNULLpointer, otherwisedstmust be non-NULL. - If positive, the returned value represents the number of bytes needed to store the conversion of
srctodstaccording toop, regardless of thesizeparameter. - Since no more than
sizebytes can be written todst, 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
dstcontents are unspecified.
Parameters
opโ Operation to perform, related to the object type ofdst.dstโ Destination buffer address. Must be suitably aligned by the caller.sizeโ Destination buffer size in bytes.srcโ Source object to copy. Depending onop, its type may differ from that ofdst.errorโ Perform verbose error reporting if notNULL. 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 notNULL. 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 whenRTE_FLOW_PORT_FLAG_STRICT_QUEUEisn'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 notNULL. 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 notNULL. 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)ifport_idis 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 notNULL. PMDs initialize this structure only in case of error.
Returns
(0)if success. Slay.(-ENODEV)ifport_idis 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_errnois 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 byhandle. Andupdatecould be the same type as the immediate action corresponding to thehandleargument 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 notNULL. PMDs initialize this structure only in case of error.
Returns
(0)if success. ๐(-ENODEV)ifport_idis 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 byhandlewas not found.rte_errnois 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 notNULL. 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 torte_flow_create.num_of_actionsโ number of actions allocated.errorโ does verbose error reporting if it's notNULL. 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 torte_flow_create.num_of_itemsโ number of items allocated.errorโ does verbose error reporting if it's notNULL. 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 torte_eth_rx_metadata_negotiate()withRTE_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 notNULL. 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 theactionsarray.errorโ does verbose error reporting if it's notNULL. 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 initemarray.errorโ Perform verbose error reporting if notNULL. 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 servingport_iddoesn't have the corresponding method implemented, the API will returnport_idviaproxy_port_id. No cap, it just hands you back what you gave it ๐
Parameters
port_idโ Indicates the port to get a"proxy"forproxy_port_idโ Indicates the"proxy"porterrorโ If notNULL, 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 notNULL. 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 notNULL. 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 typerte_flow_port_infoto be filled with the resources information of the port.queue_infoโ A pointer to a structure of typerte_flow_queue_infoto be filled with the asynchronous queues information.errorโ Perform verbose error reporting if notNULL. 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_getAPI. 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 inport_attr.nb_queues.errorโ Perform verbose error reporting if notNULL. 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 notNULL. 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 notNULL. 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 ifmasksspec 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 inmasksis not0, the corresponding value in an action fromactionswill be the part of the template and used in all flow rules. The order of actions inmasksis the same as inactions. In case of indirect actions present inactions, the actual action type should be present in mask.errorโ Perform verbose error reporting if notNULL. 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 notNULL. 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 thepattern_templatesarray.actions_templatesโ Array of actions templates to be used in this table.nb_actions_templatesโ The number of actions templates in theactions_templatesarray.errorโ Perform verbose error reporting if notNULL. 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 notNULL. 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 notNULL. 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. Thespecis 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 notNULL. 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 notNULL. 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. Thespecis 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 notNULL. 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 notNULL. 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 notNULL. 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 notNULL. 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 theresarray.errorโ Perform verbose error reporting if notNULL. 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 notNULL. 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 notNULL. 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 byhandle.updatecould be with the same type of the immediate action corresponding to thehandleargument 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 notNULL. 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 fromrte_flow_pull.user_dataโ The user data that will be returned on the completion events.errorโ Perform verbose error reporting if notNULL. 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 notNULL, update profile specification used to modify the action pointed byhandle.queryโ If notNULLpointer to storage for the associated query data type.modeโ Operational mode.errorโ Perform verbose error reporting if notNULL. PMDs initialize this structure in case of error only.
โจ Returns โจ
0 on success, a negative errno value otherwise and rte_errno is set.
(-ENODEV)โ ifport_idinvalid.(-ENOTSUP)โ if underlying device does not support this functionality.(-EINVAL)โ ifhandleormodeinvalid or bothqueryandupdateareNULL.
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 notNULL, update profile specification used to modify the action pointed byhandle.queryโ If notNULL, 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 notNULL. PMDs initialize this structure in case of error only.
โจ Returns โจ
0 on success, a negative errno value otherwise and rte_errno is set.
(-ENODEV)โ ifport_idinvalid.(-ENOTSUP)โ if underlying device does not support this functionality.(-EINVAL)โ ifhandleormodeinvalid or bothupdateandqueryareNULL.
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 notNULL. 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)โ ifport_idinvalid.(-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 notNULL. 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)โ ifport_idinvalid.(-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 notNULL. PMDs initialize this structure in case of error only.
โจ Returns โจ
(0)โ if success.(-ENODEV)โ ifport_idinvalid.(-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 notNULL. PMDs initialize this structure in case of error only.
Returns (the moment of truth โจ)
(0)if success.(-ENODEV)ifport_idinvalid.(-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 actionsA1 / A2 ... An / ENDnon-NULLupdate parameter is an array[U1, U2, ... Un]whereUipoints toAiupdate context orNULLifAishould not be updated.queryโ If the action list handle was created from n actionsA1 / A2 ... An / ENDnon-NULLquery parameter is an array[Q1, Q2, ... Qn]whereQipoints toAiquery context orNULLifAishould not be queried.modeโ Operational mode.errorโ Perform verbose error reporting if notNULL. PMDs initialize this structure in case of error only.
Returns
(0)if success.(-ENODEV)ifport_idinvalid.(-ENOTSUP)if underlying device does not support this functionality.(-EINVAL)ifhandleormodeinvalid or bothqueryandupdateareNULL.
๐ง 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 actionsA1 / A2 ... An / ENDnon-NULLupdate parameter is an array[U1, U2, ... Un]whereUipoints toAiupdate context orNULLifAishould not be updated.queryโ If the action list handle was created from n actionsA1 / A2 ... An / ENDnon-NULLquery parameter is an array[Q1, Q2, ... Qn]whereQipoints toAiquery context orNULLifAishould 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 notNULL. PMDs initialize this structure in case of error only.
Returns
(0)if success.(-ENODEV)ifport_idinvalid.(-ENOTSUP)if underlying device does not support this functionality.(-EINVAL)ifhandleormodeinvalid or bothupdateandqueryareNULL.
๐ฅ 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 notNULL. PMDs initialize this structure in case of error only.
Returns
(0)if success.(-ENODEV)ifport_idinvalid.(-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 todest_field.hashโ Used to return the calculated hash. It will be written in network order, sohash[0]is the MSB. The number of bytes is based on the destination field type.errorโ Perform verbose error reporting if notNULL. PMDs initialize this structure in case of error only.
Returns
(0)if success.(-ENODEV)ifport_idinvalid.(-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 notNULL. PMDs initialize this structure in case of error only.
Returns
(0)if success.(-ENODEV)ifport_idinvalid.(-ENOTSUP)if underlying device does not support this functionality.(-EINVAL)iftableis not resizable or table resize tonb_rulesis 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 notNULL. PMDs initialize this structure in case of error only.
Returns
(0)if success.(-ENODEV)ifport_idinvalid.(-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 notNULL. PMDs initialize this structure in case of error only.
Returns
(0)if success.(-ENODEV)ifport_idinvalid.(-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 forRTE_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 forRTE_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 forRTE_FLOW_ITEM_TYPE_RAW. she's got layers, bestie:relative,search,reserved,offset,limit,lengthandpattern, 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 forRTE_FLOW_ITEM_TYPE_ETH, serving six bytes ofdst_addr, six ofsrc_addr, plus anether_typemoment ๐
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 forRTE_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 forRTE_FLOW_ITEM_TYPE_IPV4, and yes it's both addresses at full0xffffffff, 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 forRTE_FLOW_ITEM_TYPE_IPV6, runningRTE_IPV6_MASK_FULLon 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 forRTE_FLOW_ITEM_TYPE_ICMP:icmp_typeandicmp_code, both0xff.
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 forRTE_FLOW_ITEM_TYPE_UDP,src_port+dst_port, bothRTE_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 forRTE_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 forRTE_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 forRTE_FLOW_ITEM_TYPE_VXLAN, just the three-byte.hdr.vnigetting the all-0xfftreatment.
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 forRTE_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 forRTE_FLOW_ITEM_TYPE_NVGRE, coveringtniwith three0xffbytes ๐ธ
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 forRTE_FLOW_ITEM_TYPE_MPLS. note the0xf0in that third byte, not0xff, 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 forRTE_FLOW_ITEM_TYPE_GRE, one lonelyprotocolfield atRTE_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 forRTE_FLOW_ITEM_TYPE_FUZZY, and yes the name is unserious,threshis0xffffffff, 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 forRTE_FLOW_ITEM_TYPE_GTP,teidset toRTE_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 forRTE_FLOW_ITEM_TYPE_ESP,spiatRTE_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 forRTE_FLOW_ITEM_TYPE_GENEVE, three0xffbytes ofvni.
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 forRTE_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 forRTE_FLOW_ITEM_TYPE_ARP_ETH_IPV4, and she's thorough:arp_sha,arp_sip,arp_tha,arp_tipall 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 forRTE_FLOW_ITEM_TYPE_IPV6_EXT, justnext_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 forRTE_FLOW_ITEM_TYPE_ICMP6.typeandcode, both0xff, 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 forRTE_FLOW_ITEM_TYPE_ICMP6_ND_NS,target_addrgetting the fullRTE_IPV6_MASK_FULLglow-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 forRTE_FLOW_ITEM_TYPE_ICMP6_ND_NA. sameRTE_IPV6_MASK_FULLtreatment, 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 forRTE_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 forRTE_FLOW_ITEM_TYPE_ICMP6_ND_OPT_SLA_ETH, six0xffbytes ofsla.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 forRTE_FLOW_ITEM_TYPE_ICMP6_ND_OPT_TLA_ETH, same six bytes but ontla.addr_bytesthis 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 forRTE_FLOW_ITEM_TYPE_META,datastraight upUINT32_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 forRTE_FLOW_ITEM_TYPE_GTP_PSC, andqfiis0x3fโ 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 forRTE_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 forRTE_FLOW_ITEM_TYPE_TAG,dataat0xffffffffandindexat0xff, 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 forRTE_FLOW_ITEM_TYPE_L2TPV3OIP,session_idatRTE_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 forRTE_FLOW_ITEM_TYPE_MARK,.idall 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 forRTE_FLOW_ITEM_TYPE_NSH, and she's the overachiever of the group chat:mdtype0xf,next_proto0xff,spi0xffffff,sindex0xff๐ฅ
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 forRTE_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 forRTE_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 forRTE_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 forRTE_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 forRTE_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 forRTE_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 onstruct 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 forRTE_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 forRTE_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 forRTE_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 forRTE_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 forRTE_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 forRTE_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 forRTE_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 forRTE_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
- nixos 26.05: dpdk 26.03
- nixpkgs unstable: dpdk 26.03
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms