DPDK  24.03.0
Data Structures | Macros | Enumerations | Functions | Variables
rte_flow.h File Reference
#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"

Go to the source code of this file.

Data Structures

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

Macros

#define RTE_FLOW_CONNTRACK_PKT_STATE_VALID   RTE_BIT32(0)
 
#define RTE_FLOW_CONNTRACK_PKT_STATE_CHANGED   RTE_BIT32(1)
 
#define RTE_FLOW_CONNTRACK_PKT_STATE_INVALID   RTE_BIT32(2)
 
#define RTE_FLOW_CONNTRACK_PKT_STATE_DISABLED   RTE_BIT32(3)
 
#define RTE_FLOW_CONNTRACK_PKT_STATE_BAD   RTE_BIT32(4)
 
#define RTE_FLOW_RESTORE_INFO_TUNNEL   RTE_BIT64(0)
 
#define RTE_FLOW_RESTORE_INFO_ENCAPSULATED   RTE_BIT64(1)
 
#define RTE_FLOW_RESTORE_INFO_GROUP_ID   RTE_BIT64(2)
 
#define RTE_FLOW_PORT_FLAG_STRICT_QUEUE   RTE_BIT32(0)
 
#define RTE_FLOW_PORT_FLAG_SHARE_INDIRECT   RTE_BIT32(1)
 
Flags for template table attribute.

Each bit is an optional hint for table specialization, offering a potential optimization at driver layer. The driver can ignore the hints silently. The hints do not replace any matching criteria.

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

Enumerations

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
}
 
enum  rte_flow_quota_state { RTE_FLOW_QUOTA_STATE_PASS, RTE_FLOW_QUOTA_STATE_BLOCK }
 
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_MODE_SINGLE = 0, FLEX_TUNNEL_MODE_OUTER, FLEX_TUNNEL_MODE_INNER, FLEX_TUNNEL_MODE_MULTI,
  FLEX_TUNNEL_MODE_TUNNEL
}
 
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
}
 
enum  rte_flow_item_compare_op
 
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
}
 
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 { RTE_FLOW_UPDATE_QUOTA_SET, RTE_FLOW_UPDATE_QUOTA_ADD }
 
enum  rte_flow_nat64_type { RTE_FLOW_NAT64_6TO4 = 0, RTE_FLOW_NAT64_4TO6 = 1 }
 
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 {
  RTE_FLOW_CONNTRACK_FLAG_NONE = 0, RTE_FLOW_CONNTRACK_FLAG_SYN = RTE_BIT32(0), RTE_FLOW_CONNTRACK_FLAG_SYNACK = RTE_BIT32(1), RTE_FLOW_CONNTRACK_FLAG_FIN = RTE_BIT32(2),
  RTE_FLOW_CONNTRACK_FLAG_ACK = RTE_BIT32(3), RTE_FLOW_CONNTRACK_FLAG_RST = RTE_BIT32(4)
}
 
enum  rte_flow_modify_op { RTE_FLOW_MODIFY_SET = 0, RTE_FLOW_MODIFY_ADD, RTE_FLOW_MODIFY_SUB }
 
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 {
  RTE_FLOW_CONV_OP_NONE, RTE_FLOW_CONV_OP_ATTR, RTE_FLOW_CONV_OP_ITEM, 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 { RTE_FLOW_TABLE_INSERTION_TYPE_PATTERN, RTE_FLOW_TABLE_INSERTION_TYPE_INDEX }
 
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 { RTE_FLOW_OP_SUCCESS, RTE_FLOW_OP_ERROR }
 
enum  rte_flow_query_update_mode { RTE_FLOW_QU_QUERY_FIRST = 1, RTE_FLOW_QU_UPDATE_FIRST }
 
enum  rte_flow_encap_hash_field { RTE_FLOW_ENCAP_HASH_FIELD_SRC_PORT, RTE_FLOW_ENCAP_HASH_FIELD_NVGRE_FLOW_ID }
 

Functions

__rte_experimental int rte_flow_dev_dump (uint16_t port_id, struct rte_flow *flow, FILE *file, struct rte_flow_error *error)
 
static __rte_experimental int rte_flow_dynf_metadata_avail (void)
 
__rte_experimental int rte_flow_dynf_metadata_register (void)
 
int rte_flow_validate (uint16_t port_id, const struct rte_flow_attr *attr, const struct rte_flow_item pattern[], const struct rte_flow_action actions[], struct rte_flow_error *error)
 
struct rte_flow * rte_flow_create (uint16_t port_id, const struct rte_flow_attr *attr, const struct rte_flow_item pattern[], const struct rte_flow_action actions[], struct rte_flow_error *error)
 
int rte_flow_destroy (uint16_t port_id, struct rte_flow *flow, struct rte_flow_error *error)
 
__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)
 
int rte_flow_flush (uint16_t port_id, struct rte_flow_error *error)
 
int rte_flow_query (uint16_t port_id, struct rte_flow *flow, const struct rte_flow_action *action, void *data, struct rte_flow_error *error)
 
int rte_flow_isolate (uint16_t port_id, int set, struct rte_flow_error *error)
 
int rte_flow_error_set (struct rte_flow_error *error, int code, enum rte_flow_error_type type, const void *cause, const char *message)
 
__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_experimental int rte_flow_conv (enum rte_flow_conv_op op, void *dst, size_t size, const void *src, struct rte_flow_error *error)
 
__rte_experimental int rte_flow_get_aged_flows (uint16_t port_id, void **contexts, uint32_t nb_contexts, struct rte_flow_error *error)
 
__rte_experimental int rte_flow_get_q_aged_flows (uint16_t port_id, uint32_t queue_id, void **contexts, uint32_t nb_contexts, struct rte_flow_error *error)
 
__rte_experimental struct rte_flow_action_handle * rte_flow_action_handle_create (uint16_t port_id, const struct rte_flow_indir_action_conf *conf, const struct rte_flow_action *action, struct rte_flow_error *error)
 
__rte_experimental int rte_flow_action_handle_destroy (uint16_t port_id, struct rte_flow_action_handle *handle, struct rte_flow_error *error)
 
__rte_experimental int rte_flow_action_handle_update (uint16_t port_id, struct rte_flow_action_handle *handle, const void *update, struct rte_flow_error *error)
 
__rte_experimental int rte_flow_action_handle_query (uint16_t port_id, const struct rte_flow_action_handle *handle, void *data, struct rte_flow_error *error)
 
__rte_experimental int rte_flow_tunnel_decap_set (uint16_t port_id, struct rte_flow_tunnel *tunnel, struct rte_flow_action **actions, uint32_t *num_of_actions, struct rte_flow_error *error)
 
__rte_experimental int rte_flow_tunnel_match (uint16_t port_id, struct rte_flow_tunnel *tunnel, struct rte_flow_item **items, uint32_t *num_of_items, struct rte_flow_error *error)
 
__rte_experimental uint64_t rte_flow_restore_info_dynflag (void)
 
__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_experimental int rte_flow_tunnel_action_decap_release (uint16_t port_id, struct rte_flow_action *actions, uint32_t num_of_actions, struct rte_flow_error *error)
 
__rte_experimental int rte_flow_tunnel_item_release (uint16_t port_id, struct rte_flow_item *items, uint32_t num_of_items, struct rte_flow_error *error)
 
int rte_flow_pick_transfer_proxy (uint16_t port_id, uint16_t *proxy_port_id, struct rte_flow_error *error)
 
__rte_experimental struct rte_flow_item_flex_handle * rte_flow_flex_item_create (uint16_t port_id, const struct rte_flow_item_flex_conf *conf, struct rte_flow_error *error)
 
__rte_experimental int rte_flow_flex_item_release (uint16_t port_id, const struct rte_flow_item_flex_handle *handle, struct rte_flow_error *error)
 
__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_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_experimental struct rte_flow_pattern_template * rte_flow_pattern_template_create (uint16_t port_id, const struct rte_flow_pattern_template_attr *template_attr, const struct rte_flow_item pattern[], struct rte_flow_error *error)
 
__rte_experimental int rte_flow_pattern_template_destroy (uint16_t port_id, struct rte_flow_pattern_template *pattern_template, struct rte_flow_error *error)
 
__rte_experimental struct rte_flow_actions_template * rte_flow_actions_template_create (uint16_t port_id, const struct rte_flow_actions_template_attr *template_attr, const struct rte_flow_action actions[], const struct rte_flow_action masks[], struct rte_flow_error *error)
 
__rte_experimental int rte_flow_actions_template_destroy (uint16_t port_id, struct rte_flow_actions_template *actions_template, struct rte_flow_error *error)
 
__rte_experimental bool rte_flow_template_table_resizable (__rte_unused uint16_t port_id, const struct rte_flow_template_table_attr *tbl_attr)
 
__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_experimental int rte_flow_template_table_destroy (uint16_t port_id, struct rte_flow_template_table *template_table, struct rte_flow_error *error)
 
__rte_experimental int rte_flow_group_set_miss_actions (uint16_t port_id, uint32_t group_id, const struct rte_flow_group_attr *attr, const struct rte_flow_action actions[], struct rte_flow_error *error)
 
__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_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_experimental int rte_flow_async_destroy (uint16_t port_id, uint32_t queue_id, const struct rte_flow_op_attr *op_attr, struct rte_flow *flow, void *user_data, struct rte_flow_error *error)
 
__rte_experimental int rte_flow_async_actions_update (uint16_t port_id, uint32_t queue_id, const struct rte_flow_op_attr *op_attr, struct rte_flow *flow, const struct rte_flow_action actions[], uint8_t actions_template_index, void *user_data, struct rte_flow_error *error)
 
__rte_experimental int rte_flow_push (uint16_t port_id, uint32_t queue_id, struct rte_flow_error *error)
 
__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_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_experimental int rte_flow_async_action_handle_destroy (uint16_t port_id, uint32_t queue_id, const struct rte_flow_op_attr *op_attr, struct rte_flow_action_handle *action_handle, void *user_data, struct rte_flow_error *error)
 
__rte_experimental int rte_flow_async_action_handle_update (uint16_t port_id, uint32_t queue_id, const struct rte_flow_op_attr *op_attr, struct rte_flow_action_handle *action_handle, const void *update, void *user_data, struct rte_flow_error *error)
 
__rte_experimental int rte_flow_async_action_handle_query (uint16_t port_id, uint32_t queue_id, const struct rte_flow_op_attr *op_attr, const struct rte_flow_action_handle *action_handle, void *data, void *user_data, struct rte_flow_error *error)
 
__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_experimental int rte_flow_async_action_handle_query_update (uint16_t port_id, uint32_t queue_id, const struct rte_flow_op_attr *attr, struct rte_flow_action_handle *handle, const void *update, void *query, enum rte_flow_query_update_mode mode, void *user_data, struct rte_flow_error *error)
 
__rte_experimental struct rte_flow_action_list_handle * rte_flow_action_list_handle_create (uint16_t port_id, const struct rte_flow_indir_action_conf *conf, const struct rte_flow_action *actions, struct rte_flow_error *error)
 
__rte_experimental struct rte_flow_action_list_handle * rte_flow_async_action_list_handle_create (uint16_t port_id, uint32_t queue_id, const struct rte_flow_op_attr *attr, const struct rte_flow_indir_action_conf *conf, const struct rte_flow_action *actions, void *user_data, struct rte_flow_error *error)
 
__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_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)
 
__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

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

Detailed Description

RTE generic flow API

This interface provides the ability to program packet matching and associated actions in hardware through flow rules.

Definition in file rte_flow.h.

Macro Definition Documentation

◆ RTE_FLOW_CONNTRACK_PKT_STATE_VALID

#define RTE_FLOW_CONNTRACK_PKT_STATE_VALID   RTE_BIT32(0)

The packet is valid after conntrack checking.

Definition at line 1939 of file rte_flow.h.

◆ RTE_FLOW_CONNTRACK_PKT_STATE_CHANGED

#define RTE_FLOW_CONNTRACK_PKT_STATE_CHANGED   RTE_BIT32(1)

The state of the connection is changed.

Definition at line 1943 of file rte_flow.h.

◆ RTE_FLOW_CONNTRACK_PKT_STATE_INVALID

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

◆ RTE_FLOW_CONNTRACK_PKT_STATE_DISABLED

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

◆ RTE_FLOW_CONNTRACK_PKT_STATE_BAD

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

◆ RTE_FLOW_RESTORE_INFO_TUNNEL

#define RTE_FLOW_RESTORE_INFO_TUNNEL   RTE_BIT64(0)

Indicate that the packet has a tunnel.

Definition at line 5189 of file rte_flow.h.

◆ RTE_FLOW_RESTORE_INFO_ENCAPSULATED

#define RTE_FLOW_RESTORE_INFO_ENCAPSULATED   RTE_BIT64(1)

Indicate that the packet has a non decapsulated tunnel header.

Definition at line 5194 of file rte_flow.h.

◆ RTE_FLOW_RESTORE_INFO_GROUP_ID

#define RTE_FLOW_RESTORE_INFO_GROUP_ID   RTE_BIT64(2)

Indicate that the packet has a group_id.

Definition at line 5199 of file rte_flow.h.

◆ RTE_FLOW_PORT_FLAG_STRICT_QUEUE

#define RTE_FLOW_PORT_FLAG_STRICT_QUEUE   RTE_BIT32(0)

Indicate all operations for a given flow rule will strictly happen on the same queue (create/destroy/query/update).

Definition at line 5444 of file rte_flow.h.

◆ RTE_FLOW_PORT_FLAG_SHARE_INDIRECT

#define RTE_FLOW_PORT_FLAG_SHARE_INDIRECT   RTE_BIT32(1)

Indicate all steering objects should be created on contexts of the host port, providing indirect object sharing between ports.

Definition at line 5451 of file rte_flow.h.

◆ RTE_FLOW_TABLE_SPECIALIZE_TRANSFER_WIRE_ORIG

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

Definition at line 5842 of file rte_flow.h.

◆ RTE_FLOW_TABLE_SPECIALIZE_TRANSFER_VPORT_ORIG

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

◆ RTE_FLOW_TABLE_SPECIALIZE_RESIZABLE

#define RTE_FLOW_TABLE_SPECIALIZE_RESIZABLE   RTE_BIT32(2)

Specialize table for resize.

Definition at line 5854 of file rte_flow.h.

Enumeration Type Documentation

◆ rte_flow_item_type

Matching pattern item types.

Pattern items fall in two categories:

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

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

Enumerator
RTE_FLOW_ITEM_TYPE_END 

[META]

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

No associated specification structure.

RTE_FLOW_ITEM_TYPE_VOID 

[META]

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

No associated specification structure.

RTE_FLOW_ITEM_TYPE_INVERT 

[META]

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

No associated specification structure.

RTE_FLOW_ITEM_TYPE_ANY 

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

See struct rte_flow_item_any.

RTE_FLOW_ITEM_TYPE_PORT_ID 
Deprecated:
See also
RTE_FLOW_ITEM_TYPE_PORT_REPRESENTOR
RTE_FLOW_ITEM_TYPE_REPRESENTED_PORT

[META]

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

See struct rte_flow_item_port_id.

RTE_FLOW_ITEM_TYPE_RAW 

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

See struct rte_flow_item_raw.

RTE_FLOW_ITEM_TYPE_ETH 

Matches an Ethernet header.

See struct rte_flow_item_eth.

RTE_FLOW_ITEM_TYPE_VLAN 

Matches an 802.1Q/ad VLAN tag.

See struct rte_flow_item_vlan.

RTE_FLOW_ITEM_TYPE_IPV4 

Matches an IPv4 header.

See struct rte_flow_item_ipv4.

RTE_FLOW_ITEM_TYPE_IPV6 

Matches an IPv6 header.

See struct rte_flow_item_ipv6.

RTE_FLOW_ITEM_TYPE_ICMP 

Matches an ICMP header.

See struct rte_flow_item_icmp.

RTE_FLOW_ITEM_TYPE_UDP 

Matches a UDP header.

See struct rte_flow_item_udp.

RTE_FLOW_ITEM_TYPE_TCP 

Matches a TCP header.

See struct rte_flow_item_tcp.

RTE_FLOW_ITEM_TYPE_SCTP 

Matches a SCTP header.

See struct rte_flow_item_sctp.

RTE_FLOW_ITEM_TYPE_VXLAN 

Matches a VXLAN header.

See struct rte_flow_item_vxlan.

RTE_FLOW_ITEM_TYPE_E_TAG 

Matches a E_TAG header.

See struct rte_flow_item_e_tag.

RTE_FLOW_ITEM_TYPE_NVGRE 

Matches a NVGRE header.

See struct rte_flow_item_nvgre.

RTE_FLOW_ITEM_TYPE_MPLS 

Matches a MPLS header.

See struct rte_flow_item_mpls.

RTE_FLOW_ITEM_TYPE_GRE 

Matches a GRE header.

See struct rte_flow_item_gre.

RTE_FLOW_ITEM_TYPE_FUZZY 

[META]

Fuzzy pattern match, expect faster than default.

This is for device that support fuzzy matching option. Usually a fuzzy matching is fast but the cost is accuracy.

See struct rte_flow_item_fuzzy.

RTE_FLOW_ITEM_TYPE_GTP 

Matches a GTP header.

Configure flow for GTP packets.

See struct rte_flow_item_gtp.

RTE_FLOW_ITEM_TYPE_GTPC 

Matches a GTP header.

Configure flow for GTP-C packets.

See struct rte_flow_item_gtp.

RTE_FLOW_ITEM_TYPE_GTPU 

Matches a GTP header.

Configure flow for GTP-U packets.

See struct rte_flow_item_gtp.

RTE_FLOW_ITEM_TYPE_ESP 

Matches a ESP header.

See struct rte_flow_item_esp.

RTE_FLOW_ITEM_TYPE_GENEVE 

Matches a GENEVE header.

See struct rte_flow_item_geneve.

RTE_FLOW_ITEM_TYPE_VXLAN_GPE 

Matches a VXLAN-GPE header.

See struct rte_flow_item_vxlan_gpe.

RTE_FLOW_ITEM_TYPE_ARP_ETH_IPV4 

Matches an ARP header for Ethernet/IPv4.

See struct rte_flow_item_arp_eth_ipv4.

RTE_FLOW_ITEM_TYPE_IPV6_EXT 

Matches the presence of any IPv6 extension header.

See struct rte_flow_item_ipv6_ext.

RTE_FLOW_ITEM_TYPE_ICMP6 

Matches any ICMPv6 header.

See struct rte_flow_item_icmp6.

RTE_FLOW_ITEM_TYPE_ICMP6_ND_NS 

Matches an ICMPv6 neighbor discovery solicitation.

See struct rte_flow_item_icmp6_nd_ns.

RTE_FLOW_ITEM_TYPE_ICMP6_ND_NA 

Matches an ICMPv6 neighbor discovery advertisement.

See struct rte_flow_item_icmp6_nd_na.

RTE_FLOW_ITEM_TYPE_ICMP6_ND_OPT 

Matches the presence of any ICMPv6 neighbor discovery option.

See struct rte_flow_item_icmp6_nd_opt.

RTE_FLOW_ITEM_TYPE_ICMP6_ND_OPT_SLA_ETH 

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

See struct rte_flow_item_icmp6_nd_opt_sla_eth.

RTE_FLOW_ITEM_TYPE_ICMP6_ND_OPT_TLA_ETH 

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

See struct rte_flow_item_icmp6_nd_opt_tla_eth.

RTE_FLOW_ITEM_TYPE_MARK 

Matches specified mark field.

See struct rte_flow_item_mark.

RTE_FLOW_ITEM_TYPE_META 

[META]

Matches a metadata value.

See struct rte_flow_item_meta.

RTE_FLOW_ITEM_TYPE_GRE_KEY 

Matches a GRE optional key field.

The value should a big-endian 32bit integer.

When this item present the K bit is implicitly matched as "1" in the default mask.

spec/mask type:

rte_be32_t *
RTE_FLOW_ITEM_TYPE_GTP_PSC 

Matches a GTP extension header: PDU session container.

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

See struct rte_flow_item_gtp_psc.

RTE_FLOW_ITEM_TYPE_PPPOES 

Matches a PPPoE header.

Configure flow for PPPoE session packets.

See struct rte_flow_item_pppoe.

RTE_FLOW_ITEM_TYPE_PPPOED 

Matches a PPPoE header.

Configure flow for PPPoE discovery packets.

See struct rte_flow_item_pppoe.

RTE_FLOW_ITEM_TYPE_PPPOE_PROTO_ID 

Matches a PPPoE optional proto_id field.

It only applies to PPPoE session packets.

See struct rte_flow_item_pppoe_proto_id.

RTE_FLOW_ITEM_TYPE_NSH 

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

RTE_FLOW_ITEM_TYPE_IGMP 

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

RTE_FLOW_ITEM_TYPE_AH 

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

RTE_FLOW_ITEM_TYPE_HIGIG2 

Matches a HIGIG header. see struct rte_flow_item_higig2_hdr.

RTE_FLOW_ITEM_TYPE_TAG 

[META]

Matches a tag value.

See struct rte_flow_item_tag.

RTE_FLOW_ITEM_TYPE_L2TPV3OIP 

Matches a L2TPv3 over IP header.

Configure flow for L2TPv3 over IP packets.

See struct rte_flow_item_l2tpv3oip.

RTE_FLOW_ITEM_TYPE_PFCP 

Matches PFCP Header. See struct rte_flow_item_pfcp.

RTE_FLOW_ITEM_TYPE_ECPRI 

Matches eCPRI Header.

Configure flow for eCPRI over ETH or UDP packets.

See struct rte_flow_item_ecpri.

RTE_FLOW_ITEM_TYPE_IPV6_FRAG_EXT 

Matches the presence of IPv6 fragment extension header.

See struct rte_flow_item_ipv6_frag_ext.

RTE_FLOW_ITEM_TYPE_GENEVE_OPT 

Matches Geneve Variable Length Option

See struct rte_flow_item_geneve_opt

RTE_FLOW_ITEM_TYPE_INTEGRITY 

[META]

Matches on packet integrity. For some devices application needs to enable integration checks in HW before using this item.

See also
struct rte_flow_item_integrity.
RTE_FLOW_ITEM_TYPE_CONNTRACK 

[META]

Matches conntrack state.

See also
struct rte_flow_item_conntrack.
RTE_FLOW_ITEM_TYPE_PORT_REPRESENTOR 

[META]

Matches traffic entering the embedded switch from the given ethdev.

See also
struct rte_flow_item_ethdev
RTE_FLOW_ITEM_TYPE_REPRESENTED_PORT 

[META]

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

See also
struct rte_flow_item_ethdev
RTE_FLOW_ITEM_TYPE_FLEX 

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

See also
struct rte_flow_item_flex.
RTE_FLOW_ITEM_TYPE_L2TPV2 

Matches L2TPv2 Header.

See struct rte_flow_item_l2tpv2.

RTE_FLOW_ITEM_TYPE_PPP 

Matches PPP Header.

See struct rte_flow_item_ppp.

RTE_FLOW_ITEM_TYPE_GRE_OPTION 

Matches GRE optional fields.

See struct rte_flow_item_gre_opt.

RTE_FLOW_ITEM_TYPE_MACSEC 

Matches MACsec Ethernet Header.

See struct rte_flow_item_macsec.

RTE_FLOW_ITEM_TYPE_METER_COLOR 

Matches Meter Color Marker.

See struct rte_flow_item_meter_color.

RTE_FLOW_ITEM_TYPE_IPV6_ROUTING_EXT 

Matches the presence of IPv6 routing extension header.

See also
struct rte_flow_item_ipv6_routing_ext.
RTE_FLOW_ITEM_TYPE_ICMP6_ECHO_REQUEST 

Matches an ICMPv6 echo request.

See also
struct rte_flow_item_icmp6_echo.
RTE_FLOW_ITEM_TYPE_ICMP6_ECHO_REPLY 

Matches an ICMPv6 echo reply.

See also
struct rte_flow_item_icmp6_echo.
RTE_FLOW_ITEM_TYPE_QUOTA 

Match Quota state

See also
struct rte_flow_item_quota
RTE_FLOW_ITEM_TYPE_AGGR_AFFINITY 

Matches on the aggregated port of the received packet. Used in case multiple ports are aggregated to the a DPDK port. First port is number 1.

See also
struct rte_flow_item_aggr_affinity.
RTE_FLOW_ITEM_TYPE_TX_QUEUE 

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

See also
struct rte_flow_item_tx_queue
RTE_FLOW_ITEM_TYPE_IB_BTH 

Matches an InfiniBand base transport header in RoCE packet.

See also
struct rte_flow_item_ib_bth.
RTE_FLOW_ITEM_TYPE_PTYPE 

Matches the packet type as defined in rte_mbuf_ptype.

See struct rte_flow_item_ptype.

RTE_FLOW_ITEM_TYPE_RANDOM 

[META]

Matches a random value.

This value is not based on the packet data/headers. The application shouldn't assume that this value is kept during the lifetime of the packet.

See also
struct rte_flow_item_random.
RTE_FLOW_ITEM_TYPE_COMPARE 

Match packet with various comparison types.

See struct rte_flow_item_compare.

Definition at line 153 of file rte_flow.h.

◆ rte_flow_quota_state

Warning
EXPERIMENTAL: this API may change without prior notice.

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

◆ rte_flow_item_flex_field_mode

Field bit offset calculation mode.

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

◆ rte_flow_item_flex_tunnel_mode

Flex item field tunnel mode

Enumerator
FLEX_TUNNEL_MODE_SINGLE 

The protocol header can be present in the packet only once. No multiple flex item flow inclusions (for inner/outer) are allowed. No any relations with tunnel protocols are imposed. The drivers can optimize hardware resource usage to handle match on single flex item of specific type.

FLEX_TUNNEL_MODE_OUTER 

Flex item presents outer header only.

FLEX_TUNNEL_MODE_INNER 

Flex item presents inner header only.

FLEX_TUNNEL_MODE_MULTI 

Flex item presents either inner or outer header. The driver handles as many multiple inners as hardware supports.

FLEX_TUNNEL_MODE_TUNNEL 

Flex item presents tunnel protocol header.

Definition at line 2183 of file rte_flow.h.

◆ rte_flow_field_id

Packet header field IDs, used by RTE_FLOW_ACTION_TYPE_MODIFY_FIELD and RTE_FLOW_ITEM_TYPE_COMPARE.

Enumerator
RTE_FLOW_FIELD_START 

Start of a packet.

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.

Definition at line 2379 of file rte_flow.h.

◆ rte_flow_item_compare_op

Expected operation types for compare item.

Definition at line 2531 of file rte_flow.h.

◆ rte_flow_action_type

Action types.

Each possible action is represented by a type. An action can have an associated configuration object. Several actions combined in a list can be assigned to a flow rule and are performed in order.

They fall in three categories:

  • Actions that modify the fate of matching traffic, for instance by dropping or assigning it a specific destination.
  • Actions that modify matching traffic contents or its properties. This includes adding/removing encapsulation, encryption, compression and marks.
  • Actions related to the flow rule itself, such as updating counters or making it non-terminating.

Flow rules being terminating by default, not specifying any action of the fate kind results in undefined behavior. This applies to both ingress and egress.

PASSTHRU, when supported, makes a flow rule non-terminating.

Enumerator
RTE_FLOW_ACTION_TYPE_END 

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

No associated configuration structure.

RTE_FLOW_ACTION_TYPE_VOID 

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

No associated configuration structure.

RTE_FLOW_ACTION_TYPE_PASSTHRU 

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

No associated configuration structure.

RTE_FLOW_ACTION_TYPE_JUMP 

RTE_FLOW_ACTION_TYPE_JUMP

Redirects packets to a group on the current device.

See struct rte_flow_action_jump.

RTE_FLOW_ACTION_TYPE_MARK 

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

See struct rte_flow_action_mark.

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

See also
rte_eth_rx_metadata_negotiate()
RTE_ETH_RX_METADATA_USER_MARK
RTE_FLOW_ACTION_TYPE_FLAG 

Flags packets. Similar to MARK without a specific value; only sets the RTE_MBUF_F_RX_FDIR mbuf flag.

No associated configuration structure.

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

See also
rte_eth_rx_metadata_negotiate()
RTE_ETH_RX_METADATA_USER_FLAG
RTE_FLOW_ACTION_TYPE_QUEUE 

Assigns packets to a given queue index.

See struct rte_flow_action_queue.

RTE_FLOW_ACTION_TYPE_DROP 

Drops packets.

PASSTHRU overrides this action if both are specified.

No associated configuration structure.

RTE_FLOW_ACTION_TYPE_COUNT 

Enables counters for this flow rule.

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

See struct rte_flow_action_count.

RTE_FLOW_ACTION_TYPE_RSS 

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

See struct rte_flow_action_rss.

RTE_FLOW_ACTION_TYPE_PF 
Deprecated:
See also
RTE_FLOW_ACTION_TYPE_PORT_REPRESENTOR
RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT

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

No associated configuration structure.

RTE_FLOW_ACTION_TYPE_VF 
Deprecated:
See also
RTE_FLOW_ACTION_TYPE_PORT_REPRESENTOR
RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT

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

See struct rte_flow_action_vf.

RTE_FLOW_ACTION_TYPE_PORT_ID 
Deprecated:
See also
RTE_FLOW_ACTION_TYPE_PORT_REPRESENTOR
RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT

Directs matching traffic to a given DPDK port ID.

See struct rte_flow_action_port_id.

RTE_FLOW_ACTION_TYPE_METER 

Traffic metering and policing (MTR).

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

RTE_FLOW_ACTION_TYPE_SECURITY 

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

See struct rte_flow_action_security.

RTE_FLOW_ACTION_TYPE_OF_DEC_NW_TTL 
Warning
This is a legacy action.
See also
RTE_FLOW_ACTION_TYPE_MODIFY_FIELD

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

No associated configuration structure.

RTE_FLOW_ACTION_TYPE_OF_POP_VLAN 

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

No associated configuration structure.

RTE_FLOW_ACTION_TYPE_OF_PUSH_VLAN 

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

See struct rte_flow_action_of_push_vlan.

RTE_FLOW_ACTION_TYPE_OF_SET_VLAN_VID 

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

See struct rte_flow_action_of_set_vlan_vid.

RTE_FLOW_ACTION_TYPE_OF_SET_VLAN_PCP 

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

See struct rte_flow_action_of_set_vlan_pcp.

RTE_FLOW_ACTION_TYPE_OF_POP_MPLS 

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

See struct rte_flow_action_of_pop_mpls.

RTE_FLOW_ACTION_TYPE_OF_PUSH_MPLS 

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

See struct rte_flow_action_of_push_mpls.

RTE_FLOW_ACTION_TYPE_VXLAN_ENCAP 

Encapsulate flow in VXLAN tunnel as defined in rte_flow_action_vxlan_encap action structure.

See struct rte_flow_action_vxlan_encap.

RTE_FLOW_ACTION_TYPE_VXLAN_DECAP 

Decapsulate outer most VXLAN tunnel from matched flow.

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

RTE_FLOW_ACTION_TYPE_NVGRE_ENCAP 

Encapsulate flow in NVGRE tunnel defined in the rte_flow_action_nvgre_encap action structure.

See struct rte_flow_action_nvgre_encap.

RTE_FLOW_ACTION_TYPE_NVGRE_DECAP 

Decapsulate outer most NVGRE tunnel from matched flow.

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

RTE_FLOW_ACTION_TYPE_RAW_ENCAP 

Add outer header whose template is provided in its data buffer

See struct rte_flow_action_raw_encap.

RTE_FLOW_ACTION_TYPE_RAW_DECAP 

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

See struct rte_flow_action_raw_decap

RTE_FLOW_ACTION_TYPE_SET_IPV4_SRC 
Warning
This is a legacy action.
See also
RTE_FLOW_ACTION_TYPE_MODIFY_FIELD

Modify IPv4 source address in the outermost IPv4 header.

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

See struct rte_flow_action_set_ipv4.

RTE_FLOW_ACTION_TYPE_SET_IPV4_DST 
Warning
This is a legacy action.
See also
RTE_FLOW_ACTION_TYPE_MODIFY_FIELD

Modify IPv4 destination address in the outermost IPv4 header.

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

See struct rte_flow_action_set_ipv4.

RTE_FLOW_ACTION_TYPE_SET_IPV6_SRC 
Warning
This is a legacy action.
See also
RTE_FLOW_ACTION_TYPE_MODIFY_FIELD

Modify IPv6 source address in the outermost IPv6 header.

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

RTE_FLOW_ACTION_TYPE_SET_IPV6_DST 
Warning
This is a legacy action.
See also
RTE_FLOW_ACTION_TYPE_MODIFY_FIELD

Modify IPv6 destination address in the outermost IPv6 header.

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

RTE_FLOW_ACTION_TYPE_SET_TP_SRC 
Warning
This is a legacy action.
See also
RTE_FLOW_ACTION_TYPE_MODIFY_FIELD

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

If 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 destination port number in the outermost TCP/UDP header.

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

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

RTE_FLOW_ACTION_TYPE_DEC_TTL 
Warning
This is a legacy action.
See also
RTE_FLOW_ACTION_TYPE_MODIFY_FIELD

Decrease TTL value directly

No associated configuration structure.

RTE_FLOW_ACTION_TYPE_SET_TTL 
Warning
This is a legacy action.
See also
RTE_FLOW_ACTION_TYPE_MODIFY_FIELD

Set 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 source MAC address from matched flow.

If 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 destination MAC address from matched flow.

If 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 sequence number in the outermost TCP header.

Action configuration specifies the value to increase 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.

RTE_FLOW_ACTION_TYPE_DEC_TCP_SEQ 
Warning
This is a legacy action.
See also
RTE_FLOW_ACTION_TYPE_MODIFY_FIELD

Decrease sequence number in the outermost TCP header.

Action configuration specifies the value to decrease 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.

RTE_FLOW_ACTION_TYPE_INC_TCP_ACK 
Warning
This is a legacy action.
See also
RTE_FLOW_ACTION_TYPE_MODIFY_FIELD

Increase acknowledgment number in the outermost TCP header.

Action configuration specifies the value to increase 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.

RTE_FLOW_ACTION_TYPE_DEC_TCP_ACK 
Warning
This is a legacy action.
See also
RTE_FLOW_ACTION_TYPE_MODIFY_FIELD

Decrease acknowledgment number in the outermost TCP header.

Action configuration specifies the value to decrease 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.

RTE_FLOW_ACTION_TYPE_SET_TAG 
Warning
This is a legacy action.
See also
RTE_FLOW_ACTION_TYPE_MODIFY_FIELD

Set Tag.

Tag is for internal flow usage only and is not delivered to the application.

See struct rte_flow_action_set_tag.

RTE_FLOW_ACTION_TYPE_SET_META 
Warning
This is a legacy action.
See also
RTE_FLOW_ACTION_TYPE_MODIFY_FIELD

Set metadata on 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 IPv4 DSCP in the outermost IP header.

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

See struct rte_flow_action_set_dscp.

RTE_FLOW_ACTION_TYPE_SET_IPV6_DSCP 
Warning
This is a legacy action.
See also
RTE_FLOW_ACTION_TYPE_MODIFY_FIELD

Modify IPv6 DSCP in the outermost IP header.

If 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 aged flow if timeout passed without any matching on the flow.

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

RTE_FLOW_ACTION_TYPE_SAMPLE 

The matching packets will be duplicated with specified ratio and applied with own set of actions with a fate action.

See struct rte_flow_action_sample.

RTE_FLOW_ACTION_TYPE_SHARED 
Deprecated:
See also
RTE_FLOW_ACTION_TYPE_INDIRECT

Describe action shared across multiple flow rules.

Allow multiple rules reference the same action by handle (see struct rte_flow_shared_action).

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.

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.

See also
struct rte_flow_action_conntrack.
RTE_FLOW_ACTION_TYPE_METER_COLOR 

Color the packet to reflect the meter color result. Set 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 bifurcated driver model.

No associated configuration structure.

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 ethdev Rx queue's congestion mechanism. This flow action allows to skip the congestion configuration applied to the given ethdev Rx queue.

RTE_FLOW_ACTION_TYPE_IPV6_EXT_PUSH 

RTE_FLOW_ACTION_TYPE_IPV6_EXT_PUSH

Push IPv6 extension into 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 IPv6 extension from 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 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

Definition at line 2581 of file rte_flow.h.

◆ rte_flow_quota_mode

Warning
EXPERIMENTAL: this API may change without prior notice.

QUOTA operational mode.

See also
struct rte_flow_action_quota
Enumerator
RTE_FLOW_QUOTA_MODE_PACKET 

Count packets.

RTE_FLOW_QUOTA_MODE_L2 

Count packet bytes starting from L2.

RTE_FLOW_QUOTA_MODE_L3 

Count packet bytes starting from L3.

Definition at line 3258 of file rte_flow.h.

◆ rte_flow_update_quota_op

Warning
EXPERIMENTAL: this API may change without prior notice.

Indirect QUOTA update operations.

See also
struct rte_flow_update_quota
Enumerator
RTE_FLOW_UPDATE_QUOTA_SET 

Set new quota value.

RTE_FLOW_UPDATE_QUOTA_ADD 

Increase quota value.

Definition at line 3297 of file rte_flow.h.

◆ rte_flow_nat64_type

NAT64 translation type for IP headers.

Enumerator
RTE_FLOW_NAT64_6TO4 

IPv6 to IPv4 headers translation.

RTE_FLOW_NAT64_4TO6 

IPv4 to IPv6 headers translation.

Definition at line 3589 of file rte_flow.h.

◆ rte_flow_conntrack_state

The state of a TCP connection.

Enumerator
RTE_FLOW_CONNTRACK_STATE_SYN_RECV 

SYN-ACK packet was seen.

RTE_FLOW_CONNTRACK_STATE_ESTABLISHED 

3-way handshake was done.

RTE_FLOW_CONNTRACK_STATE_FIN_WAIT 

First FIN packet was received to close the connection.

RTE_FLOW_CONNTRACK_STATE_CLOSE_WAIT 

First FIN was ACKed.

RTE_FLOW_CONNTRACK_STATE_LAST_ACK 

Second FIN was received, waiting for the last ACK.

RTE_FLOW_CONNTRACK_STATE_TIME_WAIT 

Second FIN was ACKed, connection was closed.

Definition at line 3935 of file rte_flow.h.

◆ rte_flow_conntrack_tcp_last_index

The last passed TCP packet flags of a connection.

Enumerator
RTE_FLOW_CONNTRACK_FLAG_NONE 

No Flag.

RTE_FLOW_CONNTRACK_FLAG_SYN 

With SYN flag.

RTE_FLOW_CONNTRACK_FLAG_SYNACK 

With SYNACK flag.

RTE_FLOW_CONNTRACK_FLAG_FIN 

With FIN flag.

RTE_FLOW_CONNTRACK_FLAG_ACK 

With ACK flag.

RTE_FLOW_CONNTRACK_FLAG_RST 

With RST flag.

Definition at line 3953 of file rte_flow.h.

◆ rte_flow_modify_op

Operation types for MODIFY_FIELD action.

Enumerator
RTE_FLOW_MODIFY_SET 

Set a new value.

RTE_FLOW_MODIFY_ADD 

Add a value to a field.

RTE_FLOW_MODIFY_SUB 

Subtract a value from a field.

Definition at line 4105 of file rte_flow.h.

◆ rte_flow_error_type

Verbose error types.

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

Enumerator
RTE_FLOW_ERROR_TYPE_NONE 

No error.

RTE_FLOW_ERROR_TYPE_UNSPECIFIED 

Cause unspecified.

RTE_FLOW_ERROR_TYPE_HANDLE 

Flow rule (handle).

RTE_FLOW_ERROR_TYPE_ATTR_GROUP 

Group field.

RTE_FLOW_ERROR_TYPE_ATTR_PRIORITY 

Priority field.

RTE_FLOW_ERROR_TYPE_ATTR_INGRESS 

Ingress field.

RTE_FLOW_ERROR_TYPE_ATTR_EGRESS 

Egress field.

RTE_FLOW_ERROR_TYPE_ATTR_TRANSFER 

Transfer field.

RTE_FLOW_ERROR_TYPE_ATTR 

Attributes structure.

RTE_FLOW_ERROR_TYPE_ITEM_NUM 

Pattern length.

RTE_FLOW_ERROR_TYPE_ITEM_SPEC 

Item specification.

RTE_FLOW_ERROR_TYPE_ITEM_LAST 

Item specification range.

RTE_FLOW_ERROR_TYPE_ITEM_MASK 

Item specification mask.

RTE_FLOW_ERROR_TYPE_ITEM 

Specific pattern item.

RTE_FLOW_ERROR_TYPE_ACTION_NUM 

Number of actions.

RTE_FLOW_ERROR_TYPE_ACTION_CONF 

Action configuration.

RTE_FLOW_ERROR_TYPE_ACTION 

Specific action.

RTE_FLOW_ERROR_TYPE_STATE 

Current device state.

Definition at line 4314 of file rte_flow.h.

◆ rte_flow_conv_op

Conversion operations for flow API objects.

See also
rte_flow_conv()
Enumerator
RTE_FLOW_CONV_OP_NONE 

No operation to perform.

rte_flow_conv() simply returns 0.

RTE_FLOW_CONV_OP_ATTR 

Convert attributes structure.

This is a basic copy of an attributes structure.

  • src type:
    const struct rte_flow_attr *
  • dst type:
    struct rte_flow_attr *
RTE_FLOW_CONV_OP_ITEM 

Convert a single item.

Duplicates spec, last and mask but not outside objects.

  • src type:
    const struct rte_flow_item *
  • dst type:
    struct rte_flow_item *
RTE_FLOW_CONV_OP_ACTION 

Convert a single action.

Duplicates conf but not outside objects.

  • src type:
    const struct rte_flow_action *
  • dst type:
    struct rte_flow_action *
RTE_FLOW_CONV_OP_PATTERN 

Convert an entire pattern.

Duplicates all pattern items at once with the same constraints as RTE_FLOW_CONV_OP_ITEM.

  • src type:
    const struct rte_flow_item *
  • dst type:
    struct rte_flow_item *
RTE_FLOW_CONV_OP_ACTIONS 

Convert a list of actions.

Duplicates the entire list of actions at once with the same constraints as RTE_FLOW_CONV_OP_ACTION.

  • src type:
    const struct rte_flow_action *
  • dst type:
    struct rte_flow_action *
RTE_FLOW_CONV_OP_RULE 

Convert a complete flow rule description.

Comprises attributes, pattern and actions together at once with the usual constraints.

  • src type:
    const struct rte_flow_conv_rule *
  • dst type:
    struct rte_flow_conv_rule *
RTE_FLOW_CONV_OP_ITEM_NAME 

Convert item type to its name string.

Writes a NUL-terminated string to dst. Like snprintf(), the returned value excludes the terminator which is always written nonetheless.

  • src type:
    (const void *)enum rte_flow_item_type
  • dst type:
    char *
RTE_FLOW_CONV_OP_ACTION_NAME 

Convert action type to its name string.

Writes a NUL-terminated string to dst. Like snprintf(), the returned value excludes the terminator which is always written nonetheless.

  • src type:
    (const void *)enum rte_flow_action_type
  • dst type:
    char *
RTE_FLOW_CONV_OP_ITEM_NAME_PTR 

Convert item type to pointer to item name.

Retrieves item name pointer from its type. The string itself is not copied; instead, a unique pointer to an internal static constant storage is written to dst.

  • src type:
    (const void *)enum rte_flow_item_type
  • dst type:
    const char **
RTE_FLOW_CONV_OP_ACTION_NAME_PTR 

Convert action type to pointer to action name.

Retrieves action name pointer from its type. The string itself is not copied; instead, a unique pointer to an internal static constant storage is written to dst.

  • src type:
    (const void *)enum rte_flow_action_type
  • dst type:
    const char **

Definition at line 4380 of file rte_flow.h.

◆ rte_flow_table_insertion_type

Warning
EXPERIMENTAL: this API may change without prior notice.

Template table flow rules insertion type.

Enumerator
RTE_FLOW_TABLE_INSERTION_TYPE_PATTERN 

Pattern-based insertion.

RTE_FLOW_TABLE_INSERTION_TYPE_INDEX 

Index-based insertion.

Definition at line 5863 of file rte_flow.h.

◆ rte_flow_table_hash_func

Warning
EXPERIMENTAL: this API may change without prior notice.

Template table hash index calculation function.

Enumerator
RTE_FLOW_TABLE_HASH_FUNC_DEFAULT 

Default hash calculation.

RTE_FLOW_TABLE_HASH_FUNC_LINEAR 

Linear hash calculation.

RTE_FLOW_TABLE_HASH_FUNC_CRC32 

32-bit checksum hash calculation.

RTE_FLOW_TABLE_HASH_FUNC_CRC16 

16-bit checksum hash calculation.

Definition at line 5880 of file rte_flow.h.

◆ rte_flow_op_status

Warning
EXPERIMENTAL: this API may change without prior notice.

Asynchronous operation status.

Enumerator
RTE_FLOW_OP_SUCCESS 

The operation was completed successfully.

RTE_FLOW_OP_ERROR 

The operation was not completed successfully.

Definition at line 6266 of file rte_flow.h.

◆ rte_flow_query_update_mode

Warning
EXPERIMENTAL: this API may change without prior notice.

Query and update operational mode.

See also
rte_flow_action_handle_query_update()
rte_flow_async_action_handle_query_update()
Enumerator
RTE_FLOW_QU_QUERY_FIRST 

Query before update.

RTE_FLOW_QU_UPDATE_FIRST 

Query after update.

Definition at line 6491 of file rte_flow.h.

◆ rte_flow_encap_hash_field

Warning
EXPERIMENTAL: this API may change without prior notice.

Destination field type for the hash calculation, when encap action is used. The encap field implies the size, meaning XXX_SRC_PORT hash len is 2 bytes, while XXX_NVGRE_FLOW_ID hash len is 1 byte.

See also
function rte_flow_calc_encap_hash
Enumerator
RTE_FLOW_ENCAP_HASH_FIELD_SRC_PORT 

Calculate hash placed in UDP source port field.

RTE_FLOW_ENCAP_HASH_FIELD_NVGRE_FLOW_ID 

Calculate hash placed in NVGRE flow ID field.

Definition at line 6888 of file rte_flow.h.

Function Documentation

◆ rte_flow_dev_dump()

__rte_experimental int rte_flow_dev_dump ( uint16_t  port_id,
struct rte_flow *  flow,
FILE *  file,
struct rte_flow_error error 
)
Warning
EXPERIMENTAL: this API may change without prior notice.

Dump hardware internal representation information of rte flow to file.

Parameters
[in]port_idThe port identifier of the Ethernet device.
[in]flowThe pointer of flow rule to dump. Dump all rules if NULL.
[in]fileA pointer to a file for output.
[out]errorPerform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.
Returns
0 on success, a negative value otherwise.

◆ rte_flow_dynf_metadata_avail()

static __rte_experimental int rte_flow_dynf_metadata_avail ( void  )
inlinestatic

Check if mbuf dynamic field for metadata is registered.

Returns
True if registered, false otherwise.

Definition at line 4552 of file rte_flow.h.

◆ rte_flow_dynf_metadata_register()

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

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

◆ rte_flow_validate()

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.

The flow rule is validated for correctness and whether it could be accepted by the device given sufficient resources. The rule is checked against the current device mode and queue configuration. The flow rule may also optionally be validated against existing flow rules and device resources. This function has no effect on the target device.

The returned value is guaranteed to remain valid only as long as no successful calls to rte_flow_create() or rte_flow_destroy() are made in the meantime and no device parameter affecting flow rules in any way are modified, due to possible collisions or resource limitations (although in such cases EINVAL should not be returned).

Parameters
port_idPort identifier of Ethernet device.
[in]attrFlow rule attributes.
[in]patternPattern specification (list terminated by the END pattern item).
[in]actionsAssociated actions (list terminated by the END action).
[out]errorPerform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.
Returns
0 if flow rule is valid and can be created. A negative errno value otherwise (rte_errno is also set), the following errors are defined:

-ENOSYS: underlying device does not support this functionality.

-EIO: underlying device is removed.

-EINVAL: unknown or invalid rule specification.

-ENOTSUP: valid but unsupported rule specification (e.g. partial bit-masks are unsupported).

-EEXIST: collision with an existing rule. Only returned if device supports flow rule collision checking and there was a flow rule collision. Not receiving this return code is no guarantee that creating the rule will not fail due to a collision.

-ENOMEM: not enough memory to execute the function, or if the device supports resource validation, resource limitation on the device.

-EBUSY: action cannot be performed due to busy device resources, may succeed if the affected queues or even the entire port are in a stopped state (see rte_eth_dev_rx_queue_stop() and rte_eth_dev_stop()).

Examples:
examples/flow_filtering/flow_blocks.c, examples/ipsec-secgw/flow.c, examples/ipsec-secgw/ipsec-secgw.c, examples/ipsec-secgw/ipsec.c, and examples/l2fwd-macsec/main.c.

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

Parameters
port_idPort identifier of Ethernet device.
[in]attrFlow rule attributes.
[in]patternPattern specification (list terminated by the END pattern item).
[in]actionsAssociated actions (list terminated by the END action).
[out]errorPerform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.
Returns
A valid handle in case of success, NULL otherwise and rte_errno is set to the positive version of one of the error codes defined for rte_flow_validate().
Examples:
examples/flow_filtering/flow_blocks.c, examples/ipsec-secgw/flow.c, examples/ipsec-secgw/ipsec-secgw.c, examples/ipsec-secgw/ipsec.c, and examples/l2fwd-macsec/main.c.

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

Failure to destroy a flow rule handle may occur when other flow rules depend on it, and destroying it would result in an inconsistent state.

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

Parameters
port_idPort identifier of Ethernet device.
flowFlow rule handle to destroy.
[out]errorPerform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.
Returns
0 on success, a negative errno value otherwise and rte_errno is set.
Examples:
examples/ipsec-secgw/ipsec-secgw.c, and examples/l2fwd-macsec/main.c.

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

Parameters
port_idPort identifier of Ethernet device.
flowFlow rule handle to update.
[in]actionsAssociated actions (list terminated by the END action).
[out]errorPerform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.
Returns
0 on success, a negative errno value otherwise and rte_errno is set.

◆ rte_flow_flush()

int rte_flow_flush ( uint16_t  port_id,
struct rte_flow_error error 
)

Destroy all flow rules associated with a port.

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.

Parameters
port_idPort identifier of Ethernet device.
[out]errorPerform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.
Returns
0 on success, a negative errno value otherwise and rte_errno is set.
Examples:
examples/flow_filtering/main.c.

◆ 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 function allows retrieving flow-specific data such as counters. Data is gathered by special actions which must be present in the flow rule definition.

See also
RTE_FLOW_ACTION_TYPE_COUNT
Parameters
port_idPort identifier of Ethernet device.
flowFlow rule handle to query.
actionAction definition as defined in original flow rule.
[in,out]dataPointer to storage for the associated query data type.
[out]errorPerform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.
Returns
0 on success, a negative errno value otherwise and rte_errno is set.
Examples:
examples/ipsec-secgw/flow.c.

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

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 allows PMDs to safely reuse resources otherwise assigned to handle the remaining traffic, such as global RSS configuration settings, VLAN filters, MAC address entries, legacy filter API rules and so on in order to expand the set of possible flow rule types.

Calling this function as soon as possible after device initialization, ideally before the first call to rte_eth_dev_configure(), is recommended to avoid possible failures due to conflicting settings.

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

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

  • Toggling promiscuous mode.
  • Toggling allmulticast mode.
  • Configuring MAC addresses.
  • Configuring multicast addresses.
  • Configuring VLAN filters.
  • Configuring Rx filters through the legacy API (e.g. FDIR).
  • Configuring global RSS settings.
Parameters
port_idPort identifier of Ethernet device.
setNonzero to enter isolated mode, attempt to leave it otherwise.
[out]errorPerform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.
Returns
0 on success, a negative errno value otherwise and rte_errno is set.

◆ rte_flow_error_set()

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

Initialize flow error structure.

Parameters
[out]errorPointer to flow error structure (may be NULL).
codeRelated error code (rte_errno).
typeCause field and error types.
causeObject responsible for the error.
messageHuman-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 is deprecated due to its lack of flexibility and reliance on a type unusable with C++ programs (struct rte_flow_desc).

Parameters
[in]fdFlow rule description.
[in]lenTotal size of allocated data for the flow description.
[in]attrFlow rule attributes.
[in]itemsPattern specification (list terminated by the END pattern item).
[in]actionsAssociated actions (list terminated by the END action).
Returns
If len is greater or equal to the size of the flow, the total size of the flow description and its data. If len is lower than the size of the flow, the number of bytes that would have been written to desc had it been sufficient. Nothing is written.

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

This function performs conversion of various flow API objects to a pre-allocated destination buffer. See enum rte_flow_conv_op for possible operations and details about each of them.

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

  • If size is 0, dst may be a NULL pointer, otherwise dst must be non-NULL.
  • If positive, the returned value represents the number of bytes needed to store the conversion of src to dst according to op regardless of the size parameter.
  • Since no more than size bytes can be written to dst, output is truncated and may be inconsistent when the returned value is larger than that.
  • In case of conversion error, a negative error code is returned and dst contents are unspecified.
Parameters
opOperation to perform, related to the object type of dst.
[out]dstDestination buffer address. Must be suitably aligned by the caller.
sizeDestination buffer size in bytes.
[in]srcSource object to copy. Depending on op, its type may differ from that of dst.
[out]errorPerform verbose error reporting if not NULL. Initialized in case of error only.
Returns
The number of bytes required to convert src to dst on success, a negative errno value otherwise and rte_errno is set.
See also
rte_flow_conv_op

◆ rte_flow_get_aged_flows()

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

Get aged-out flows of a given port.

RTE_ETH_EVENT_FLOW_AGED event will be triggered when at least one new aged out flow was detected after the last call to rte_flow_get_aged_flows. This function can be called to get the aged flows asynchronously from the event callback or synchronously regardless the event. This is not safe to call rte_flow_get_aged_flows function with other flow functions from multiple threads simultaneously.

Parameters
port_idPort identifier of Ethernet device.
[in,out]contextsThe address of an array of pointers to the aged-out flows contexts.
[in]nb_contextsThe length of context array pointers.
[out]errorPerform verbose error reporting if not NULL. Initialized in case of error only.
Returns
if nb_contexts is 0, return the amount of all aged contexts. if nb_contexts is not 0 , return the amount of aged flows reported in the context array, otherwise negative errno value.
See also
rte_flow_action_age
RTE_ETH_EVENT_FLOW_AGED

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

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

If application configure port attribute with RTE_FLOW_PORT_FLAG_STRICT_QUEUE, there is no RTE_ETH_EVENT_FLOW_AGED event and this function must be called to get the aged flows synchronously.

If application configure port attribute without RTE_FLOW_PORT_FLAG_STRICT_QUEUE, RTE_ETH_EVENT_FLOW_AGED event will be triggered at least one new aged out flow was detected on any flow queue after the last call to rte_flow_get_q_aged_flows. In addition, the queue_id will be ignored. This function can be called to get the aged flows asynchronously from the event callback or synchronously regardless the event.

Parameters
[in]port_idPort identifier of Ethernet device.
[in]queue_idFlow queue to query. Ignored when RTE_FLOW_PORT_FLAG_STRICT_QUEUE not set.
[in,out]contextsThe address of an array of pointers to the aged-out flows contexts.
[in]nb_contextsThe length of context array pointers.
[out]errorPerform verbose error reporting if not NULL. Initialized in case of error only.
Returns
if nb_contexts is 0, return the amount of all aged contexts. if nb_contexts is not 0 , return the amount of aged flows reported in the context array, otherwise negative errno value.
See also
rte_flow_action_age
RTE_ETH_EVENT_FLOW_AGED
rte_flow_port_flag

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

Create an indirect action object that can be used in flow rules via its handle. The created object handle has single state and configuration across all the flow rules using it.

Parameters
[in]port_idThe port identifier of the Ethernet device.
[in]confAction configuration for the indirect action object creation.
[in]actionSpecific configuration of the indirect action object.
[out]errorPerform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.
Returns
A valid handle in case of success, NULL otherwise and rte_errno is set to one of the error codes defined:
  • (ENODEV) if port_id invalid.
  • (ENOSYS) if underlying device does not support this functionality.
  • (EIO) if underlying device is removed.
  • (EINVAL) if action invalid.
  • (ENOTSUP) if action valid but unsupported.

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

Destroy indirect action by handle.

Parameters
[in]port_idThe port identifier of the Ethernet device.
[in]handleHandle for the indirect action object to be destroyed.
[out]errorPerform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.
Returns
  • (0) if success.
  • (-ENODEV) if port_id invalid.
  • (-ENOSYS) if underlying device does not support this functionality.
  • (-EIO) if underlying device is removed.
  • (-ENOENT) if action pointed by action handle was not found.
  • (-EBUSY) if action pointed by action handle still used by some rules rte_errno is also set.

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

Update in-place the action configuration and / or state pointed by action handle with the configuration provided as update argument. The update of the action configuration effects all flow rules reusing the action via handle. The update general pointer provides the ability of partial updating.

Parameters
[in]port_idThe port identifier of the Ethernet device.
[in]handleHandle for the indirect action object to be updated.
[in]updateUpdate profile specification used to modify the action pointed by handle. update could be with the same type of the immediate action corresponding to the handle argument when creating, or a wrapper structure includes action configuration to be updated and bit fields to indicate the member of fields inside the action to update.
[out]errorPerform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.
Returns
  • (0) if success.
  • (-ENODEV) if port_id invalid.
  • (-ENOSYS) if underlying device does not support this functionality.
  • (-EIO) if underlying device is removed.
  • (-EINVAL) if update invalid.
  • (-ENOTSUP) if update valid but unsupported.
  • (-ENOENT) if indirect action object pointed by handle was not found. rte_errno is also set.

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

Query the direct action by corresponding indirect action object handle.

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.

See also
RTE_FLOW_ACTION_TYPE_COUNT
Parameters
port_idPort identifier of Ethernet device.
[in]handleHandle for the action object to query.
[in,out]dataPointer to storage for the associated query data type.
[out]errorPerform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.
Returns
0 on success, a negative errno value otherwise and rte_errno is set.

◆ rte_flow_tunnel_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. Sample usage: actions vxlan_decap / tunnel-decap-set(tunnel properties) / jump group 0 / end

Parameters
port_idPort identifier of Ethernet device.
[in]tunnelTunnel properties.
[out]actionsArray of actions to be allocated by the PMD. This array should be concatenated with the actions array provided to rte_flow_create.
[out]num_of_actionsNumber of actions allocated.
[out]errorPerform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.
Returns
0 on success, a negative errno value otherwise and rte_errno is set.

◆ rte_flow_tunnel_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: pattern tunnel-match(tunnel properties) / outer-header-matches / inner-header-matches / end

Parameters
port_idPort identifier of Ethernet device.
[in]tunnelTunnel properties.
[out]itemsArray of items to be allocated by the PMD. This array should be concatenated with the items array provided to rte_flow_create.
[out]num_of_itemsNumber of items allocated.
[out]errorPerform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.
Returns
0 on success, a negative errno value otherwise and rte_errno is set.

◆ rte_flow_restore_info_dynflag()

__rte_experimental uint64_t rte_flow_restore_info_dynflag ( void  )

On reception of a mbuf from HW, a call to rte_flow_get_restore_info() may be required to retrieve some metadata. This function returns the associated mbuf ol_flags.

Note: the dynamic flag is registered during a call to rte_eth_rx_metadata_negotiate() with RTE_ETH_RX_METADATA_TUNNEL_ID.

Returns
The offload flag indicating 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.

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

See also
rte_eth_rx_metadata_negotiate()
RTE_ETH_RX_METADATA_TUNNEL_ID
Parameters
port_idPort identifier of Ethernet device.
[in]mMbuf struct.
[out]infoRestore information. Upon success contains the HW state.
[out]errorPerform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.
Returns
0 on success, a negative errno value otherwise and rte_errno is set.

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

Parameters
port_idPort identifier of Ethernet device.
[in]actionsArray of actions to be released.
[in]num_of_actionsNumber of elements in actions array.
[out]errorPerform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.
Returns
0 on success, a negative errno value otherwise and rte_errno is set.

◆ rte_flow_tunnel_item_release()

__rte_experimental int rte_flow_tunnel_item_release ( uint16_t  port_id,
struct rte_flow_item items,
uint32_t  num_of_items,
struct rte_flow_error error 
)

Release the item array as allocated by rte_flow_tunnel_match.

Parameters
port_idPort identifier of Ethernet device.
[in]itemsArray of items to be released.
[in]num_of_itemsNumber of elements in item array.
[out]errorPerform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.
Returns
0 on success, a negative errno value otherwise and rte_errno is set.

◆ rte_flow_pick_transfer_proxy()

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

Get a proxy port to manage "transfer" flows.

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.

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

Note
If the PMD serving port_id doesn't have the corresponding method implemented, the API will return port_id via proxy_port_id.
Parameters
port_idIndicates the port to get a "proxy" for
[out]proxy_port_idIndicates the "proxy" port
[out]errorIf not NULL, allows the PMD to provide verbose report in case of error
Returns
0 on success, a negative error code otherwise

◆ rte_flow_flex_item_create()

__rte_experimental struct rte_flow_item_flex_handle* rte_flow_flex_item_create ( uint16_t  port_id,
const struct rte_flow_item_flex_conf conf,
struct rte_flow_error error 
)
Warning
EXPERIMENTAL: this API may change without prior notice.

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

Parameters
port_idPort identifier of Ethernet device.
[in]confItem configuration.
[out]errorPerform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.
Returns
Non-NULL opaque pointer on success, NULL otherwise and rte_errno is set.

◆ rte_flow_flex_item_release()

__rte_experimental int rte_flow_flex_item_release ( uint16_t  port_id,
const struct rte_flow_item_flex_handle *  handle,
struct rte_flow_error error 
)

Release the flex item on the specified Ethernet device.

Parameters
port_idPort identifier of Ethernet device.
[in]handleHandle of the item existing on the specified device.
[out]errorPerform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.
Returns
0 on success, a negative errno value otherwise and rte_errno is set.

◆ rte_flow_info_get()

__rte_experimental int rte_flow_info_get ( uint16_t  port_id,
struct rte_flow_port_info port_info,
struct rte_flow_queue_info queue_info,
struct rte_flow_error error 
)
Warning
EXPERIMENTAL: this API may change without prior notice.

Get information about flow engine resources.

Parameters
port_idPort identifier of Ethernet device.
[out]port_infoA pointer to a structure of type rte_flow_port_info to be filled with the resources information of the port.
[out]queue_infoA pointer to a structure of type rte_flow_queue_info to be filled with the asynchronous queues information.
[out]errorPerform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.
Returns
0 on success, a negative errno value otherwise and rte_errno is set.

◆ rte_flow_configure()

__rte_experimental int rte_flow_configure ( uint16_t  port_id,
const struct rte_flow_port_attr port_attr,
uint16_t  nb_queue,
const struct rte_flow_queue_attr queue_attr[],
struct rte_flow_error error 
)
Warning
EXPERIMENTAL: this API may change without prior notice.

Configure the port's flow API engine.

This API can only be invoked before the application starts using the rest of the flow library functions.

The API can be invoked multiple times to change the settings. The port, however, may reject changes and keep the old config.

Parameters in configuration attributes must not exceed numbers of resources returned by the rte_flow_info_get API.

Parameters
port_idPort identifier of Ethernet device.
[in]port_attrPort configuration attributes.
[in]nb_queueNumber of flow queues to be configured.
[in]queue_attrArray that holds attributes for each flow queue. Number of elements is set in port_attr.nb_queues.
[out]errorPerform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.
Returns
0 on success, a negative errno value otherwise and rte_errno is set.

◆ rte_flow_pattern_template_create()

__rte_experimental struct rte_flow_pattern_template* rte_flow_pattern_template_create ( uint16_t  port_id,
const struct rte_flow_pattern_template_attr template_attr,
const struct rte_flow_item  pattern[],
struct rte_flow_error error 
)
Warning
EXPERIMENTAL: this API may change without prior notice.

Create flow pattern template.

The pattern template defines common matching fields without values. 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.

Parameters
port_idPort identifier of Ethernet device.
[in]template_attrPattern template attributes.
[in]patternPattern specification (list terminated by the END pattern item). The spec member of an item is not used unless the end member is used.
[out]errorPerform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.
Returns
Handle on success, NULL otherwise and rte_errno is set.

◆ rte_flow_pattern_template_destroy()

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

Destroy flow pattern template.

This function may be called only when there are no more tables referencing this template.

Parameters
port_idPort identifier of Ethernet device.
[in]pattern_templateHandle of the template to be destroyed.
[out]errorPerform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.
Returns
0 on success, a negative errno value otherwise and rte_errno is set.

◆ rte_flow_actions_template_create()

__rte_experimental struct rte_flow_actions_template* rte_flow_actions_template_create ( uint16_t  port_id,
const struct rte_flow_actions_template_attr template_attr,
const struct rte_flow_action  actions[],
const struct rte_flow_action  masks[],
struct rte_flow_error error 
)
Warning
EXPERIMENTAL: this API may change without prior notice.

Create flow actions template.

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

Parameters
port_idPort identifier of Ethernet device.
[in]template_attrTemplate attributes.
[in]actionsAssociated actions (list terminated by the END action). The spec member is only used if masks spec is non-zero.
[in]masksList of actions that marks which of the action's member is constant. A mask has the same format as the corresponding action. If the action field in masks is not 0, the corresponding value in an action from actions will be the part of the template and used in all flow rules. The order of actions in masks is the same as in actions. In case of indirect actions present in actions, the actual action type should be present in mask.
[out]errorPerform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.
Returns
Handle on success, NULL otherwise and rte_errno is set.

◆ rte_flow_actions_template_destroy()

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

Destroy flow actions template.

This function may be called only when there are no more tables referencing this template.

Parameters
port_idPort identifier of Ethernet device.
[in]actions_templateHandle to the template to be destroyed.
[out]errorPerform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.
Returns
0 on success, a negative errno value otherwise and rte_errno is set.

◆ rte_flow_template_table_resizable()

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

Query whether a table can be resized.

Parameters
port_idPort identifier of Ethernet device.
tbl_attrTemplate 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.

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.

Parameters
port_idPort identifier of Ethernet device.
[in]table_attrTemplate table attributes.
[in]pattern_templatesArray of pattern templates to be used in this table.
[in]nb_pattern_templatesThe number of pattern templates in the pattern_templates array.
[in]actions_templatesArray of actions templates to be used in this table.
[in]nb_actions_templatesThe number of actions templates in the actions_templates array.
[out]errorPerform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.
Returns
Handle on success, NULL otherwise and rte_errno is set.

◆ rte_flow_template_table_destroy()

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

Destroy flow template table.

This function may be called only when there are no more flow rules referencing this table.

Parameters
port_idPort identifier of Ethernet device.
[in]template_tableHandle to the table to be destroyed.
[out]errorPerform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.
Returns
0 on success, a negative errno value otherwise and rte_errno is set.

◆ rte_flow_group_set_miss_actions()

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

Set group miss actions.

Parameters
port_idPort identifier of Ethernet device.
group_idIdentifier of a group to set miss actions for.
attrGroup attributes.
actionsList of group miss actions.
[out]errorPerform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.
Returns
0 on success, a negative errno value otherwise and rte_errno is set.

◆ rte_flow_async_create()

__rte_experimental struct rte_flow* rte_flow_async_create ( uint16_t  port_id,
uint32_t  queue_id,
const struct rte_flow_op_attr op_attr,
struct rte_flow_template_table *  template_table,
const struct rte_flow_item  pattern[],
uint8_t  pattern_template_index,
const struct rte_flow_action  actions[],
uint8_t  actions_template_index,
void *  user_data,
struct rte_flow_error error 
)
Warning
EXPERIMENTAL: this API may change without prior notice.

Enqueue rule creation operation.

Parameters
port_idPort identifier of Ethernet device.
queue_idFlow queue used to insert the rule.
[in]op_attrRule creation operation attributes.
[in]template_tableTemplate table to select templates from.
[in]patternList of pattern items to be used. The list order should match the order in the pattern template. The spec is the only relevant member of the item that is being used.
[in]pattern_template_indexPattern template index in the table.
[in]actionsList of actions to be used. The list order should match the order in the actions template.
[in]actions_template_indexActions template index in the table.
[in]user_dataThe user data that will be returned on the completion events.
[out]errorPerform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.
Returns
Handle on success, NULL otherwise and rte_errno is set. The rule handle doesn't mean that the rule has been populated. Only completion result indicates that if 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 
)
Warning
EXPERIMENTAL: this API may change without prior notice.

Enqueue rule creation operation.

Parameters
port_idPort identifier of Ethernet device.
queue_idFlow queue used to insert the rule.
[in]op_attrRule creation operation attributes.
[in]template_tableTemplate table to select templates from.
[in]rule_indexRule index in the table.
[in]actionsList of actions to be used. The list order should match the order in the actions template.
[in]actions_template_indexActions template index in the table.
[in]user_dataThe user data that will be returned on the completion events.
[out]errorPerform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.
Returns
Handle on success, NULL otherwise and rte_errno is set. The rule handle doesn't mean that the rule has been populated. Only 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 
)
Warning
EXPERIMENTAL: this API may change without prior notice.

Enqueue rule destruction operation.

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.

Parameters
port_idPort identifier of Ethernet device.
queue_idFlow queue which is used to destroy the rule. This must match the queue on which the rule was created.
[in]op_attrRule destruction operation attributes.
[in]flowFlow handle to be destroyed.
[in]user_dataThe user data that will be returned on the completion events.
[out]errorPerform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.
Returns
0 on success, a negative errno value otherwise and rte_errno is set.

◆ rte_flow_async_actions_update()

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

Enqueue rule update operation.

Parameters
port_idPort identifier of Ethernet device.
queue_idFlow queue used to insert the rule.
[in]op_attrRule creation operation attributes.
[in]flowFlow rule to be updated.
[in]actionsList of actions to be used. The list order should match the order in the actions template.
[in]actions_template_indexActions template index in the table.
[in]user_dataThe user data that will be returned on the completion events.
[out]errorPerform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.
Returns
0 on success, a negative errno value otherwise and rte_errno is set.

◆ rte_flow_push()

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

Push all internally stored rules to the HW. Postponed rules are rules that were inserted with the postpone flag set. 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.

Parameters
port_idPort identifier of Ethernet device.
queue_idFlow queue to be pushed.
[out]errorPerform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.
Returns
0 on success, a negative errno value otherwise and rte_errno is set.

◆ rte_flow_pull()

__rte_experimental int rte_flow_pull ( uint16_t  port_id,
uint32_t  queue_id,
struct rte_flow_op_result  res[],
uint16_t  n_res,
struct rte_flow_error error 
)
Warning
EXPERIMENTAL: this API may change without prior notice.

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

Parameters
port_idPort identifier of Ethernet device.
queue_idFlow queue which is used to pull the operation.
[out]resArray of results that will be set.
[in]n_resMaximum number of results that can be returned. This value is equal to the size of the res array.
[out]errorPerform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.
Returns
Number of results that were pulled, a negative errno value otherwise and rte_errno is set.

◆ rte_flow_async_action_handle_create()

__rte_experimental struct rte_flow_action_handle* rte_flow_async_action_handle_create ( uint16_t  port_id,
uint32_t  queue_id,
const struct rte_flow_op_attr op_attr,
const struct rte_flow_indir_action_conf indir_action_conf,
const struct rte_flow_action action,
void *  user_data,
struct rte_flow_error error 
)
Warning
EXPERIMENTAL: this API may change without prior notice.

Enqueue indirect action creation operation.

See also
rte_flow_action_handle_create
Parameters
[in]port_idPort identifier of Ethernet device.
[in]queue_idFlow queue which is used to create the rule.
[in]op_attrIndirect action creation operation attributes.
[in]indir_action_confAction configuration for the indirect action object creation.
[in]actionSpecific configuration of the indirect action object.
[in]user_dataThe user data that will be returned on the completion events.
[out]errorPerform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.
Returns
A valid handle in case of success, NULL otherwise and rte_errno is set.

◆ rte_flow_async_action_handle_destroy()

__rte_experimental int rte_flow_async_action_handle_destroy ( uint16_t  port_id,
uint32_t  queue_id,
const struct rte_flow_op_attr op_attr,
struct rte_flow_action_handle *  action_handle,
void *  user_data,
struct rte_flow_error error 
)
Warning
EXPERIMENTAL: this API may change without prior notice.

Enqueue indirect action destruction operation. The destroy queue must be the same as the queue on which the action was created.

Parameters
[in]port_idPort identifier of Ethernet device.
[in]queue_idFlow queue which is used to destroy the rule.
[in]op_attrIndirect action destruction operation attributes.
[in]action_handleHandle for the indirect action object to be destroyed.
[in]user_dataThe user data that will be returned on the completion events.
[out]errorPerform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.
Returns
0 on success, a negative errno value otherwise and rte_errno is set.

◆ rte_flow_async_action_handle_update()

__rte_experimental int rte_flow_async_action_handle_update ( uint16_t  port_id,
uint32_t  queue_id,
const struct rte_flow_op_attr op_attr,
struct rte_flow_action_handle *  action_handle,
const void *  update,
void *  user_data,
struct rte_flow_error error 
)
Warning
EXPERIMENTAL: this API may change without prior notice.

Enqueue indirect action update operation.

See also
rte_flow_action_handle_create
Parameters
[in]port_idPort identifier of Ethernet device.
[in]queue_idFlow queue which is used to update the rule.
[in]op_attrIndirect action update operation attributes.
[in]action_handleHandle for the indirect action object to be updated.
[in]updateUpdate profile specification used to modify the action pointed by handle. update could be with the same type of the immediate action corresponding to the handle argument when creating, or a wrapper structure includes action configuration to be updated and bit fields to indicate the member of fields inside the action to update.
[in]user_dataThe user data that will be returned on the completion events.
[out]errorPerform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.
Returns
0 on success, a negative errno value otherwise and rte_errno is set.

◆ rte_flow_async_action_handle_query()

__rte_experimental int rte_flow_async_action_handle_query ( uint16_t  port_id,
uint32_t  queue_id,
const struct rte_flow_op_attr op_attr,
const struct rte_flow_action_handle *  action_handle,
void *  data,
void *  user_data,
struct rte_flow_error error 
)
Warning
EXPERIMENTAL: this API may change without prior notice.

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_idPort identifier of Ethernet device.
[in]queue_idFlow queue which is used to query the action.
[in]op_attrIndirect action update operation attributes.
[in]action_handleHandle for the action object to query.
[in,out]dataPointer to storage for the associated query data type. The out data will be available only when completion event returns from rte_flow_pull.
[in]user_dataThe user data that will be returned on the completion events.
[out]errorPerform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.
Returns
0 on success, a negative errno value otherwise and rte_errno is set.

◆ rte_flow_action_handle_query_update()

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

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

Parameters
port_idPort identifier of Ethernet device.
handleHandle for the indirect action object to be updated.
updateIf not NULL, update profile specification used to modify the action pointed by handle.
queryIf not NULL pointer to storage for the associated query data type.
modeOperational mode.
errorPerform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.
Returns
0 on success, a negative errno value otherwise and rte_errno is set.
  • (-ENODEV) if port_id invalid.
  • (-ENOTSUP) if underlying device does not support this functionality.
  • (-EINVAL) if handle or mode invalid or both query and update are NULL.

◆ rte_flow_async_action_handle_query_update()

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

Enqueue async indirect flow action query and/or update

Parameters
port_idPort identifier of Ethernet device.
queue_idFlow queue which is used to update the rule.
attrIndirect action update operation attributes.
handleHandle for the indirect action object to be updated.
updateIf not NULL, update profile specification used to modify the action pointed by handle.
queryIf not NULL, pointer to storage for the associated query data type. Query result returned on async completion event.
modeOperational mode.
user_dataThe user data that will be returned on async completion event.
errorPerform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.
Returns
0 on success, a negative errno value otherwise and rte_errno is set.
  • (-ENODEV) if port_id invalid.
  • (-ENOTSUP) if underlying device does not support this functionality.
  • (-EINVAL) if handle or mode invalid or both update and query are NULL.

◆ rte_flow_action_list_handle_create()

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

Create an indirect flow action object from flow actions list. The object is identified by a unique handle. The handle has single state and configuration across all the flow rules using it.

Parameters
[in]port_idThe port identifier of the Ethernet device.
[in]confAction configuration for the indirect action list creation.
[in]actionsSpecific configuration of the indirect action lists.
[out]errorPerform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.
Returns
A valid handle in case of success, NULL otherwise and rte_errno is set to one of the error codes defined:
  • (-ENODEV) if port_id invalid.
  • (-ENOSYS) if underlying device does not support this functionality.
  • (-EIO) if underlying device is removed.
  • (-EINVAL) if actions list invalid.
  • (-ENOTSUP) if action list element valid but unsupported.

◆ rte_flow_async_action_list_handle_create()

__rte_experimental struct rte_flow_action_list_handle* rte_flow_async_action_list_handle_create ( uint16_t  port_id,
uint32_t  queue_id,
const struct rte_flow_op_attr attr,
const struct rte_flow_indir_action_conf conf,
const struct rte_flow_action actions,
void *  user_data,
struct rte_flow_error error 
)
Warning
EXPERIMENTAL: this API may change without prior notice.

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
[in]port_idThe port identifier of the Ethernet device.
[in]queue_idFlow queue which is used to update the rule.
[in]attrIndirect action update operation attributes.
[in]confAction configuration for the indirect action list creation.
[in]actionsSpecific configuration of the indirect action list.
[in]user_dataThe user data that will be returned on async completion event.
[out]errorPerform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.
Returns
A valid handle in case of success, NULL otherwise and rte_errno is set to one of the error codes defined:
  • (-ENODEV) if port_id invalid.
  • (-ENOSYS) if underlying device does not support this functionality.
  • (-EIO) if underlying device is removed.
  • (-EINVAL) if actions list invalid.
  • (-ENOTSUP) if action list element valid but unsupported.

◆ rte_flow_action_list_handle_destroy()

__rte_experimental int rte_flow_action_list_handle_destroy ( uint16_t  port_id,
struct rte_flow_action_list_handle *  handle,
struct rte_flow_error error 
)
Warning
EXPERIMENTAL: this API may change without prior notice.

Destroy indirect actions list by handle.

Parameters
[in]port_idThe port identifier of the Ethernet device.
[in]handleHandle for the indirect actions list to be destroyed.
[out]errorPerform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.
Returns
  • (0) if success.
  • (-ENODEV) if port_id invalid.
  • (-ENOSYS) if underlying device does not support this functionality.
  • (-EIO) if underlying device is removed.
  • (-ENOENT) if actions list pointed by action handle was not found.
  • (-EBUSY) if actions list pointed by action handle still used

◆ rte_flow_async_action_list_handle_destroy()

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

Enqueue indirect action list destruction operation. The destroy queue must be the same as the queue on which the action was created.

Parameters
[in]port_idPort identifier of Ethernet device.
[in]queue_idFlow queue which is used to destroy the rule.
[in]op_attrIndirect action destruction operation attributes.
[in]handleHandle for the indirect action object to be destroyed.
[in]user_dataThe user data that will be returned on the completion events.
[out]errorPerform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.
Returns
  • (0) if success.
  • (-ENODEV) if port_id invalid.
  • (-ENOSYS) if underlying device does not support this functionality.
  • (-EIO) if underlying device is removed.
  • (-ENOENT) if actions list pointed by action handle was not found.
  • (-EBUSY) if actions list pointed by action handle still used

◆ rte_flow_action_list_handle_query_update()

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

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

Parameters
port_idPort identifier of Ethernet device.
handleHandle for the indirect actions list object to be updated.
updateIf the action list handle was created from n actions A1 / A2 ... An / END non-NULL update parameter is an array [U1, U2, ... Un] where Ui points to Ai update context or NULL if Ai should not be updated.
queryIf the action list handle was created from n actions A1 / A2 ... An / END non-NULL query parameter is an array [Q1, Q2, ... Qn] where Qi points to Ai query context or NULL if Ai should not be queried.
modeOperational mode.
errorPerform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.
Returns
  • (0) if success.
  • (-ENODEV) if port_id invalid.
  • (-ENOTSUP) if underlying device does not support this functionality.
  • (-EINVAL) if handle or mode invalid or both query and update are NULL.

◆ rte_flow_async_action_list_handle_query_update()

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

Enqueue async indirect flow actions list query and/or update If both query and update not NULL, the function atomically queries and updates indirect action. Query and update are carried in order specified in the mode parameter. If ether query or update is NULL, the function executes complementing operation.

Parameters
port_idPort identifier of Ethernet device.
queue_idFlow queue which is used to update the rule.
attrIndirect action update operation attributes.
handleHandle for the indirect actions list object to be updated.
updateIf the action list handle was created from n actions A1 / A2 ... An / END non-NULL update parameter is an array [U1, U2, ... Un] where Ui points to Ai update context or NULL if Ai should not be updated.
queryIf the action list handle was created from n actions A1 / A2 ... An / END non-NULL query parameter is an array [Q1, Q2, ... Qn] where Qi points to Ai query context or NULL if Ai should not be queried. Query result returned on async completion event.
modeOperational mode.
user_dataThe user data that will be returned on async completion event.
errorPerform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.
Returns
  • (0) if success.
  • (-ENODEV) if port_id invalid.
  • (-ENOTSUP) if underlying device does not support this functionality.
  • (-EINVAL) if handle or mode invalid or both update and query are NULL.

◆ rte_flow_calc_table_hash()

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

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

Parameters
port_idPort identifier of Ethernet device.
tableThe table the SW wishes to simulate.
patternThe values to be used in the hash calculation.
pattern_template_indexThe pattern index in the table to be used for the calculation.
hashUsed to return the calculated hash.
errorPerform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.
Returns
  • (0) if success.
  • (-ENODEV) if port_id invalid.
  • (-ENOTSUP) if underlying device does not support this functionality.

◆ rte_flow_calc_encap_hash()

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

Simulate HW hash calculation that is done when an encap action is being used. This hash can be stored in tunnel outer header to improve packet distribution.

Parameters
[in]port_idPort identifier of Ethernet device.
[in]patternThe values to be used in the hash calculation.
[in]dest_fieldType of destination field for hash calculation.
[in]hash_lenThe length of the hash pointer in bytes. Should be according to dest_field.
[out]hashUsed to return the calculated hash. It will be written in network order, so hash[0] is the MSB. The number of bytes is based on the destination field type.
[out]errorPerform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.
Returns
  • (0) if success.
  • (-ENODEV) if port_id invalid.
  • (-ENOTSUP) if underlying device does not support this functionality.
  • (-EINVAL) if pattern doesn't hold enough information to calculate the hash or the dest is not supported.

◆ rte_flow_template_table_resize()

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

Update template table for new flow rules capacity.

Parameters
port_idPort identifier of Ethernet device.
tableTemplate table to modify.
nb_rulesNew flow rules capacity.
errorPerform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.
Returns
  • (0) if success.
  • (-ENODEV) if port_id invalid.
  • (-ENOTSUP) if underlying device does not support this functionality.
  • (-EINVAL) if table is not resizable or table resize to nb_rules is not supported or unrecoverable table error.

◆ rte_flow_async_update_resized()

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

Update rule for the new table configuration after table resize. Must be called for each rule created before table resize. If called for rule created after table resize returns success.

Parameters
port_idPort identifier of Ethernet device.
queueFlow queue for async operation.
attrAsync operation attributes.
ruleFlow rule to update.
user_dataThe user data that will be returned on async completion event.
errorPerform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.
Returns
  • (0) if success.
  • (-ENODEV) if port_id invalid.
  • (-ENOTSUP) if underlying device does not support this functionality.
  • (-EINVAL) if table was not resized. If rule cannot be updated after table resize, unrecoverable table error.

◆ rte_flow_template_table_resize_complete()

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

Resume normal operational mode after table was resized and table rules were updated for the new table configuration.

Parameters
port_idPort identifier of Ethernet device.
tableTemplate table that undergoing resize operation.
errorPerform verbose error reporting if not NULL. PMDs initialize this structure in case of error only.
Returns
  • (0) if success.
  • (-ENODEV) if port_id invalid.
  • (-ENOTSUP) if underlying device does not support this functionality.
  • (-EBUSY) if not all table rules were updated.
  • (-EINVAL) if table cannot complete table resize, unrecoverable error.

Variable Documentation

◆ rte_flow_item_quota_mask

const struct rte_flow_item_quota rte_flow_item_quota_mask
static
Initial value:
= {
.state = (enum rte_flow_quota_state)0xff
}
rte_flow_quota_state
Definition: rte_flow.h:734

Default mask for RTE_FLOW_ITEM_TYPE_QUOTA

Definition at line 752 of file rte_flow.h.

◆ rte_flow_item_higig2_hdr_mask

const struct rte_flow_item_higig2_hdr rte_flow_item_higig2_hdr_mask
static
Initial value:
= {
.hdr = {
.ppt1 = {
.classification = RTE_BE16(UINT16_MAX),
.vid = RTE_BE16(0xfff),
},
},
}

Default mask for RTE_FLOW_ITEM_TYPE_HIGIG2.

Definition at line 768 of file rte_flow.h.

◆ rte_flow_item_any_mask

const struct rte_flow_item_any rte_flow_item_any_mask
static
Initial value:
= {
.num = 0x00000000,
}

Default mask for RTE_FLOW_ITEM_TYPE_ANY.

Definition at line 795 of file rte_flow.h.

◆ rte_flow_item_port_id_mask

const struct rte_flow_item_port_id rte_flow_item_port_id_mask
static
Initial value:
= {
.id = 0xffffffff,
}

Default mask for RTE_FLOW_ITEM_TYPE_PORT_ID.

Definition at line 820 of file rte_flow.h.

◆ rte_flow_item_raw_mask

const struct rte_flow_item_raw rte_flow_item_raw_mask
static
Initial value:
= {
.relative = 1,
.search = 1,
.reserved = 0x3fffffff,
.offset = 0xffffffff,
.limit = 0xffff,
.length = 0xffff,
.pattern = NULL,
}

Default mask for RTE_FLOW_ITEM_TYPE_RAW.

Definition at line 855 of file rte_flow.h.

◆ rte_flow_item_eth_mask

const struct rte_flow_item_eth rte_flow_item_eth_mask
static
Initial value:
= {
.hdr.dst_addr.addr_bytes = "\xff\xff\xff\xff\xff\xff",
.hdr.src_addr.addr_bytes = "\xff\xff\xff\xff\xff\xff",
.hdr.ether_type = RTE_BE16(0x0000),
}

Default mask for RTE_FLOW_ITEM_TYPE_ETH.

Definition at line 902 of file rte_flow.h.

◆ rte_flow_item_vlan_mask

const struct rte_flow_item_vlan rte_flow_item_vlan_mask
static
Initial value:
= {
.hdr.vlan_tci = RTE_BE16(0x0fff),
.hdr.eth_proto = RTE_BE16(0x0000),
}

Default mask for RTE_FLOW_ITEM_TYPE_VLAN.

Definition at line 943 of file rte_flow.h.

◆ rte_flow_item_ipv4_mask

const struct rte_flow_item_ipv4 rte_flow_item_ipv4_mask
static
Initial value:
= {
.hdr = {
.src_addr = RTE_BE32(0xffffffff),
.dst_addr = RTE_BE32(0xffffffff),
},
}

Default mask for RTE_FLOW_ITEM_TYPE_IPV4.

Examples:
examples/ipsec-secgw/flow.c, and examples/ipsec-secgw/ipsec.c.

Definition at line 962 of file rte_flow.h.

◆ rte_flow_item_ipv6_mask

const struct rte_flow_item_ipv6 rte_flow_item_ipv6_mask
static
Initial value:
= {
.hdr = {
.src_addr =
"\xff\xff\xff\xff\xff\xff\xff\xff"
"\xff\xff\xff\xff\xff\xff\xff\xff",
.dst_addr =
"\xff\xff\xff\xff\xff\xff\xff\xff"
"\xff\xff\xff\xff\xff\xff\xff\xff",
},
}

Default mask for RTE_FLOW_ITEM_TYPE_IPV6.

Examples:
examples/ipsec-secgw/flow.c, and examples/ipsec-secgw/ipsec.c.

Definition at line 1003 of file rte_flow.h.

◆ rte_flow_item_icmp_mask

const struct rte_flow_item_icmp rte_flow_item_icmp_mask
static
Initial value:
= {
.hdr = {
.icmp_type = 0xff,
.icmp_code = 0xff,
},
}

Default mask for RTE_FLOW_ITEM_TYPE_ICMP.

Definition at line 1038 of file rte_flow.h.

◆ rte_flow_item_udp_mask

const struct rte_flow_item_udp rte_flow_item_udp_mask
static
Initial value:
= {
.hdr = {
.src_port = RTE_BE16(0xffff),
.dst_port = RTE_BE16(0xffff),
},
}

Default mask for RTE_FLOW_ITEM_TYPE_UDP.

Examples:
examples/ipsec-secgw/ipsec.c.

Definition at line 1057 of file rte_flow.h.

◆ rte_flow_item_tcp_mask

const struct rte_flow_item_tcp rte_flow_item_tcp_mask
static
Initial value:
= {
.hdr = {
.src_port = RTE_BE16(0xffff),
.dst_port = RTE_BE16(0xffff),
},
}

Default mask for RTE_FLOW_ITEM_TYPE_TCP.

Definition at line 1076 of file rte_flow.h.

◆ rte_flow_item_sctp_mask

const struct rte_flow_item_sctp rte_flow_item_sctp_mask
static
Initial value:
= {
.hdr = {
.src_port = RTE_BE16(0xffff),
.dst_port = RTE_BE16(0xffff),
},
}

Default mask for RTE_FLOW_ITEM_TYPE_SCTP.

Definition at line 1095 of file rte_flow.h.

◆ rte_flow_item_vxlan_mask

const struct rte_flow_item_vxlan rte_flow_item_vxlan_mask
static
Initial value:
= {
.hdr.vni = "\xff\xff\xff",
}

Default mask for RTE_FLOW_ITEM_TYPE_VXLAN.

Definition at line 1126 of file rte_flow.h.

◆ rte_flow_item_e_tag_mask

const struct rte_flow_item_e_tag rte_flow_item_e_tag_mask
static
Initial value:
= {
.rsvd_grp_ecid_b = RTE_BE16(0x3fff),
}

Default mask for RTE_FLOW_ITEM_TYPE_E_TAG.

Definition at line 1154 of file rte_flow.h.

◆ rte_flow_item_nvgre_mask

const struct rte_flow_item_nvgre rte_flow_item_nvgre_mask
static
Initial value:
= {
.tni = "\xff\xff\xff",
}

Default mask for RTE_FLOW_ITEM_TYPE_NVGRE.

Definition at line 1179 of file rte_flow.h.

◆ rte_flow_item_mpls_mask

const struct rte_flow_item_mpls rte_flow_item_mpls_mask
static
Initial value:
= {
.label_tc_s = "\xff\xff\xf0",
}

Default mask for RTE_FLOW_ITEM_TYPE_MPLS.

Definition at line 1199 of file rte_flow.h.

◆ rte_flow_item_gre_mask

const struct rte_flow_item_gre rte_flow_item_gre_mask
static
Initial value:
= {
.protocol = RTE_BE16(0xffff),
}

Default mask for RTE_FLOW_ITEM_TYPE_GRE.

Definition at line 1220 of file rte_flow.h.

◆ rte_flow_item_fuzzy_mask

const struct rte_flow_item_fuzzy rte_flow_item_fuzzy_mask
static
Initial value:
= {
.thresh = 0xffffffff,
}

Default mask for RTE_FLOW_ITEM_TYPE_FUZZY.

Definition at line 1268 of file rte_flow.h.

◆ rte_flow_item_gtp_mask

const struct rte_flow_item_gtp rte_flow_item_gtp_mask
static
Initial value:
= {
.hdr.teid = RTE_BE32(UINT32_MAX),
}

Default mask for RTE_FLOW_ITEM_TYPE_GTP.

Definition at line 1302 of file rte_flow.h.

◆ rte_flow_item_esp_mask

const struct rte_flow_item_esp rte_flow_item_esp_mask
static
Initial value:
= {
.hdr = {
.spi = RTE_BE32(0xffffffff),
},
}

Default mask for RTE_FLOW_ITEM_TYPE_ESP.

Examples:
examples/ipsec-secgw/ipsec.c.

Definition at line 1318 of file rte_flow.h.

◆ rte_flow_item_geneve_mask

const struct rte_flow_item_geneve rte_flow_item_geneve_mask
static
Initial value:
= {
.vni = "\xff\xff\xff",
}

Default mask for RTE_FLOW_ITEM_TYPE_GENEVE.

Definition at line 1343 of file rte_flow.h.

◆ rte_flow_item_vxlan_gpe_mask

const struct rte_flow_item_vxlan_gpe rte_flow_item_vxlan_gpe_mask
static
Initial value:
= {
.hdr.vni = "\xff\xff\xff",
}

Default mask for RTE_FLOW_ITEM_TYPE_VXLAN_GPE.

Definition at line 1372 of file rte_flow.h.

◆ rte_flow_item_arp_eth_ipv4_mask

const struct rte_flow_item_arp_eth_ipv4 rte_flow_item_arp_eth_ipv4_mask
static
Initial value:
= {
.hdr.arp_data.arp_sha.addr_bytes = "\xff\xff\xff\xff\xff\xff",
.hdr.arp_data.arp_sip = RTE_BE32(UINT32_MAX),
.hdr.arp_data.arp_tha.addr_bytes = "\xff\xff\xff\xff\xff\xff",
.hdr.arp_data.arp_tip = RTE_BE32(UINT32_MAX),
}

Default mask for RTE_FLOW_ITEM_TYPE_ARP_ETH_IPV4.

Definition at line 1406 of file rte_flow.h.

◆ rte_flow_item_ipv6_ext_mask

const struct rte_flow_item_ipv6_ext rte_flow_item_ipv6_ext_mask
static
Initial value:
= {
.next_hdr = 0xff,
}

Default mask for RTE_FLOW_ITEM_TYPE_IPV6_EXT.

Definition at line 1431 of file rte_flow.h.

◆ rte_flow_item_icmp6_mask

const struct rte_flow_item_icmp6 rte_flow_item_icmp6_mask
static
Initial value:
= {
.type = 0xff,
.code = 0xff,
}

Default mask for RTE_FLOW_ITEM_TYPE_ICMP6.

Definition at line 1463 of file rte_flow.h.

◆ rte_flow_item_icmp6_nd_ns_mask

const struct rte_flow_item_icmp6_nd_ns rte_flow_item_icmp6_nd_ns_mask
static
Initial value:
= {
.target_addr =
"\xff\xff\xff\xff\xff\xff\xff\xff"
"\xff\xff\xff\xff\xff\xff\xff\xff",
}

Default mask for RTE_FLOW_ITEM_TYPE_ICMP6_ND_NS.

Definition at line 1495 of file rte_flow.h.

◆ rte_flow_item_icmp6_nd_na_mask

const struct rte_flow_item_icmp6_nd_na rte_flow_item_icmp6_nd_na_mask
static
Initial value:
= {
.target_addr =
"\xff\xff\xff\xff\xff\xff\xff\xff"
"\xff\xff\xff\xff\xff\xff\xff\xff",
}

Default mask for RTE_FLOW_ITEM_TYPE_ICMP6_ND_NA.

Definition at line 1522 of file rte_flow.h.

◆ rte_flow_item_icmp6_nd_opt_mask

const struct rte_flow_item_icmp6_nd_opt rte_flow_item_icmp6_nd_opt_mask
static
Initial value:
= {
.type = 0xff,
}

Default mask for RTE_FLOW_ITEM_TYPE_ICMP6_ND_OPT.

Definition at line 1548 of file rte_flow.h.

◆ rte_flow_item_icmp6_nd_opt_sla_eth_mask

const struct rte_flow_item_icmp6_nd_opt_sla_eth rte_flow_item_icmp6_nd_opt_sla_eth_mask
static
Initial value:
= {
.sla.addr_bytes = "\xff\xff\xff\xff\xff\xff",
}

Default mask for RTE_FLOW_ITEM_TYPE_ICMP6_ND_OPT_SLA_ETH.

Definition at line 1573 of file rte_flow.h.

◆ rte_flow_item_icmp6_nd_opt_tla_eth_mask

const struct rte_flow_item_icmp6_nd_opt_tla_eth rte_flow_item_icmp6_nd_opt_tla_eth_mask
static
Initial value:
= {
.tla.addr_bytes = "\xff\xff\xff\xff\xff\xff",
}

Default mask for RTE_FLOW_ITEM_TYPE_ICMP6_ND_OPT_TLA_ETH.

Definition at line 1598 of file rte_flow.h.

◆ rte_flow_item_meta_mask

const struct rte_flow_item_meta rte_flow_item_meta_mask
static
Initial value:
= {
.data = UINT32_MAX,
}

Default mask for RTE_FLOW_ITEM_TYPE_META.

Definition at line 1620 of file rte_flow.h.

◆ rte_flow_item_gtp_psc_mask

const struct rte_flow_item_gtp_psc rte_flow_item_gtp_psc_mask
static
Initial value:
= {
.hdr.qfi = 0x3f,
}

Default mask for RTE_FLOW_ITEM_TYPE_GTP_PSC.

Definition at line 1637 of file rte_flow.h.

◆ rte_flow_item_pppoe_proto_id_mask

const struct rte_flow_item_pppoe_proto_id rte_flow_item_pppoe_proto_id_mask
static
Initial value:
= {
.proto_id = RTE_BE16(0xffff),
}

Default mask for RTE_FLOW_ITEM_TYPE_PPPOE_PROTO_ID.

Definition at line 1676 of file rte_flow.h.

◆ rte_flow_item_tag_mask

const struct rte_flow_item_tag rte_flow_item_tag_mask
static
Initial value:
= {
.data = 0xffffffff,
.index = 0xff,
}

Default mask for RTE_FLOW_ITEM_TYPE_TAG.

Definition at line 1696 of file rte_flow.h.

◆ rte_flow_item_l2tpv3oip_mask

const struct rte_flow_item_l2tpv3oip rte_flow_item_l2tpv3oip_mask
static
Initial value:
= {
.session_id = RTE_BE32(UINT32_MAX),
}

Default mask for RTE_FLOW_ITEM_TYPE_L2TPV3OIP.

Definition at line 1713 of file rte_flow.h.

◆ rte_flow_item_mark_mask

const struct rte_flow_item_mark rte_flow_item_mark_mask
static
Initial value:
= {
.id = 0xffffffff,
}

Default mask for RTE_FLOW_ITEM_TYPE_MARK.

Definition at line 1743 of file rte_flow.h.

◆ rte_flow_item_nsh_mask

const struct rte_flow_item_nsh rte_flow_item_nsh_mask
static
Initial value:
= {
.mdtype = 0xf,
.next_proto = 0xff,
.spi = 0xffffff,
.sindex = 0xff,
}

Default mask for RTE_FLOW_ITEM_TYPE_NSH.

Definition at line 1771 of file rte_flow.h.

◆ rte_flow_item_igmp_mask

const struct rte_flow_item_igmp rte_flow_item_igmp_mask
static
Initial value:
= {
.group_addr = 0xffffffff,
}

Default mask for RTE_FLOW_ITEM_TYPE_IGMP.

Definition at line 1796 of file rte_flow.h.

◆ rte_flow_item_ah_mask

const struct rte_flow_item_ah rte_flow_item_ah_mask
static
Initial value:
= {
.spi = 0xffffffff,
}

Default mask for RTE_FLOW_ITEM_TYPE_AH.

Definition at line 1819 of file rte_flow.h.

◆ rte_flow_item_pfcp_mask

const struct rte_flow_item_pfcp rte_flow_item_pfcp_mask
static
Initial value:
= {
.s_field = 0x01,
.seid = RTE_BE64(UINT64_C(0xffffffffffffffff)),
}

Default mask for RTE_FLOW_ITEM_TYPE_PFCP.

Definition at line 1841 of file rte_flow.h.

◆ rte_flow_item_ecpri_mask

const struct rte_flow_item_ecpri rte_flow_item_ecpri_mask
static
Initial value:
= {
.hdr = {
.common = {
.u32 = 0x0,
},
},
}

Default mask for RTE_FLOW_ITEM_TYPE_ECPRI.

Definition at line 1861 of file rte_flow.h.

◆ rte_flow_item_geneve_opt_mask

const struct rte_flow_item_geneve_opt rte_flow_item_geneve_opt_mask
static
Initial value:
= {
.option_type = 0xff,
}

Default mask for RTE_FLOW_ITEM_TYPE_GENEVE_OPT.

Definition at line 1885 of file rte_flow.h.

◆ rte_flow_item_conntrack_mask

const struct rte_flow_item_conntrack rte_flow_item_conntrack_mask
static
Initial value:
= {
.flags = 0xffffffff,
}

Default mask for RTE_FLOW_ITEM_TYPE_CONNTRACK.

Definition at line 1976 of file rte_flow.h.

◆ rte_flow_item_ethdev_mask

const struct rte_flow_item_ethdev rte_flow_item_ethdev_mask
static
Initial value:
= {
.port_id = 0xffff,
}

Default mask for items based on struct rte_flow_item_ethdev

Definition at line 1992 of file rte_flow.h.

◆ rte_flow_item_l2tpv2_mask

const struct rte_flow_item_l2tpv2 rte_flow_item_l2tpv2_mask
static
Initial value:
= {
.hdr = {
.common = {
.flags_version = RTE_BE16(0xcb0f),
},
},
}

Default mask for RTE_FLOW_ITEM_TYPE_L2TPV2.

Definition at line 2011 of file rte_flow.h.

◆ rte_flow_item_ppp_mask

const struct rte_flow_item_ppp rte_flow_item_ppp_mask
static
Initial value:
= {
.hdr = {
.addr = 0xff,
.ctrl = 0xff,
.proto_id = RTE_BE16(0xffff),
}
}

Default mask for RTE_FLOW_ITEM_TYPE_PPP.

Definition at line 2039 of file rte_flow.h.

◆ rte_flow_item_ib_bth_mask

const struct rte_flow_item_ib_bth rte_flow_item_ib_bth_mask
static
Initial value:
= {
.hdr = {
.opcode = 0xff,
.dst_qp = "\xff\xff\xff",
},
}

Default mask for RTE_FLOW_ITEM_TYPE_IB_BTH.

Definition at line 2059 of file rte_flow.h.

◆ rte_flow_item_random_mask

const struct rte_flow_item_random rte_flow_item_random_mask
static
Initial value:
= {
.value = UINT32_MAX,
}

Default mask for RTE_FLOW_ITEM_TYPE_RANDOM.

Definition at line 2081 of file rte_flow.h.

◆ rte_flow_item_meter_color_mask

const struct rte_flow_item_meter_color rte_flow_item_meter_color_mask
static
Initial value:
= {
.color = RTE_COLORS,
}

Default mask for RTE_FLOW_ITEM_TYPE_METER_COLOR.

Definition at line 2308 of file rte_flow.h.

◆ rte_flow_item_aggr_affinity_mask

const struct rte_flow_item_aggr_affinity rte_flow_item_aggr_affinity_mask
static
Initial value:
= {
.affinity = 0xff,
}

Default mask for RTE_FLOW_ITEM_TYPE_AGGR_AFFINITY.

Definition at line 2334 of file rte_flow.h.

◆ rte_flow_item_tx_queue_mask

const struct rte_flow_item_tx_queue rte_flow_item_tx_queue_mask
static
Initial value:
= {
.tx_queue = 0xffff,
}

Default mask for RTE_FLOW_ITEM_TX_QUEUE.

Definition at line 2353 of file rte_flow.h.

◆ rte_flow_item_ptype_mask

const struct rte_flow_item_ptype rte_flow_item_ptype_mask
static
Initial value:
= {
.packet_type = 0xffffffff,
}

Default mask for RTE_FLOW_ITEM_TYPE_PTYPE.

Definition at line 2370 of file rte_flow.h.