NVIDIA DOCA SDK Data Center on a Chip Framework Documentation
DOCA Flow
Collaboration diagram for DOCA Flow:

Modules

 Doca Flow Crypto
 
 Doca Flow CT
 
 Doca Flow Net
 
 DOCA Flow Tune Server
 

Data Structures

struct  doca_flow_resource_rss_cfg
 doca flow rss resource configuration More...
 
struct  doca_flow_meta
 doca flow meta data More...
 
struct  doca_flow_parser_meta
 doca flow parser meta data More...
 
struct  doca_flow_header_format
 doca flow packet format More...
 
struct  doca_flow_entropy_format
 doca flow header format for entropy More...
 
struct  doca_flow_match
 doca flow matcher information More...
 
struct  doca_flow_desc_field
 Action descriptor field. More...
 
struct  doca_flow_match_condition
 doca flow match condition information More...
 
struct  doca_flow_encap_action
 doca flow encap data information More...
 
struct  doca_flow_push_vlan_action
 doca flow push VLAN data information More...
 
struct  doca_flow_push_action
 doca flow push data information More...
 
struct  doca_flow_nat64_action
 doca flow nat64 action More...
 
struct  doca_flow_crypto_action
 doca flow crypto action information More...
 
struct  doca_flow_crypto_encap_action
 doca flow crypto encap action information More...
 
struct  doca_flow_resource_encap_cfg
 doca flow encap resource configuration More...
 
struct  doca_flow_resource_decap_cfg
 doca flow decap resource configuration More...
 
struct  doca_flow_actions
 doca flow actions information More...
 
struct  doca_flow_fwd
 forwarding configuration More...
 
struct  doca_flow_resource_meter_cfg
 doca flow meter resource configuration More...
 
struct  doca_flow_resource_psp_cfg
 doca flow psp resource configuration More...
 
struct  doca_flow_resource_ipsec_sa_cfg
 doca flow ipsec SA resource configuration More...
 
struct  doca_flow_mirror_target
 doca flow mirror target More...
 
struct  doca_flow_resource_mirror_cfg
 doca flow mirror resource configuration More...
 
struct  doca_flow_shared_resource_cfg
 doca flow shared resource configuration More...
 
struct  doca_flow_monitor
 doca monitor action configuration More...
 
struct  doca_flow_action_desc
 action description More...
 
struct  doca_flow_action_descs
 action descriptor array More...
 
struct  doca_flow_ordered_list_element
 Ordered list elements. More...
 
struct  doca_flow_ordered_list
 Ordered list configuration. More...
 
struct  doca_flow_resource_query
 flow resource query More...
 
struct  doca_flow_parser_geneve_opt_cfg
 User configuration structure using to create parser for single GENEVE TLV option. More...
 

Macros

#define DOCA_FLOW_META_SCRATCH_PAD_MAX   10
 
#define DOCA_FLOW_META_MAX   ((DOCA_FLOW_META_SCRATCH_PAD_MAX + 1) * 4)
 
#define DOCA_FLOW_MAX_ENTRY_ACTIONS_MEM_SIZE   (128)
 meter mark color More...
 
#define DOCA_FLOW_VLAN_MAX   2
 
#define DOCA_FLOW_PSP_DECRYPTION_ID   UINT32_MAX
 

Typedefs

typedef void(* doca_flow_pipe_process_cb) (struct doca_flow_pipe *pipe, enum doca_flow_pipe_status status, enum doca_flow_pipe_op op, void *user_ctx)
 doca flow pipe process callback More...
 
typedef void(* doca_flow_entry_process_cb) (struct doca_flow_pipe_entry *entry, uint16_t pipe_queue, enum doca_flow_entry_status status, enum doca_flow_entry_op op, void *user_ctx)
 doca flow entry process callback More...
 
typedef void(* doca_flow_shared_resource_unbind_cb) (enum doca_flow_shared_resource_type, uint32_t shared_resource_id, void *bindable_obj)
 doca flow shared resource unbind callback More...
 
typedef doca_error_t(* doca_flow_pipe_resize_nr_entries_changed_cb) (void *pipe_user_ctx, uint32_t nr_entries)
 doca flow pipe resize number of entries changed callback. More...
 
typedef doca_error_t(* doca_flow_pipe_resize_entry_relocate_cb) (void *pipe_user_ctx, uint16_t pipe_queue, void *entry_user_ctx, void **new_entry_user_ctx)
 doca flow pipe entry relocation callback. More...
 

Enumerations

enum  doca_flow_shared_resource_type {
  DOCA_FLOW_SHARED_RESOURCE_METER , DOCA_FLOW_SHARED_RESOURCE_COUNTER , DOCA_FLOW_SHARED_RESOURCE_RSS , DOCA_FLOW_SHARED_RESOURCE_MIRROR ,
  DOCA_FLOW_SHARED_RESOURCE_PSP , DOCA_FLOW_SHARED_RESOURCE_ENCAP , DOCA_FLOW_SHARED_RESOURCE_DECAP , DOCA_FLOW_SHARED_RESOURCE_IPSEC_SA
}
 Shared resource supported types. More...
 
enum  doca_flow_flags_type { DOCA_FLOW_NO_WAIT = 0 , DOCA_FLOW_WAIT_FOR_BATCH = (1 << 0) }
 doca flow flags type More...
 
enum  doca_flow_pipe_op { DOCA_FLOW_PIPE_OP_CONGESTION_REACHED , DOCA_FLOW_PIPE_OP_RESIZED , DOCA_FLOW_PIPE_OP_DESTROYED }
 doca flow pipe operation More...
 
enum  doca_flow_pipe_status { DOCA_FLOW_PIPE_STATUS_SUCCESS = 1 , DOCA_FLOW_PIPE_STATUS_ERROR }
 doca flow pipe status More...
 
enum  doca_flow_entry_op { DOCA_FLOW_ENTRY_OP_ADD , DOCA_FLOW_ENTRY_OP_DEL , DOCA_FLOW_ENTRY_OP_UPD , DOCA_FLOW_ENTRY_OP_AGED }
 doca flow entry operation More...
 
enum  doca_flow_entry_status { DOCA_FLOW_ENTRY_STATUS_IN_PROCESS , DOCA_FLOW_ENTRY_STATUS_SUCCESS , DOCA_FLOW_ENTRY_STATUS_ERROR }
 doca flow entry status More...
 
enum  doca_flow_rss_hash_function { DOCA_FLOW_RSS_HASH_FUNCTION_TOEPLITZ , DOCA_FLOW_RSS_HASH_FUNCTION_SYMMETRIC_TOEPLITZ }
 rss hash function type More...
 
enum  doca_flow_pipe_type {
  DOCA_FLOW_PIPE_BASIC , DOCA_FLOW_PIPE_CONTROL , DOCA_FLOW_PIPE_LPM , DOCA_FLOW_PIPE_CT ,
  DOCA_FLOW_PIPE_ACL , DOCA_FLOW_PIPE_ORDERED_LIST , DOCA_FLOW_PIPE_HASH
}
 doca flow pipe type More...
 
enum  doca_flow_pipe_domain { DOCA_FLOW_PIPE_DOMAIN_DEFAULT = 0 , DOCA_FLOW_PIPE_DOMAIN_SECURE_INGRESS , DOCA_FLOW_PIPE_DOMAIN_EGRESS , DOCA_FLOW_PIPE_DOMAIN_SECURE_EGRESS }
 doca flow pipe domain More...
 
enum  doca_flow_l2_meta { DOCA_FLOW_L2_META_NO_VLAN = 0 , DOCA_FLOW_L2_META_MULTI_VLAN , DOCA_FLOW_L2_META_SINGLE_VLAN , DOCA_FLOW_L2_META_CUSTOM_VLAN }
 doca flow l2 valid type for parser meta More...
 
enum  doca_flow_l3_meta { DOCA_FLOW_L3_META_NONE = 0 , DOCA_FLOW_L3_META_IPV4 , DOCA_FLOW_L3_META_IPV6 }
 doca flow l3 valid type for parser meta More...
 
enum  doca_flow_l4_meta {
  DOCA_FLOW_L4_META_NONE = 0 , DOCA_FLOW_L4_META_TCP , DOCA_FLOW_L4_META_UDP , DOCA_FLOW_L4_META_ICMP ,
  DOCA_FLOW_L4_META_ESP
}
 doca flow l4 valid type for parser meta More...
 
enum  doca_flow_crypto_syndrome { DOCA_FLOW_CRYPTO_SYNDROME_OK , DOCA_FLOW_CRYPTO_SYNDROME_ICV_FAIL , DOCA_FLOW_CRYPTO_SYNDROME_BAD_TRAILER }
 doca flow psp/ipsec syndrome valid values for parser meta More...
 
enum  doca_flow_pipe_hash_map_algorithm {
  DOCA_FLOW_PIPE_HASH_MAP_ALGORITHM_HASH = 1 << 0 , DOCA_FLOW_PIPE_HASH_MAP_ALGORITHM_RANDOM = 1 << 1 , DOCA_FLOW_PIPE_HASH_MAP_ALGORITHM_IDENTITY = 1 << 2 , DOCA_FLOW_PIPE_HASH_MAP_ALGORITHM_ROUND_ROBIN = 1 << 3 ,
  DOCA_FLOW_PIPE_HASH_MAP_ALGORITHM_FLOODING = 1 << 4 , DOCA_FLOW_PIPE_HASH_MAP_ALGORITHM_SELECT_ENABLED = 1 << 5
}
 DOCA Flow pipe map algorithm. More...
 
enum  doca_flow_match_tcp_flags {
  DOCA_FLOW_MATCH_TCP_FLAG_FIN = (1 << 0) , DOCA_FLOW_MATCH_TCP_FLAG_SYN = (1 << 1) , DOCA_FLOW_MATCH_TCP_FLAG_RST = (1 << 2) , DOCA_FLOW_MATCH_TCP_FLAG_PSH = (1 << 3) ,
  DOCA_FLOW_MATCH_TCP_FLAG_ACK = (1 << 4) , DOCA_FLOW_MATCH_TCP_FLAG_URG = (1 << 5) , DOCA_FLOW_MATCH_TCP_FLAG_ECE = (1 << 6) , DOCA_FLOW_MATCH_TCP_FLAG_CWR = (1 << 7)
}
 doca flow match flags More...
 
enum  doca_flow_l2_valid_header { DOCA_FLOW_L2_VALID_HEADER_VLAN_0 = (1 << 0) , DOCA_FLOW_L2_VALID_HEADER_VLAN_1 = (1 << 1) }
 doca flow l2 valid headers More...
 
enum  doca_flow_compare_op {
  DOCA_FLOW_COMPARE_EQ , DOCA_FLOW_COMPARE_NE , DOCA_FLOW_COMPARE_LT , DOCA_FLOW_COMPARE_LE ,
  DOCA_FLOW_COMPARE_GT , DOCA_FLOW_COMPARE_GE
}
 doca flow compare operation More...
 
enum  doca_flow_push_action_type { DOCA_FLOW_PUSH_ACTION_VLAN }
 doca flow push action type More...
 
enum  doca_flow_resource_type { DOCA_FLOW_RESOURCE_TYPE_NONE , DOCA_FLOW_RESOURCE_TYPE_SHARED , DOCA_FLOW_RESOURCE_TYPE_NON_SHARED }
 doca flow resource type More...
 
enum  doca_flow_target_type { DOCA_FLOW_TARGET_KERNEL }
 doca flow target type More...
 
enum  doca_flow_fwd_type {
  DOCA_FLOW_FWD_NONE = 0 , DOCA_FLOW_FWD_RSS , DOCA_FLOW_FWD_PORT , DOCA_FLOW_FWD_PIPE ,
  DOCA_FLOW_FWD_DROP , DOCA_FLOW_FWD_TARGET , DOCA_FLOW_FWD_ORDERED_LIST_PIPE , DOCA_FLOW_FWD_HASH_PIPE ,
  DOCA_FLOW_FWD_CHANGEABLE = 100
}
 forwarding action type More...
 
enum  doca_rss_type {
  DOCA_FLOW_RSS_IPV4 = (1 << 0) , DOCA_FLOW_RSS_IPV6 = (1 << 1) , DOCA_FLOW_RSS_UDP = (1 << 2) , DOCA_FLOW_RSS_TCP = (1 << 3) ,
  DOCA_FLOW_RSS_ESP = (1 << 4)
}
 rss offload types More...
 
enum  doca_flow_meter_algorithm_type { DOCA_FLOW_METER_ALGORITHM_TYPE_RFC2697 , DOCA_FLOW_METER_ALGORITHM_TYPE_RFC2698 , DOCA_FLOW_METER_ALGORITHM_TYPE_RFC4115 }
 Traffic meter algorithms. More...
 
enum  doca_flow_meter_limit_type { DOCA_FLOW_METER_LIMIT_TYPE_BYTES = 0 , DOCA_FLOW_METER_LIMIT_TYPE_PACKETS }
 Traffic meter limit type: per bytes or per packets for all meter parameters: cir, cbs, eir, ebs. More...
 
enum  doca_flow_meter_color_mode { DOCA_FLOW_METER_COLOR_MODE_BLIND = 0 , DOCA_FLOW_METER_COLOR_MODE_AWARE }
 Traffic meter init color mode when creating a pipe or entry: blind (fixed as green) or aware (configurable value). More...
 
enum  doca_flow_action_type { DOCA_FLOW_ACTION_AUTO = 0 , DOCA_FLOW_ACTION_ADD , DOCA_FLOW_ACTION_COPY }
 action type enumeration More...
 
enum  doca_flow_ordered_list_element_type { DOCA_FLOW_ORDERED_LIST_ELEMENT_ACTIONS , DOCA_FLOW_ORDERED_LIST_ELEMENT_MONITOR }
 Type of an ordered list element. More...
 
enum  doca_flow_direction_info { DOCA_FLOW_DIRECTION_BIDIRECTIONAL = 0 , DOCA_FLOW_DIRECTION_NETWORK_TO_HOST , DOCA_FLOW_DIRECTION_HOST_TO_NETWORK }
 doca flow direction info More...
 
enum  doca_flow_parser_geneve_opt_mode { DOCA_FLOW_PARSER_GENEVE_OPT_MODE_IGNORE , DOCA_FLOW_PARSER_GENEVE_OPT_MODE_FIXED , DOCA_FLOW_PARSER_GENEVE_OPT_MODE_MATCHABLE }
 Geneve TLV option class mode. More...
 
enum  doca_flow_port_operation_state { DOCA_FLOW_PORT_OPERATION_STATE_ACTIVE , DOCA_FLOW_PORT_OPERATION_STATE_ACTIVE_READY_TO_SWAP , DOCA_FLOW_PORT_OPERATION_STATE_STANDBY , DOCA_FLOW_PORT_OPERATION_STATE_UNCONNECTED }
 Defines the operation states for a port instance. More...
 

Functions

enum __attribute__ ((__packed__)) doca_flow_meter_color
 
DOCA_EXPERIMENTAL doca_error_t doca_flow_init (struct doca_flow_cfg *cfg)
 Initialize the doca flow. More...
 
DOCA_STABLE void doca_flow_destroy (void)
 Destroy the doca flow. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_flow_port_start (const struct doca_flow_port_cfg *cfg, struct doca_flow_port **port)
 Start a doca port. More...
 
DOCA_STABLE doca_error_t doca_flow_port_stop (struct doca_flow_port *port)
 Stop a doca port. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_flow_port_pair (struct doca_flow_port *port, struct doca_flow_port *pair_port)
 pair two doca flow ports. More...
 
DOCA_STABLE uint8_t * doca_flow_port_priv_data (struct doca_flow_port *port)
 Get pointer of user private data. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_flow_port_operation_state_modify (struct doca_flow_port *port, enum doca_flow_port_operation_state state)
 Modifies the operation state of a port instance. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_flow_shared_resource_set_cfg (enum doca_flow_shared_resource_type type, uint32_t id, struct doca_flow_shared_resource_cfg *cfg)
 Configure a single shared resource. More...
 
DOCA_STABLE doca_error_t doca_flow_shared_resources_bind (enum doca_flow_shared_resource_type type, uint32_t *res_array, uint32_t res_array_len, void *bindable_obj)
 Binds a bulk of shared resources to a bindable object. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_flow_shared_resources_query (enum doca_flow_shared_resource_type type, uint32_t *res_array, struct doca_flow_resource_query *query_results_array, uint32_t array_len)
 Extract information about shared counter. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_flow_pipe_create (const struct doca_flow_pipe_cfg *cfg, const struct doca_flow_fwd *fwd, const struct doca_flow_fwd *fwd_miss, struct doca_flow_pipe **pipe)
 Create one new pipe. More...
 
DOCA_STABLE doca_error_t doca_flow_pipe_resize (struct doca_flow_pipe *pipe, uint8_t new_congestion_level, doca_flow_pipe_resize_nr_entries_changed_cb nr_entries_changed_cb, doca_flow_pipe_resize_entry_relocate_cb entry_relocation_cb)
 Resize pipe. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_flow_pipe_add_entry (uint16_t pipe_queue, struct doca_flow_pipe *pipe, const struct doca_flow_match *match, const struct doca_flow_actions *actions, const struct doca_flow_monitor *monitor, const struct doca_flow_fwd *fwd, uint32_t flags, void *usr_ctx, struct doca_flow_pipe_entry **entry)
 Add one new entry to a pipe. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_flow_pipe_update_entry (uint16_t pipe_queue, struct doca_flow_pipe *pipe, const struct doca_flow_actions *actions, const struct doca_flow_monitor *monitor, const struct doca_flow_fwd *fwd, const enum doca_flow_flags_type flags, struct doca_flow_pipe_entry *entry)
 Update the pipe entry with new actions. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_flow_pipe_control_add_entry (uint16_t pipe_queue, uint32_t priority, struct doca_flow_pipe *pipe, const struct doca_flow_match *match, const struct doca_flow_match *match_mask, const struct doca_flow_match_condition *condition, const struct doca_flow_actions *actions, const struct doca_flow_actions *actions_mask, const struct doca_flow_action_descs *action_descs, const struct doca_flow_monitor *monitor, const struct doca_flow_fwd *fwd, void *usr_ctx, struct doca_flow_pipe_entry **entry)
 Add one new entry to a control pipe. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_flow_pipe_lpm_add_entry (uint16_t pipe_queue, struct doca_flow_pipe *pipe, const struct doca_flow_match *match, const struct doca_flow_match *match_mask, const struct doca_flow_actions *actions, const struct doca_flow_monitor *monitor, const struct doca_flow_fwd *fwd, const enum doca_flow_flags_type flag, void *usr_ctx, struct doca_flow_pipe_entry **entry)
 Add one new entry to a lpm pipe. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_flow_pipe_lpm_update_entry (uint16_t pipe_queue, struct doca_flow_pipe *pipe, const struct doca_flow_actions *actions, const struct doca_flow_monitor *monitor, const struct doca_flow_fwd *fwd, const enum doca_flow_flags_type flags, struct doca_flow_pipe_entry *entry)
 Update the lpm pipe entry with new actions. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_flow_pipe_ordered_list_add_entry (uint16_t pipe_queue, struct doca_flow_pipe *pipe, uint32_t idx, const struct doca_flow_ordered_list *ordered_list, const struct doca_flow_fwd *fwd, enum doca_flow_flags_type flags, void *user_ctx, struct doca_flow_pipe_entry **entry)
 
DOCA_EXPERIMENTAL doca_error_t doca_flow_pipe_acl_add_entry (uint16_t pipe_queue, struct doca_flow_pipe *pipe, const struct doca_flow_match *match, const struct doca_flow_match *match_mask, const uint32_t priority, const struct doca_flow_fwd *fwd, const enum doca_flow_flags_type flag, void *usr_ctx, struct doca_flow_pipe_entry **entry)
 Add one new entry to a acl pipe. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_flow_pipe_hash_add_entry (uint16_t pipe_queue, struct doca_flow_pipe *pipe, uint32_t entry_index, const struct doca_flow_actions *actions, const struct doca_flow_monitor *monitor, const struct doca_flow_fwd *fwd, const enum doca_flow_flags_type flags, void *usr_ctx, struct doca_flow_pipe_entry **entry)
 Add one new entry to an hash pipe. More...
 
DOCA_STABLE doca_error_t doca_flow_pipe_remove_entry (uint16_t pipe_queue, uint32_t flags, struct doca_flow_pipe_entry *entry)
 Free one pipe entry. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_flow_pipe_calc_hash (struct doca_flow_pipe *pipe, const struct doca_flow_match *match, uint32_t *hash)
 calc the hash for a given match on a given pipe. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_flow_port_calc_entropy (struct doca_flow_port *port, struct doca_flow_entropy_format *header, uint16_t *entropy)
 Calculate the entropy. More...
 
DOCA_STABLE void doca_flow_pipe_destroy (struct doca_flow_pipe *pipe)
 Destroy one pipe. More...
 
DOCA_STABLE void doca_flow_port_pipes_flush (struct doca_flow_port *port)
 Flush pipes of one port. More...
 
DOCA_EXPERIMENTAL void doca_flow_port_pipes_dump (struct doca_flow_port *port, FILE *f)
 Dump pipes of one port. More...
 
DOCA_EXPERIMENTAL void doca_flow_pipe_dump (struct doca_flow_pipe *pipe, FILE *f)
 Dump pipe information (not including the entries) More...
 
DOCA_EXPERIMENTAL doca_error_t doca_flow_resource_query_entry (struct doca_flow_pipe_entry *entry, struct doca_flow_resource_query *query_stats)
 Extract information about specific entry. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_flow_resource_query_pipe_miss (struct doca_flow_pipe *pipe, struct doca_flow_resource_query *query_stats)
 Extract information about pipe miss entry. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_flow_pipe_update_miss (struct doca_flow_pipe *pipe, const struct doca_flow_fwd *fwd_miss)
 Update the forward miss action. More...
 
DOCA_STABLE int doca_flow_aging_handle (struct doca_flow_port *port, uint16_t queue, uint64_t quota, uint64_t max_entries)
 Handle aging of entries. More...
 
DOCA_STABLE doca_error_t doca_flow_entries_process (struct doca_flow_port *port, uint16_t pipe_queue, uint64_t timeout, uint32_t max_processed_entries)
 Process entries in queue. More...
 
DOCA_STABLE enum doca_flow_entry_status doca_flow_pipe_entry_get_status (struct doca_flow_pipe_entry *entry)
 Get entry's status. More...
 
DOCA_STABLE struct doca_flow_port * doca_flow_port_switch_get (const struct doca_flow_port *port)
 Get doca flow switch port. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_flow_mpls_label_encode (uint32_t label, uint8_t traffic_class, uint8_t ttl, bool bottom_of_stack, struct doca_flow_header_mpls *mpls)
 Prepare an MPLS label header in big-endian. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_flow_mpls_label_decode (const struct doca_flow_header_mpls *mpls, uint32_t *label, uint8_t *traffic_class, uint8_t *ttl, bool *bottom_of_stack)
 Decode an MPLS label header. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_flow_parser_geneve_opt_create (const struct doca_flow_port *port, const struct doca_flow_parser_geneve_opt_cfg tlv_list[], uint8_t nb_options, struct doca_flow_parser **parser)
 Creates GENEVE TLV parser for the selected port. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_flow_parser_geneve_opt_destroy (struct doca_flow_parser *parser)
 Destroy GENEVE TLV parser. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_flow_get_target (enum doca_flow_target_type type, struct doca_flow_target **target)
 Get doca flow forward target. More...
 
DOCA_STABLE doca_error_t doca_flow_cfg_create (struct doca_flow_cfg **cfg)
 Create DOCA Flow configuration struct. More...
 
DOCA_STABLE doca_error_t doca_flow_cfg_destroy (struct doca_flow_cfg *cfg)
 Destroy DOCA Flow configuration struct. More...
 
DOCA_STABLE doca_error_t doca_flow_cfg_set_pipe_queues (struct doca_flow_cfg *cfg, uint16_t pipe_queues)
 Set pipe queues. More...
 
DOCA_STABLE doca_error_t doca_flow_cfg_set_nr_counters (struct doca_flow_cfg *cfg, uint32_t nr_counters)
 Set number of counters to configure. More...
 
DOCA_STABLE doca_error_t doca_flow_cfg_set_nr_meters (struct doca_flow_cfg *cfg, uint32_t nr_meters)
 Set number of traffic meters to configure. More...
 
DOCA_STABLE doca_error_t doca_flow_cfg_set_nr_acl_collisions (struct doca_flow_cfg *cfg, uint8_t nr_acl_collisions)
 Set number of pre-configured collisions. More...
 
DOCA_STABLE doca_error_t doca_flow_cfg_set_mode_args (struct doca_flow_cfg *cfg, const char *mode_args)
 Set DOCA mode args. More...
 
DOCA_STABLE doca_error_t doca_flow_cfg_set_nr_shared_resource (struct doca_flow_cfg *cfg, uint32_t nr_shared_resource, enum doca_flow_shared_resource_type type)
 Set number of shared resource. More...
 
DOCA_STABLE doca_error_t doca_flow_cfg_set_queue_depth (struct doca_flow_cfg *cfg, uint32_t queue_depth)
 Set number of pre-configured queue_size. More...
 
DOCA_STABLE doca_error_t doca_flow_cfg_set_cb_pipe_process (struct doca_flow_cfg *cfg, doca_flow_pipe_process_cb cb)
 Set callback for pipe process completion. More...
 
DOCA_STABLE doca_error_t doca_flow_cfg_set_cb_entry_process (struct doca_flow_cfg *cfg, doca_flow_entry_process_cb cb)
 Set callback for entry create/destroy. More...
 
DOCA_STABLE doca_error_t doca_flow_cfg_set_cb_shared_resource_unbind (struct doca_flow_cfg *cfg, doca_flow_shared_resource_unbind_cb cb)
 Set callback for unbinding of a shared resource. More...
 
DOCA_STABLE doca_error_t doca_flow_cfg_set_rss_key (struct doca_flow_cfg *cfg, const uint8_t *rss_key, uint32_t rss_key_len)
 Set RSS hash key. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_flow_cfg_set_default_rss (struct doca_flow_cfg *cfg, const struct doca_flow_resource_rss_cfg *rss)
 Set RSS global configuration. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_flow_cfg_set_definitions (struct doca_flow_cfg *cfg, const struct doca_flow_definitions *defs)
 Set the definition object. More...
 
DOCA_STABLE doca_error_t doca_flow_port_cfg_create (struct doca_flow_port_cfg **cfg)
 Create DOCA Flow port configuration struct. More...
 
DOCA_STABLE doca_error_t doca_flow_port_cfg_destroy (struct doca_flow_port_cfg *cfg)
 Destroy DOCA Flow port configuration struct. More...
 
DOCA_STABLE doca_error_t doca_flow_port_cfg_set_devargs (struct doca_flow_port_cfg *cfg, const char *devargs)
 Set devargs. More...
 
DOCA_STABLE doca_error_t doca_flow_port_cfg_set_priv_data_size (struct doca_flow_port_cfg *cfg, uint16_t priv_data_size)
 Set user private data size. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_flow_port_cfg_set_dev (struct doca_flow_port_cfg *cfg, struct doca_dev *dev)
 Set port's device. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_flow_port_cfg_set_dev_rep (struct doca_flow_port_cfg *cfg, struct doca_dev_rep *dev)
 Set port's device for representor. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_flow_port_cfg_set_port_id (struct doca_flow_port_cfg *cfg, uint16_t port_id)
 Set the logical port ID. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_flow_port_cfg_set_rss_cfg (struct doca_flow_port_cfg *cfg, const struct doca_flow_resource_rss_cfg *rss_cfg)
 Set RSS optional configuration. More...
 
DOCA_STABLE doca_error_t doca_flow_port_cfg_set_ipsec_sn_offload_disable (struct doca_flow_port_cfg *cfg)
 Disable SN offload for ipsec - Anti-replay and sn increment will not be activated. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_flow_port_cfg_set_operation_state (struct doca_flow_port_cfg *cfg, enum doca_flow_port_operation_state state)
 Set default rules operation state. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_flow_port_cfg_set_actions_mem_size (struct doca_flow_port_cfg *cfg, uint32_t size)
 Set max memory size used by actions. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_flow_port_cfg_set_service_threads_core (struct doca_flow_port_cfg *cfg, uint32_t core)
 Set service threads execution cpu core. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_flow_port_cfg_set_service_threads_cycle (struct doca_flow_port_cfg *cfg, uint32_t cycle_ms)
 Set service threads max execution cycle. More...
 
DOCA_STABLE doca_error_t doca_flow_pipe_cfg_create (struct doca_flow_pipe_cfg **cfg, struct doca_flow_port *port)
 Create DOCA Flow pipe configuration struct. More...
 
DOCA_STABLE doca_error_t doca_flow_pipe_cfg_destroy (struct doca_flow_pipe_cfg *cfg)
 Destroy DOCA Flow pipe configuration struct. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_flow_pipe_cfg_set_match (struct doca_flow_pipe_cfg *cfg, const struct doca_flow_match *match, const struct doca_flow_match *match_mask)
 Set pipe's match and match mask. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_flow_pipe_cfg_set_actions (struct doca_flow_pipe_cfg *cfg, struct doca_flow_actions *const *actions, struct doca_flow_actions *const *actions_masks, struct doca_flow_action_descs *const *action_descs, size_t nr_actions)
 Set pipe's actions, actions mask and actions descriptor. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_flow_pipe_cfg_set_monitor (struct doca_flow_pipe_cfg *cfg, const struct doca_flow_monitor *monitor)
 Set pipe's monitor. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_flow_pipe_cfg_set_ordered_lists (struct doca_flow_pipe_cfg *cfg, struct doca_flow_ordered_list *const *ordered_lists, size_t nr_ordered_lists)
 Set pipe's ordered lists. More...
 
DOCA_STABLE doca_error_t doca_flow_pipe_cfg_set_name (struct doca_flow_pipe_cfg *cfg, const char *name)
 Set pipe's name. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_flow_pipe_cfg_set_label (struct doca_flow_pipe_cfg *cfg, const char *label)
 Sets the label for the given pipe. More...
 
DOCA_STABLE doca_error_t doca_flow_pipe_cfg_set_type (struct doca_flow_pipe_cfg *cfg, enum doca_flow_pipe_type type)
 Set pipe's type. More...
 
DOCA_STABLE doca_error_t doca_flow_pipe_cfg_set_domain (struct doca_flow_pipe_cfg *cfg, enum doca_flow_pipe_domain domain)
 Set pipe's domain. More...
 
DOCA_STABLE doca_error_t doca_flow_pipe_cfg_set_is_root (struct doca_flow_pipe_cfg *cfg, bool is_root)
 Set if pipe is root or not. More...
 
DOCA_STABLE doca_error_t doca_flow_pipe_cfg_set_nr_entries (struct doca_flow_pipe_cfg *cfg, uint32_t nr_entries)
 Set pipe's maximum number of flow rules. More...
 
DOCA_STABLE doca_error_t doca_flow_pipe_cfg_set_is_resizable (struct doca_flow_pipe_cfg *cfg, bool is_resizable)
 Set if the pipe supports the resize operation. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_flow_pipe_cfg_set_excluded_queue (struct doca_flow_pipe_cfg *cfg, uint16_t pipe_queue)
 Set pipe_queue as excluded in the pipe. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_flow_pipe_cfg_set_dir_info (struct doca_flow_pipe_cfg *cfg, enum doca_flow_direction_info dir_info)
 Set pipe's Direction info. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_flow_pipe_cfg_set_miss_counter (struct doca_flow_pipe_cfg *cfg, bool miss_counter)
 Set to enable pipe's miss counter. More...
 
DOCA_STABLE doca_error_t doca_flow_pipe_cfg_set_congestion_level_threshold (struct doca_flow_pipe_cfg *cfg, uint8_t congestion_level_threshold)
 Set pipe's congestion level threshold. More...
 
DOCA_STABLE doca_error_t doca_flow_pipe_cfg_set_user_ctx (struct doca_flow_pipe_cfg *cfg, void *user_ctx)
 Set pipe's user context. More...
 
DOCA_EXPERIMENTAL doca_error_t doca_flow_pipe_cfg_set_hash_map_algorithm (struct doca_flow_pipe_cfg *cfg, uint32_t algorithm_flags)
 Set pipe map algorithm - supported only in hash pipe. More...
 

Detailed Description

DOCA HW offload flow library. For more details please refer to the user guide on DOCA devzone.

Macro Definition Documentation

◆ DOCA_FLOW_MAX_ENTRY_ACTIONS_MEM_SIZE

#define DOCA_FLOW_MAX_ENTRY_ACTIONS_MEM_SIZE   (128)

meter mark color

Max usage of actions memory size in byte

Definition at line 266 of file doca_flow.h.

◆ DOCA_FLOW_META_MAX

#define DOCA_FLOW_META_MAX   ((DOCA_FLOW_META_SCRATCH_PAD_MAX + 1) * 4)

Max meta data size in bytes, including pkt_meta.

Definition at line 259 of file doca_flow.h.

◆ DOCA_FLOW_META_SCRATCH_PAD_MAX

#define DOCA_FLOW_META_SCRATCH_PAD_MAX   10

Max meta scratch pad size in 32-bit resolution

Definition at line 254 of file doca_flow.h.

◆ DOCA_FLOW_PSP_DECRYPTION_ID

#define DOCA_FLOW_PSP_DECRYPTION_ID   UINT32_MAX

PSP decryption reserved id, must be used at pipe creation and entry addition

Definition at line 621 of file doca_flow.h.

◆ DOCA_FLOW_VLAN_MAX

#define DOCA_FLOW_VLAN_MAX   2

Max number of vlan headers.

Definition at line 424 of file doca_flow.h.

Typedef Documentation

◆ doca_flow_entry_process_cb

typedef void(* doca_flow_entry_process_cb) (struct doca_flow_pipe_entry *entry, uint16_t pipe_queue, enum doca_flow_entry_status status, enum doca_flow_entry_op op, void *user_ctx)

doca flow entry process callback

Definition at line 204 of file doca_flow.h.

◆ doca_flow_pipe_process_cb

typedef void(* doca_flow_pipe_process_cb) (struct doca_flow_pipe *pipe, enum doca_flow_pipe_status status, enum doca_flow_pipe_op op, void *user_ctx)

doca flow pipe process callback

Definition at line 196 of file doca_flow.h.

◆ doca_flow_pipe_resize_entry_relocate_cb

typedef doca_error_t(* doca_flow_pipe_resize_entry_relocate_cb) (void *pipe_user_ctx, uint16_t pipe_queue, void *entry_user_ctx, void **new_entry_user_ctx)

doca flow pipe entry relocation callback.

Called for each entry that reached its destination after resize. User is allowed to switch the context to a new pointer.

Parameters
[in]pipe_user_ctxPointer to pipe user context.
[in]pipe_queuePipe queue id.
[in]entry_user_ctxPointer to entry user context.
[out]new_entry_user_ctxPointer to new entry user context.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_NO_MEMORY - memory error.

Definition at line 1456 of file doca_flow.h.

◆ doca_flow_pipe_resize_nr_entries_changed_cb

typedef doca_error_t(* doca_flow_pipe_resize_nr_entries_changed_cb) (void *pipe_user_ctx, uint32_t nr_entries)

doca flow pipe resize number of entries changed callback.

Parameters
[in]pipe_user_ctxPointer to pipe user context.
[out]nr_entriesChanged value for pipe's number of entries.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_NO_MEMORY - memory error.

Definition at line 1435 of file doca_flow.h.

◆ doca_flow_shared_resource_unbind_cb

typedef void(* doca_flow_shared_resource_unbind_cb) (enum doca_flow_shared_resource_type, uint32_t shared_resource_id, void *bindable_obj)

doca flow shared resource unbind callback

Definition at line 213 of file doca_flow.h.

Enumeration Type Documentation

◆ doca_flow_action_type

action type enumeration

Enumerator
DOCA_FLOW_ACTION_AUTO 
DOCA_FLOW_ACTION_ADD 
DOCA_FLOW_ACTION_COPY 

Definition at line 1007 of file doca_flow.h.

◆ doca_flow_compare_op

doca flow compare operation

Enumerator
DOCA_FLOW_COMPARE_EQ 

Equal compare.

DOCA_FLOW_COMPARE_NE 

Not equal compare.

DOCA_FLOW_COMPARE_LT 

Less than compare.

DOCA_FLOW_COMPARE_LE 

Less equal compare.

DOCA_FLOW_COMPARE_GT 

Great than compare.

DOCA_FLOW_COMPARE_GE 

Great equal compare.

Definition at line 509 of file doca_flow.h.

◆ doca_flow_crypto_syndrome

doca flow psp/ipsec syndrome valid values for parser meta

Enumerator
DOCA_FLOW_CRYPTO_SYNDROME_OK 

Decryption and authentication success

DOCA_FLOW_CRYPTO_SYNDROME_ICV_FAIL 

Authentication failure

DOCA_FLOW_CRYPTO_SYNDROME_BAD_TRAILER 

Trailer overlaps with headers

Definition at line 321 of file doca_flow.h.

◆ doca_flow_direction_info

doca flow direction info

Enumerator
DOCA_FLOW_DIRECTION_BIDIRECTIONAL 
DOCA_FLOW_DIRECTION_NETWORK_TO_HOST 
DOCA_FLOW_DIRECTION_HOST_TO_NETWORK 

Definition at line 1092 of file doca_flow.h.

◆ doca_flow_entry_op

doca flow entry operation

Enumerator
DOCA_FLOW_ENTRY_OP_ADD 

Add entry

DOCA_FLOW_ENTRY_OP_DEL 

Delete entry

DOCA_FLOW_ENTRY_OP_UPD 

Update entry

DOCA_FLOW_ENTRY_OP_AGED 

Aged entry

Definition at line 146 of file doca_flow.h.

◆ doca_flow_entry_status

doca flow entry status

Enumerator
DOCA_FLOW_ENTRY_STATUS_IN_PROCESS 
DOCA_FLOW_ENTRY_STATUS_SUCCESS 
DOCA_FLOW_ENTRY_STATUS_ERROR 

Definition at line 160 of file doca_flow.h.

◆ doca_flow_flags_type

doca flow flags type

Enumerator
DOCA_FLOW_NO_WAIT 

entry will not be buffered

DOCA_FLOW_WAIT_FOR_BATCH 

entry will be buffered

Definition at line 114 of file doca_flow.h.

◆ doca_flow_fwd_type

forwarding action type

Enumerator
DOCA_FLOW_FWD_NONE 

No forward action be set

DOCA_FLOW_FWD_RSS 

Forwards packets to rss

DOCA_FLOW_FWD_PORT 

Forwards packets to one port

DOCA_FLOW_FWD_PIPE 

Forwards packets to another pipe

DOCA_FLOW_FWD_DROP 

Drops packets

DOCA_FLOW_FWD_TARGET 

Forwards packets to target

DOCA_FLOW_FWD_ORDERED_LIST_PIPE 

Forwards packet to a specific entry in an ordered list pipe.

DOCA_FLOW_FWD_HASH_PIPE 

Forwards packet to a specific algorithm in hash pipe.

DOCA_FLOW_FWD_CHANGEABLE 

Forward is specified at entry creation.

Definition at line 739 of file doca_flow.h.

◆ doca_flow_l2_meta

doca flow l2 valid type for parser meta

Enumerator
DOCA_FLOW_L2_META_NO_VLAN 

no vlan present

DOCA_FLOW_L2_META_MULTI_VLAN 

multiple vlan present

DOCA_FLOW_L2_META_SINGLE_VLAN 

single vlan present

DOCA_FLOW_L2_META_CUSTOM_VLAN 

custom vlan present

Definition at line 279 of file doca_flow.h.

◆ doca_flow_l2_valid_header

doca flow l2 valid headers

Enumerator
DOCA_FLOW_L2_VALID_HEADER_VLAN_0 

first vlan

DOCA_FLOW_L2_VALID_HEADER_VLAN_1 

second vlan

Definition at line 429 of file doca_flow.h.

◆ doca_flow_l3_meta

doca flow l3 valid type for parser meta

Enumerator
DOCA_FLOW_L3_META_NONE 

l3 type is none of the below

DOCA_FLOW_L3_META_IPV4 

l3 type is ipv4

DOCA_FLOW_L3_META_IPV6 

l3 type is ipv6

Definition at line 293 of file doca_flow.h.

◆ doca_flow_l4_meta

doca flow l4 valid type for parser meta

Enumerator
DOCA_FLOW_L4_META_NONE 

l4 type is none of the below

DOCA_FLOW_L4_META_TCP 

l4 type is tcp

DOCA_FLOW_L4_META_UDP 

l4 type is udp

DOCA_FLOW_L4_META_ICMP 

l4 type is icmp or icmp6

DOCA_FLOW_L4_META_ESP 

l4 type is esp

Definition at line 305 of file doca_flow.h.

◆ doca_flow_match_tcp_flags

doca flow match flags

Enumerator
DOCA_FLOW_MATCH_TCP_FLAG_FIN 

match tcp packet with Fin flag

DOCA_FLOW_MATCH_TCP_FLAG_SYN 

match tcp packet with Syn flag

DOCA_FLOW_MATCH_TCP_FLAG_RST 

match tcp packet with Rst flag

DOCA_FLOW_MATCH_TCP_FLAG_PSH 

match tcp packet with Psh flag

DOCA_FLOW_MATCH_TCP_FLAG_ACK 

match tcp packet with Ack flag

DOCA_FLOW_MATCH_TCP_FLAG_URG 

match tcp packet with Urg flag

DOCA_FLOW_MATCH_TCP_FLAG_ECE 

match tcp packet with Ece flag

DOCA_FLOW_MATCH_TCP_FLAG_CWR 

match tcp packet with Cwr flag

Definition at line 402 of file doca_flow.h.

◆ doca_flow_meter_algorithm_type

Traffic meter algorithms.

Enumerator
DOCA_FLOW_METER_ALGORITHM_TYPE_RFC2697 

Single Rate Three Color Marker - IETF RFC 2697.

DOCA_FLOW_METER_ALGORITHM_TYPE_RFC2698 

Two Rate Three Color Marker - IETF RFC 2698.

DOCA_FLOW_METER_ALGORITHM_TYPE_RFC4115 

Two Rate Three Color Marker - IETF RFC 4115.

Definition at line 829 of file doca_flow.h.

◆ doca_flow_meter_color_mode

Traffic meter init color mode when creating a pipe or entry: blind (fixed as green) or aware (configurable value).

Enumerator
DOCA_FLOW_METER_COLOR_MODE_BLIND 

Meter action init color is green.

DOCA_FLOW_METER_COLOR_MODE_AWARE 

Meter action init color is configured.

Definition at line 853 of file doca_flow.h.

◆ doca_flow_meter_limit_type

Traffic meter limit type: per bytes or per packets for all meter parameters: cir, cbs, eir, ebs.

Enumerator
DOCA_FLOW_METER_LIMIT_TYPE_BYTES 

Meter parameters per bytes

DOCA_FLOW_METER_LIMIT_TYPE_PACKETS 

Meter parameters packets

Definition at line 842 of file doca_flow.h.

◆ doca_flow_ordered_list_element_type

Type of an ordered list element.

Enumerator
DOCA_FLOW_ORDERED_LIST_ELEMENT_ACTIONS 
DOCA_FLOW_ORDERED_LIST_ELEMENT_MONITOR 

Ordered list element is struct doca_flow_actions, and/or actions mask associated with the current element, or corresponding doca_flow_action_desc.

Definition at line 1043 of file doca_flow.h.

◆ doca_flow_parser_geneve_opt_mode

Geneve TLV option class mode.

Enumerator
DOCA_FLOW_PARSER_GENEVE_OPT_MODE_IGNORE 

class is ignored.

DOCA_FLOW_PARSER_GENEVE_OPT_MODE_FIXED 

class is fixed (the class defines the option along with the type).

DOCA_FLOW_PARSER_GENEVE_OPT_MODE_MATCHABLE 

class is matching per flow.

Definition at line 1119 of file doca_flow.h.

◆ doca_flow_pipe_domain

doca flow pipe domain

Enumerator
DOCA_FLOW_PIPE_DOMAIN_DEFAULT 

Default pipe domain for actions on ingress traffic

DOCA_FLOW_PIPE_DOMAIN_SECURE_INGRESS 

Pipe domain for secure actions on ingress traffic

DOCA_FLOW_PIPE_DOMAIN_EGRESS 

Pipe domain for actions on egress traffic

DOCA_FLOW_PIPE_DOMAIN_SECURE_EGRESS 

Pipe domain for actions on egress traffic

Definition at line 240 of file doca_flow.h.

◆ doca_flow_pipe_hash_map_algorithm

DOCA Flow pipe map algorithm.

Enumerator
DOCA_FLOW_PIPE_HASH_MAP_ALGORITHM_HASH 

Hash algorithm - default

DOCA_FLOW_PIPE_HASH_MAP_ALGORITHM_RANDOM 

Random algorithm

DOCA_FLOW_PIPE_HASH_MAP_ALGORITHM_IDENTITY 

Direct mapping algorithm

DOCA_FLOW_PIPE_HASH_MAP_ALGORITHM_ROUND_ROBIN 

Round robin algorithm

DOCA_FLOW_PIPE_HASH_MAP_ALGORITHM_FLOODING 

Flooding algorithm

DOCA_FLOW_PIPE_HASH_MAP_ALGORITHM_SELECT_ENABLED 

Select enabled map entry

Definition at line 333 of file doca_flow.h.

◆ doca_flow_pipe_op

doca flow pipe operation

Enumerator
DOCA_FLOW_PIPE_OP_CONGESTION_REACHED 

Pipe congestion percentage level reached

DOCA_FLOW_PIPE_OP_RESIZED 

Pipe resize completion

DOCA_FLOW_PIPE_OP_DESTROYED 

Pipe destroy completion

Definition at line 124 of file doca_flow.h.

◆ doca_flow_pipe_status

doca flow pipe status

Enumerator
DOCA_FLOW_PIPE_STATUS_SUCCESS 

The operation was completed successfully.

DOCA_FLOW_PIPE_STATUS_ERROR 

The operation failed.

Definition at line 136 of file doca_flow.h.

◆ doca_flow_pipe_type

doca flow pipe type

Enumerator
DOCA_FLOW_PIPE_BASIC 

Flow pipe

DOCA_FLOW_PIPE_CONTROL 

Control pipe

DOCA_FLOW_PIPE_LPM 

longest prefix match (LPM) pipe

DOCA_FLOW_PIPE_CT 

Connection Tracking pipe

DOCA_FLOW_PIPE_ACL 

ACL pipe

DOCA_FLOW_PIPE_ORDERED_LIST 

Ordered list pipe

DOCA_FLOW_PIPE_HASH 

Hash pipe

Definition at line 220 of file doca_flow.h.

◆ doca_flow_port_operation_state

Defines the operation states for a port instance.

Enumerator
DOCA_FLOW_PORT_OPERATION_STATE_ACTIVE 

This instance actively handles incoming and outgoing traffic

DOCA_FLOW_PORT_OPERATION_STATE_ACTIVE_READY_TO_SWAP 

This instance actively handles traffic when no other active instance is available

DOCA_FLOW_PORT_OPERATION_STATE_STANDBY 

This instance handles traffic only when no active or active_ready_to_swap instance is available

DOCA_FLOW_PORT_OPERATION_STATE_UNCONNECTED 

This instance does not handle traffic, regardless of the state of other instances

Definition at line 1147 of file doca_flow.h.

◆ doca_flow_push_action_type

doca flow push action type

Enumerator
DOCA_FLOW_PUSH_ACTION_VLAN 

Definition at line 586 of file doca_flow.h.

◆ doca_flow_resource_type

doca flow resource type

Enumerator
DOCA_FLOW_RESOURCE_TYPE_NONE 
DOCA_FLOW_RESOURCE_TYPE_SHARED 
DOCA_FLOW_RESOURCE_TYPE_NON_SHARED 

Definition at line 612 of file doca_flow.h.

◆ doca_flow_rss_hash_function

rss hash function type

Enumerator
DOCA_FLOW_RSS_HASH_FUNCTION_TOEPLITZ 

Toeplitz

DOCA_FLOW_RSS_HASH_FUNCTION_SYMMETRIC_TOEPLITZ 

Toeplitz with sorted source and destination

Definition at line 172 of file doca_flow.h.

◆ doca_flow_shared_resource_type

Shared resource supported types.

Enumerator
DOCA_FLOW_SHARED_RESOURCE_METER 

Shared meter type

DOCA_FLOW_SHARED_RESOURCE_COUNTER 

Shared counter type

DOCA_FLOW_SHARED_RESOURCE_RSS 

Shared rss type

DOCA_FLOW_SHARED_RESOURCE_MIRROR 

Shared mirror type

DOCA_FLOW_SHARED_RESOURCE_PSP 

Shared psp action type

DOCA_FLOW_SHARED_RESOURCE_ENCAP 

Shared encap type

DOCA_FLOW_SHARED_RESOURCE_DECAP 

Shared decap type

DOCA_FLOW_SHARED_RESOURCE_IPSEC_SA 

Shared ipsec SA type

Definition at line 92 of file doca_flow.h.

◆ doca_flow_target_type

doca flow target type

Enumerator
DOCA_FLOW_TARGET_KERNEL 

Definition at line 732 of file doca_flow.h.

◆ doca_rss_type

rss offload types

Enumerator
DOCA_FLOW_RSS_IPV4 

rss by ipv4 header

DOCA_FLOW_RSS_IPV6 

rss by ipv6 header

DOCA_FLOW_RSS_UDP 

rss by udp header

DOCA_FLOW_RSS_TCP 

rss by tcp header

DOCA_FLOW_RSS_ESP 

rss by esp header

Definition at line 763 of file doca_flow.h.

Function Documentation

◆ __attribute__()

enum __attribute__ ( (__packed__)  )

packed

< Meter marking packet color as red

< Meter marking packet color as yellow

< Meter marking packet color as green

Definition at line 213 of file doca_flow.h.

◆ doca_flow_aging_handle()

DOCA_STABLE int doca_flow_aging_handle ( struct doca_flow_port *  port,
uint16_t  queue,
uint64_t  quota,
uint64_t  max_entries 
)

Handle aging of entries.

Process aged entries, the user will get a notification in the callback.

Handling of aged entries can take too much time, so we split each cycle to small chunks that are limited by some time quota.

As long as the function doesn't return -1, more entries are pending processing for this cycle.

Parameters
[in]portPort to handle aging
[in]queueQueue identifier.
[in]quotaMax time quota in micro seconds handle aging, 0: no limit.
[in]max_entriesMax entries for this function to handle aging, 0: no limit.
Returns

0 the number of aged entries.

0 no aged entries in current call. -1 full cycle done.

◆ doca_flow_cfg_create()

DOCA_STABLE doca_error_t doca_flow_cfg_create ( struct doca_flow_cfg **  cfg)

Create DOCA Flow configuration struct.

Create and allocate DOCA Flow configuration struct

Parameters
[out]cfgDOCA Flow global configuration.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_NO_MEMORY - memory allocation failed.

◆ doca_flow_cfg_destroy()

DOCA_STABLE doca_error_t doca_flow_cfg_destroy ( struct doca_flow_cfg *  cfg)

Destroy DOCA Flow configuration struct.

Free and destroy the DOCA Flow configuration struct

Parameters
[in]cfgDOCA Flow global configuration.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.

◆ doca_flow_cfg_set_cb_entry_process()

DOCA_STABLE doca_error_t doca_flow_cfg_set_cb_entry_process ( struct doca_flow_cfg *  cfg,
doca_flow_entry_process_cb  cb 
)

Set callback for entry create/destroy.

Parameters
[in]cfgDOCA Flow global configuration.
[in]cbCallback for entry create/destroy
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.

◆ doca_flow_cfg_set_cb_pipe_process()

DOCA_STABLE doca_error_t doca_flow_cfg_set_cb_pipe_process ( struct doca_flow_cfg *  cfg,
doca_flow_pipe_process_cb  cb 
)

Set callback for pipe process completion.

Parameters
[in]cfgDOCA Flow global configuration.
[in]cbCallback for pipe process completion
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.

◆ doca_flow_cfg_set_cb_shared_resource_unbind()

DOCA_STABLE doca_error_t doca_flow_cfg_set_cb_shared_resource_unbind ( struct doca_flow_cfg *  cfg,
doca_flow_shared_resource_unbind_cb  cb 
)

Set callback for unbinding of a shared resource.

Parameters
[in]cfgDOCA Flow global configuration.
[in]cbCallback for unbinding of a shared resource
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.

◆ doca_flow_cfg_set_default_rss()

DOCA_EXPERIMENTAL doca_error_t doca_flow_cfg_set_default_rss ( struct doca_flow_cfg *  cfg,
const struct doca_flow_resource_rss_cfg rss 
)

Set RSS global configuration.

Set the RSS global configuration for all port

Parameters
[in]cfgDOCA Flow global configuration.
[in]rssRSS global configuration for all port
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.
  • DOCA_ERROR_NO_MEMORY - memory allocation failed.

◆ doca_flow_cfg_set_definitions()

DOCA_EXPERIMENTAL doca_error_t doca_flow_cfg_set_definitions ( struct doca_flow_cfg *  cfg,
const struct doca_flow_definitions *  defs 
)

Set the definition object.

Parameters
[in]cfgDOCA Flow global configuration.
[in]defsA valid doca flow definitions object.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.

◆ doca_flow_cfg_set_mode_args()

DOCA_STABLE doca_error_t doca_flow_cfg_set_mode_args ( struct doca_flow_cfg *  cfg,
const char *  mode_args 
)

Set DOCA mode args.

Set the DOCA Flow architecture mode switch, vnf

Parameters
[in]cfgDOCA Flow global configuration.
[in]mode_argsDOCA Flow architecture mode
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.

◆ doca_flow_cfg_set_nr_acl_collisions()

DOCA_STABLE doca_error_t doca_flow_cfg_set_nr_acl_collisions ( struct doca_flow_cfg *  cfg,
uint8_t  nr_acl_collisions 
)

Set number of pre-configured collisions.

Get the number of pre-configured collisions for the acl module

Parameters
[in]cfgDOCA Flow global configuration.
[in]nr_acl_collisionsNumber pre-configured collisions
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.

◆ doca_flow_cfg_set_nr_counters()

DOCA_STABLE doca_error_t doca_flow_cfg_set_nr_counters ( struct doca_flow_cfg *  cfg,
uint32_t  nr_counters 
)

Set number of counters to configure.

Parameters
[in]cfgDOCA Flow global configuration.
[in]nr_countersNumber of counters to configure
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.

◆ doca_flow_cfg_set_nr_meters()

DOCA_STABLE doca_error_t doca_flow_cfg_set_nr_meters ( struct doca_flow_cfg *  cfg,
uint32_t  nr_meters 
)

Set number of traffic meters to configure.

Parameters
[in]cfgDOCA Flow global configuration.
[in]nr_metersNumber of traffic meters to configure
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.

◆ doca_flow_cfg_set_nr_shared_resource()

DOCA_STABLE doca_error_t doca_flow_cfg_set_nr_shared_resource ( struct doca_flow_cfg *  cfg,
uint32_t  nr_shared_resource,
enum doca_flow_shared_resource_type  type 
)

Set number of shared resource.

Set the number of shared resource per type

Parameters
[in]cfgDOCA Flow global configuration.
[in]nr_shared_resourceNumber of shared resource
[in]typeType of shared resource
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.

◆ doca_flow_cfg_set_pipe_queues()

DOCA_STABLE doca_error_t doca_flow_cfg_set_pipe_queues ( struct doca_flow_cfg *  cfg,
uint16_t  pipe_queues 
)

Set pipe queues.

Set the pipe's number of queues for each offload thread

Parameters
[in]cfgDOCA Flow global configuration
[in]pipe_queuesPipe queues
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.

◆ doca_flow_cfg_set_queue_depth()

DOCA_STABLE doca_error_t doca_flow_cfg_set_queue_depth ( struct doca_flow_cfg *  cfg,
uint32_t  queue_depth 
)

Set number of pre-configured queue_size.

Parameters
[in]cfgDOCA Flow global configuration.
[out]queue_depthNumber of pre-configured queue_size
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.

◆ doca_flow_cfg_set_rss_key()

DOCA_STABLE doca_error_t doca_flow_cfg_set_rss_key ( struct doca_flow_cfg *  cfg,
const uint8_t *  rss_key,
uint32_t  rss_key_len 
)

Set RSS hash key.

Parameters
[in]cfgDOCA Flow global configuration.
[in]rss_keyRSS hash key
[in]rss_key_lenLength of the RSS hash key in bytes
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.
  • DOCA_ERROR_NO_MEMORY - memory allocation failed.

◆ doca_flow_destroy()

DOCA_STABLE void doca_flow_destroy ( void  )

Destroy the doca flow.

Release all the resources used by doca flow.

Must be invoked at the end of the application, before it exits.

◆ doca_flow_entries_process()

DOCA_STABLE doca_error_t doca_flow_entries_process ( struct doca_flow_port *  port,
uint16_t  pipe_queue,
uint64_t  timeout,
uint32_t  max_processed_entries 
)

Process entries in queue.

The application must invoke this function in order to complete the flow rule offloading and to receive the flow rule operation status.

Parameters
[in]portPort
[in]pipe_queueQueue identifier.
[in]timeoutMax time in micro seconds for this function to process entries. Process once if timeout is 0
[in]max_processed_entriesFlow entries number to process If it is 0, it will proceed until timeout.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_DRIVER - driver error.

◆ doca_flow_get_target()

DOCA_EXPERIMENTAL doca_error_t doca_flow_get_target ( enum doca_flow_target_type  type,
struct doca_flow_target **  target 
)

Get doca flow forward target.

Parameters
[in]typeTarget type.
[out]targetTarget handler on success
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.
  • DOCA_ERROR_NOT_SUPPORTED - unsupported type.

◆ doca_flow_init()

DOCA_EXPERIMENTAL doca_error_t doca_flow_init ( struct doca_flow_cfg *  cfg)

Initialize the doca flow.

This is the global initialization function for doca flow. It initializes all resources used by doca flow.

Must be invoked first before any other function in this API. this is a one time call, used for doca flow initialization and global configurations.

Parameters
[in]cfgPort configuration, see doca_flow_cfg for details.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.
  • DOCA_ERROR_NO_MEMORY - memory allocation failed.
  • DOCA_ERROR_NOT_SUPPORTED - unsupported configuration.
  • DOCA_ERROR_UNKNOWN - otherwise.

◆ doca_flow_mpls_label_decode()

DOCA_EXPERIMENTAL doca_error_t doca_flow_mpls_label_decode ( const struct doca_flow_header_mpls mpls,
uint32_t *  label,
uint8_t *  traffic_class,
uint8_t *  ttl,
bool bottom_of_stack 
)

Decode an MPLS label header.

Note
: All output variables are in cpu-endian.
Parameters
[in]mplsPointer to MPLS structure to decode.
[out]labelPointer to fill MPLS label value.
[out]traffic_classPointer to fill MPLS traffic class value.
[out]ttlPointer to fill MPLS TTL value.
[out]bottom_of_stackPointer to fill whether this MPLS is bottom of stack.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.

◆ doca_flow_mpls_label_encode()

DOCA_EXPERIMENTAL doca_error_t doca_flow_mpls_label_encode ( uint32_t  label,
uint8_t  traffic_class,
uint8_t  ttl,
bool  bottom_of_stack,
struct doca_flow_header_mpls mpls 
)

Prepare an MPLS label header in big-endian.

Note
: All input variables are in cpu-endian.
Parameters
[in]labelThe label value - 20 bits.
[in]traffic_classTraffic class - 3 bits.
[in]ttlTime to live - 8 bits
[in]bottom_of_stackWhether this MPLS is bottom of stack.
[out]mplsPointer to MPLS structure to fill.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.

◆ doca_flow_parser_geneve_opt_create()

DOCA_EXPERIMENTAL doca_error_t doca_flow_parser_geneve_opt_create ( const struct doca_flow_port *  port,
const struct doca_flow_parser_geneve_opt_cfg  tlv_list[],
uint8_t  nb_options,
struct doca_flow_parser **  parser 
)

Creates GENEVE TLV parser for the selected port.

This function must be called before creation of any pipe using GENEVE option.

This API is port oriented, but the configuration is done once for all ports under the same physical device. Each port should call this API before using GENEVE options, but it must use the same options in the same order inside the list.

Each physical device has 7 DWs for GENEVE TLV options. Each nonzero element in 'data_mask' array consumes one DW, and choosing matchable mode for class consumes additional one. Calling this API for second port under same physical device doesn't consume more DW, it uses same configuration.

Parameters
[in]portPointer to doca flow port.
[in]tlv_listA list of GENEVE TLV options to create parser for them.
[in]nb_optionsThe number of options in TLV list.
[out]parserParser handler on success.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.
  • DOCA_ERROR_NO_MEMORY - memory allocation failed.
  • DOCA_ERROR_NOT_SUPPORTED - unsupported configuration.
  • DOCA_ERROR_ALREADY_EXIST - physical device already has parser, by either same or another port.
  • DOCA_ERROR_UNKNOWN - otherwise.

◆ doca_flow_parser_geneve_opt_destroy()

DOCA_EXPERIMENTAL doca_error_t doca_flow_parser_geneve_opt_destroy ( struct doca_flow_parser *  parser)

Destroy GENEVE TLV parser.

This function must be called after last use of GENEVE option and before port closing.

Parameters
[in]parserPointer to parser to be destroyed.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.
  • DOCA_ERROR_IN_USE - one of options is in used by a pipe.
  • DOCA_ERROR_DRIVER - there is no valid GENEVE TLV parser in this handle.
  • DOCA_ERROR_UNKNOWN - otherwise.

◆ doca_flow_pipe_acl_add_entry()

DOCA_EXPERIMENTAL doca_error_t doca_flow_pipe_acl_add_entry ( uint16_t  pipe_queue,
struct doca_flow_pipe *  pipe,
const struct doca_flow_match match,
const struct doca_flow_match match_mask,
const uint32_t  priority,
const struct doca_flow_fwd fwd,
const enum doca_flow_flags_type  flag,
void *  usr_ctx,
struct doca_flow_pipe_entry **  entry 
)

Add one new entry to a acl pipe.

This API will populate the acl entries

Parameters
pipe_queueQueue identifier.
pipePointer to pipe.
matchPointer to match, indicate specific packet match information.
match_maskPointer to match mask information.
priorityPriority value
fwdPointer to fwd actions.
flagFlow entry will be pushed to hw immediately or not. enum doca_flow_flags_type.
usr_ctxPointer to the user context. This context is associated with the entry and will be used during update and removal operations. Therefore, the pointer must remain valid for as long as the entry is valid.
[out]entryThe entry inserted.
Returns
Pipe entry handler on success, NULL otherwise and error is set.

◆ doca_flow_pipe_add_entry()

DOCA_EXPERIMENTAL doca_error_t doca_flow_pipe_add_entry ( uint16_t  pipe_queue,
struct doca_flow_pipe *  pipe,
const struct doca_flow_match match,
const struct doca_flow_actions actions,
const struct doca_flow_monitor monitor,
const struct doca_flow_fwd fwd,
uint32_t  flags,
void *  usr_ctx,
struct doca_flow_pipe_entry **  entry 
)

Add one new entry to a pipe.

When a packet matches a single pipe, will start HW offload. The pipe only defines which fields to match. When offloading, we need detailed information from packets, or we need to set some specific actions that the pipe did not define. The parameters include:

match: The packet detail fields according to the pipe definition. actions: The real actions according to the pipe definition. monitor: Defines the monitor actions if the pipe did not define it. fwd: Define the forward action if the pipe did not define it.

This API will do the actual HW offload, with the information from the fields of the input packets.

Parameters
[in]pipe_queueQueue identifier.
[in]pipePointer to pipe.
[in]matchPointer to match, indicate specific packet match information.
[in]actionsPointer to modify actions, indicate specific modify information.
[in]monitorPointer to monitor actions.
[in]fwdPointer to fwd actions.
[in]flagsFlow entry will be pushed to hw immediately or not. enum doca_flow_flags_type.
[in]usr_ctxPointer to the user context. This context is associated with the entry and will be used during update and removal operations. Therefore, the pointer must remain valid for as long as the entry is valid.
[out]entryPipe entry handler on success.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.
  • DOCA_ERROR_DRIVER - driver error.

◆ doca_flow_pipe_calc_hash()

DOCA_EXPERIMENTAL doca_error_t doca_flow_pipe_calc_hash ( struct doca_flow_pipe *  pipe,
const struct doca_flow_match match,
uint32_t *  hash 
)

calc the hash for a given match on a given pipe.

Calculates the hash value for a given pipe assuming the that the match parameter holds the values that the HW will see.

Parameters
[in]pipePointer to pipe.
[in]matchPointer to match, indicate specific packet match information.
[out]hashThe calculated hash on success.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.
  • DOCA_ERROR_DRIVER - driver error.

◆ doca_flow_pipe_cfg_create()

DOCA_STABLE doca_error_t doca_flow_pipe_cfg_create ( struct doca_flow_pipe_cfg **  cfg,
struct doca_flow_port *  port 
)

Create DOCA Flow pipe configuration struct.

Create and allocate DOCA Flow pipe configuration struct and set port

Parameters
[out]cfgDOCA Flow pipe configuration.
[in]portDOCA Flow port.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_NO_MEMORY - memory allocation failed.

◆ doca_flow_pipe_cfg_destroy()

DOCA_STABLE doca_error_t doca_flow_pipe_cfg_destroy ( struct doca_flow_pipe_cfg *  cfg)

Destroy DOCA Flow pipe configuration struct.

Free and destroy the DOCA Flow pipe configuration struct

Parameters
[in]cfgDOCA Flow pipe configuration.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.

◆ doca_flow_pipe_cfg_set_actions()

DOCA_EXPERIMENTAL doca_error_t doca_flow_pipe_cfg_set_actions ( struct doca_flow_pipe_cfg *  cfg,
struct doca_flow_actions *const *  actions,
struct doca_flow_actions *const *  actions_masks,
struct doca_flow_action_descs *const *  action_descs,
size_t  nr_actions 
)

Set pipe's actions, actions mask and actions descriptor.

Set pipe's actions, actions mask and actions descriptor. nr_actions must not be zero, and actions must not be NULL. actions_masks and action_descs can be NULL, meaning not set.

Parameters
[in]cfgDOCA Flow pipe configuration.
[in]actionsDOCA Flow actions array
[in]actions_masksDOCA Flow actions mask array
[in]action_descsDOCA Flow actions descriptor array
[in]nr_actionsNumber of actions
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.
  • DOCA_ERROR_NO_MEMORY - memory allocation failed.

◆ doca_flow_pipe_cfg_set_congestion_level_threshold()

DOCA_STABLE doca_error_t doca_flow_pipe_cfg_set_congestion_level_threshold ( struct doca_flow_pipe_cfg *  cfg,
uint8_t  congestion_level_threshold 
)

Set pipe's congestion level threshold.

Set congestion threshold for pipe in percentage (0,100] - pipe notification.

Parameters
[in]cfgDOCA Flow pipe configuration.
[in]congestion_level_thresholdcongestion level threshold
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.

◆ doca_flow_pipe_cfg_set_dir_info()

DOCA_EXPERIMENTAL doca_error_t doca_flow_pipe_cfg_set_dir_info ( struct doca_flow_pipe_cfg *  cfg,
enum doca_flow_direction_info  dir_info 
)

Set pipe's Direction info.

Set pipe's Direction info. This is an optional direction hint for driver optimization, supported in switch mode only.

Parameters
[in]cfgDOCA Flow pipe configuration.
[in]dir_infoDOCA Flow direction info.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.

◆ doca_flow_pipe_cfg_set_domain()

DOCA_STABLE doca_error_t doca_flow_pipe_cfg_set_domain ( struct doca_flow_pipe_cfg *  cfg,
enum doca_flow_pipe_domain  domain 
)

Set pipe's domain.

Parameters
[in]cfgDOCA Flow pipe configuration.
[in]domainDOCA Flow pipe steering domain
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.
  • DOCA_ERROR_ALREADY_EXIST - domain was already set.

◆ doca_flow_pipe_cfg_set_excluded_queue()

DOCA_EXPERIMENTAL doca_error_t doca_flow_pipe_cfg_set_excluded_queue ( struct doca_flow_pipe_cfg *  cfg,
uint16_t  pipe_queue 
)

Set pipe_queue as excluded in the pipe.

Parameters
[in]cfgDOCA Flow pipe configuration.
[in]pipe_queueThe pipe_queue to exclude
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.

◆ doca_flow_pipe_cfg_set_hash_map_algorithm()

DOCA_EXPERIMENTAL doca_error_t doca_flow_pipe_cfg_set_hash_map_algorithm ( struct doca_flow_pipe_cfg *  cfg,
uint32_t  algorithm_flags 
)

Set pipe map algorithm - supported only in hash pipe.

Parameters
[in]cfgDOCA Flow pipe configuration.
[in]algorithm_flagsAlgorithms to use in the pipe. enum doca_flow_pipe_hash_map_algorithm.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.

◆ doca_flow_pipe_cfg_set_is_resizable()

DOCA_STABLE doca_error_t doca_flow_pipe_cfg_set_is_resizable ( struct doca_flow_pipe_cfg *  cfg,
bool  is_resizable 
)

Set if the pipe supports the resize operation.

Parameters
[in]cfgDOCA Flow pipe configuration.
[in]is_resizableIf the pipe is resizable.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.

◆ doca_flow_pipe_cfg_set_is_root()

DOCA_STABLE doca_error_t doca_flow_pipe_cfg_set_is_root ( struct doca_flow_pipe_cfg *  cfg,
bool  is_root 
)

Set if pipe is root or not.

Set if pipe is root or not. If true it means the pipe is a root pipe executed on packet arrival.

Parameters
[in]cfgDOCA Flow pipe configuration.
[in]is_rootIf the pipe is root.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.

◆ doca_flow_pipe_cfg_set_label()

DOCA_EXPERIMENTAL doca_error_t doca_flow_pipe_cfg_set_label ( struct doca_flow_pipe_cfg *  cfg,
const char *  label 
)

Sets the label for the given pipe.

The label is a text string that can be used to identify or describe the pipe.

Parameters
[in]cfgDOCA Flow pipe configuration.
[in]labelA string containing the label to be set.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.
  • DOCA_ERROR_NO_MEMORY - memory allocation failed.

◆ doca_flow_pipe_cfg_set_match()

DOCA_EXPERIMENTAL doca_error_t doca_flow_pipe_cfg_set_match ( struct doca_flow_pipe_cfg *  cfg,
const struct doca_flow_match match,
const struct doca_flow_match match_mask 
)

Set pipe's match and match mask.

Parameters
[in]cfgDOCA Flow pipe configuration.
[in]matchDOCA Flow match
[in]match_maskDOCA Flow match mask
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.
  • DOCA_ERROR_NO_MEMORY - memory allocation failed.

◆ doca_flow_pipe_cfg_set_miss_counter()

DOCA_EXPERIMENTAL doca_error_t doca_flow_pipe_cfg_set_miss_counter ( struct doca_flow_pipe_cfg *  cfg,
bool  miss_counter 
)

Set to enable pipe's miss counter.

Set to enable pipe's missed flows counter, can be queried with doca_flow_resource_query_pipe_miss().

Parameters
[in]cfgDOCA Flow pipe configuration.
[in]miss_counterIf to enable miss counter
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.

◆ doca_flow_pipe_cfg_set_monitor()

DOCA_EXPERIMENTAL doca_error_t doca_flow_pipe_cfg_set_monitor ( struct doca_flow_pipe_cfg *  cfg,
const struct doca_flow_monitor monitor 
)

Set pipe's monitor.

Parameters
[in]cfgDOCA Flow pipe configuration.
[in]monitorDOCA Flow monitor
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.
  • DOCA_ERROR_NO_MEMORY - memory allocation failed.

◆ doca_flow_pipe_cfg_set_name()

DOCA_STABLE doca_error_t doca_flow_pipe_cfg_set_name ( struct doca_flow_pipe_cfg *  cfg,
const char *  name 
)

Set pipe's name.

Parameters
[in]cfgDOCA Flow pipe configuration.
[in]namePipe name
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.
  • DOCA_ERROR_NO_MEMORY - memory allocation failed.

◆ doca_flow_pipe_cfg_set_nr_entries()

DOCA_STABLE doca_error_t doca_flow_pipe_cfg_set_nr_entries ( struct doca_flow_pipe_cfg *  cfg,
uint32_t  nr_entries 
)

Set pipe's maximum number of flow rules.

Set pipe's maximum number of flow rules, default is 8k if not set.

Parameters
[in]cfgDOCA Flow pipe configuration.
[in]nr_entriesMaximum number of flow rules
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.

◆ doca_flow_pipe_cfg_set_ordered_lists()

DOCA_EXPERIMENTAL doca_error_t doca_flow_pipe_cfg_set_ordered_lists ( struct doca_flow_pipe_cfg *  cfg,
struct doca_flow_ordered_list *const *  ordered_lists,
size_t  nr_ordered_lists 
)

Set pipe's ordered lists.

Parameters
[in]cfgDOCA Flow pipe configuration.
[in]ordered_listsDOCA Flow ordered lists array
[in]nr_ordered_listsNumber of ordered lists
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.
  • DOCA_ERROR_NO_MEMORY - memory allocation failed.

◆ doca_flow_pipe_cfg_set_type()

DOCA_STABLE doca_error_t doca_flow_pipe_cfg_set_type ( struct doca_flow_pipe_cfg *  cfg,
enum doca_flow_pipe_type  type 
)

Set pipe's type.

Parameters
[in]cfgDOCA Flow pipe configuration.
[in]typeDOCA Flow pipe type
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.

◆ doca_flow_pipe_cfg_set_user_ctx()

DOCA_STABLE doca_error_t doca_flow_pipe_cfg_set_user_ctx ( struct doca_flow_pipe_cfg *  cfg,
void *  user_ctx 
)

Set pipe's user context.

Set pipe's user context - pipe notification.

Parameters
[in]cfgDOCA Flow pipe configuration.
[in]user_ctxUser context
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.

◆ doca_flow_pipe_control_add_entry()

DOCA_EXPERIMENTAL doca_error_t doca_flow_pipe_control_add_entry ( uint16_t  pipe_queue,
uint32_t  priority,
struct doca_flow_pipe *  pipe,
const struct doca_flow_match match,
const struct doca_flow_match match_mask,
const struct doca_flow_match_condition condition,
const struct doca_flow_actions actions,
const struct doca_flow_actions actions_mask,
const struct doca_flow_action_descs action_descs,
const struct doca_flow_monitor monitor,
const struct doca_flow_fwd fwd,
void *  usr_ctx,
struct doca_flow_pipe_entry **  entry 
)

Add one new entry to a control pipe.

Refer to doca_flow_pipe_add_entry.

Parameters
[in]pipe_queueQueue identifier.
[in]priorityPriority value.
[in]pipePointer to pipe.
[in]matchPointer to match, indicate specific packet match information.
[in]match_maskPointer to match mask information.
[in]conditionPointer to match condition information.
[in]actionsPointer to modify actions, indicate specific modify information.
[in]actions_maskPointer to modify actions' mask, indicate specific modify information.
[in]action_descsaction descriptions
[in]monitorPointer to monitor actions.
[in]fwdPointer to fwd actions.
[in]usr_ctxPointer to the user context. This context is associated with the entry and will be used during update and removal operations. Therefore, the pointer must remain valid for as long as the entry is valid.
[out]entryPipe entry handler on success.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.
  • DOCA_ERROR_DRIVER - driver error.
  • DOCA_ERROR_NOT_SUPPORTED - unsupported pipe type.

◆ doca_flow_pipe_create()

DOCA_EXPERIMENTAL doca_error_t doca_flow_pipe_create ( const struct doca_flow_pipe_cfg *  cfg,
const struct doca_flow_fwd fwd,
const struct doca_flow_fwd fwd_miss,
struct doca_flow_pipe **  pipe 
)

Create one new pipe.

Create new pipeline to match and offload specific packets, the pipe configuration includes the following components:

match: Match one packet by inner or outer fields.
match_mask: The mask for the matched items.
actions: Includes the modify specific packets fields, Encap and
             Decap actions.
monitor: Includes Count, Age, and Meter actions.
fwd: The destination of the matched action, include RSS, Hairpin,
        Port, and Drop actions.

This API will create the pipe, but would not start the HW offload.

Parameters
[in]cfgPipe configuration.
[in]fwdFwd configuration for the pipe.
[in]fwd_missFwd_miss configuration for the pipe. NULL for no fwd_miss. When creating a pipe if there is a miss and fwd_miss configured, packet steering should jump to it.
[out]pipePipe handler on success.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.
  • DOCA_ERROR_NOT_SUPPORTED - unsupported pipe type.
  • DOCA_ERROR_DRIVER - driver error.
  • DOCA_ERROR_TOO_BIG - pipe specs exceed capability

◆ doca_flow_pipe_destroy()

DOCA_STABLE void doca_flow_pipe_destroy ( struct doca_flow_pipe *  pipe)

Destroy one pipe.

Destroy the pipe, and the pipe entries that match this pipe.

Parameters
[in]pipePointer to pipe.

◆ doca_flow_pipe_dump()

DOCA_EXPERIMENTAL void doca_flow_pipe_dump ( struct doca_flow_pipe *  pipe,
FILE *  f 
)

Dump pipe information (not including the entries)

Parameters
[in]pipePointer to doca flow pipe.
[in]fThe output file of the pipe information.

◆ doca_flow_pipe_entry_get_status()

DOCA_STABLE enum doca_flow_entry_status doca_flow_pipe_entry_get_status ( struct doca_flow_pipe_entry *  entry)

Get entry's status.

Parameters
[in]entrypipe entry
Returns
entry's status

◆ doca_flow_pipe_hash_add_entry()

DOCA_EXPERIMENTAL doca_error_t doca_flow_pipe_hash_add_entry ( uint16_t  pipe_queue,
struct doca_flow_pipe *  pipe,
uint32_t  entry_index,
const struct doca_flow_actions actions,
const struct doca_flow_monitor monitor,
const struct doca_flow_fwd fwd,
const enum doca_flow_flags_type  flags,
void *  usr_ctx,
struct doca_flow_pipe_entry **  entry 
)

Add one new entry to an hash pipe.

Refer to doca_flow_pipe_add_entry.

Parameters
pipe_queueQueue identifier.
pipePointer to pipe.
entry_indexStatic index in pipe for this entry.
actionsPointer to modify actions, indicate specific modify information.
monitorPointer to monitor actions.
fwdPointer to forward actions.
flagsFlow entry will be pushed to HW immediately or not. enum doca_flow_flags_type.
usr_ctxPointer to the user context. This context is associated with the entry and will be used during removal operation. Therefore, the pointer must remain valid for as long as the entry is valid.
[out]entryPipe entry handler on success.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.
  • DOCA_ERROR_DRIVER - driver error.

◆ doca_flow_pipe_lpm_add_entry()

DOCA_EXPERIMENTAL doca_error_t doca_flow_pipe_lpm_add_entry ( uint16_t  pipe_queue,
struct doca_flow_pipe *  pipe,
const struct doca_flow_match match,
const struct doca_flow_match match_mask,
const struct doca_flow_actions actions,
const struct doca_flow_monitor monitor,
const struct doca_flow_fwd fwd,
const enum doca_flow_flags_type  flag,
void *  usr_ctx,
struct doca_flow_pipe_entry **  entry 
)

Add one new entry to a lpm pipe.

This API will populate the lpm entries

Parameters
[in]pipe_queueQueue identifier.
[in]pipePointer to pipe.
[in]matchPointer to match, indicate specific packet match information.
[in]match_maskPointer to match mask information.
[in]actionsPointer to modify actions, indicate specific modify information.
[in]monitorPointer to monitor actions.
[in]fwdPointer to fwd actions.
[in]flagFlow entry will be pushed to hw immediately or not. enum doca_flow_flags_type.
[in]usr_ctxPointer to the user context. This context is associated with the entry and will be used during update and removal operations. Therefore, the pointer must remain valid for as long as the entry is valid.
[out]entryPipe entry handler on success.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.
  • DOCA_ERROR_DRIVER - driver error.

◆ doca_flow_pipe_lpm_update_entry()

DOCA_EXPERIMENTAL doca_error_t doca_flow_pipe_lpm_update_entry ( uint16_t  pipe_queue,
struct doca_flow_pipe *  pipe,
const struct doca_flow_actions actions,
const struct doca_flow_monitor monitor,
const struct doca_flow_fwd fwd,
const enum doca_flow_flags_type  flags,
struct doca_flow_pipe_entry *  entry 
)

Update the lpm pipe entry with new actions.

Parameters
[in]pipe_queueQueue identifier.
[in]pipePointer to pipe.
[in]actionsPointer to modify actions, indicate specific modify information.
[in]monitorPointer to monitor actions.
[in]fwdPointer to fwd actions.
[in]flagsFlow entry will be pushed to hw immediately or not. enum doca_flow_flags_type.
[in]entryThe pipe entry to be updated.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.
  • DOCA_ERROR_DRIVER - driver error.
  • DOCA_ERROR_AGAIN - resource temporarily unavailable, try again

◆ doca_flow_pipe_ordered_list_add_entry()

DOCA_EXPERIMENTAL doca_error_t doca_flow_pipe_ordered_list_add_entry ( uint16_t  pipe_queue,
struct doca_flow_pipe *  pipe,
uint32_t  idx,
const struct doca_flow_ordered_list ordered_list,
const struct doca_flow_fwd fwd,
enum doca_flow_flags_type  flags,
void *  user_ctx,
struct doca_flow_pipe_entry **  entry 
)

Add an entry to the ordered list pipe.

Parameters
[in]pipe_queueQueue identifier.
[in]pipePipe handle.
[in]idxUnique entry index. It is the user's responsibility to ensure uniqueness.
[in]ordered_listOrdered list with pointers to struct doca_flow_actions and struct doca_flow_monitor at the same indices as they were at the pipe creation time. If the configuration contained an element of struct doca_flow_action_descs, the corresponding array element is ignored and can be NULL.
[in]fwdEntry forward configuration.
[in]flagsEntry insertion flags.
[in]user_ctxPointer to the user context. This context is associated with the entry and will be used during removal operation. Therefore, the pointer must remain valid for as long as the entry is valid.
[out]entryThe entry inserted.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.
  • DOCA_ERROR_NO_MEMORY - memory allocation failed.
  • DOCA_ERROR_DRIVER - driver error.

◆ doca_flow_pipe_remove_entry()

DOCA_STABLE doca_error_t doca_flow_pipe_remove_entry ( uint16_t  pipe_queue,
uint32_t  flags,
struct doca_flow_pipe_entry *  entry 
)

Free one pipe entry.

This API will free the pipe entry and cancel HW offload. The Application receives the entry pointer upon creation and if can call this function when there is no more need for this offload. For example, if the entry aged, use this API to free it.

Parameters
[in]pipe_queueQueue identifier.
[in]flagsFlow entry will be removed from hw immediately or not. enum doca_flow_flags_type.
[in]entryThe pipe entry to be removed.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.
  • DOCA_ERROR_NOT_SUPPORTED - unsupported pipe type.
  • DOCA_ERROR_UNKNOWN - otherwise.

◆ doca_flow_pipe_resize()

DOCA_STABLE doca_error_t doca_flow_pipe_resize ( struct doca_flow_pipe *  pipe,
uint8_t  new_congestion_level,
doca_flow_pipe_resize_nr_entries_changed_cb  nr_entries_changed_cb,
doca_flow_pipe_resize_entry_relocate_cb  entry_relocation_cb 
)

Resize pipe.

Parameters
[in]pipePointer to pipe.
[in]new_congestion_levelPushback the pipe current congestion level to a new value.
[in]nr_entries_changed_cbNumber of entries after resize.
[in]entry_relocation_cbEntry relocate behavior.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.
  • DOCA_ERROR_DRIVER - driver error.

◆ doca_flow_pipe_update_entry()

DOCA_EXPERIMENTAL doca_error_t doca_flow_pipe_update_entry ( uint16_t  pipe_queue,
struct doca_flow_pipe *  pipe,
const struct doca_flow_actions actions,
const struct doca_flow_monitor monitor,
const struct doca_flow_fwd fwd,
const enum doca_flow_flags_type  flags,
struct doca_flow_pipe_entry *  entry 
)

Update the pipe entry with new actions.

Parameters
[in]pipe_queueQueue identifier.
[in]pipePointer to pipe.
[in]actionsPointer to modify actions, indicate specific modify information.
[in]monitorPointer to monitor actions.
[in]fwdPointer to fwd actions.
[in]flagsFlow entry will be pushed to hw immediately or not. enum doca_flow_flags_type.
[in]entryThe pipe entry to be updated.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.
  • DOCA_ERROR_DRIVER - driver error.
  • DOCA_ERROR_NOT_SUPPORTED - unsupported pipe type.
  • DOCA_ERROR_AGAIN - resource temporarily unavailable, try again

◆ doca_flow_pipe_update_miss()

DOCA_EXPERIMENTAL doca_error_t doca_flow_pipe_update_miss ( struct doca_flow_pipe *  pipe,
const struct doca_flow_fwd fwd_miss 
)

Update the forward miss action.

Parameters
[in]pipeThe pipe to update its miss action.
[in]fwd_missA new fwd_miss configuration for the pipe.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.
  • DOCA_ERROR_NOT_SUPPORTED - unsupported forward request.
  • DOCA_ERROR_UNKNOWN - otherwise.

◆ doca_flow_port_calc_entropy()

DOCA_EXPERIMENTAL doca_error_t doca_flow_port_calc_entropy ( struct doca_flow_port *  port,
struct doca_flow_entropy_format header,
uint16_t *  entropy 
)

Calculate the entropy.

Calculate the entropy as it would have been calculated by the HW.

Parameters
[in]portThe given port for the entropy calculation.
[in]headerPointer to the header that holds the fields that are the base for the entropy calculation.
[out]entropyUsed to return the calculated entropy. It will be written in network order.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.
  • DOCA_ERROR_UNKNOWN - otherwise.

◆ doca_flow_port_cfg_create()

DOCA_STABLE doca_error_t doca_flow_port_cfg_create ( struct doca_flow_port_cfg **  cfg)

Create DOCA Flow port configuration struct.

Create and allocate DOCA Flow port configuration struct

Parameters
[out]cfgDOCA Flow port configuration.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_NO_MEMORY - memory allocation failed.

◆ doca_flow_port_cfg_destroy()

DOCA_STABLE doca_error_t doca_flow_port_cfg_destroy ( struct doca_flow_port_cfg *  cfg)

Destroy DOCA Flow port configuration struct.

Free and destroy the DOCA Flow port configuration struct

Parameters
[in]cfgDOCA Flow port configuration.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.

◆ doca_flow_port_cfg_set_actions_mem_size()

DOCA_EXPERIMENTAL doca_error_t doca_flow_port_cfg_set_actions_mem_size ( struct doca_flow_port_cfg *  cfg,
uint32_t  size 
)

Set max memory size used by actions.

Set max memory which will be used by actions in this port. Default is zero.

Parameters
[in]cfgDOCA Flow port configuration.
[in]sizeThe memory size in byte, should be power of two and not less than 64B.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.

◆ doca_flow_port_cfg_set_dev()

DOCA_EXPERIMENTAL doca_error_t doca_flow_port_cfg_set_dev ( struct doca_flow_port_cfg *  cfg,
struct doca_dev *  dev 
)

Set port's device.

Parameters
[in]cfgDOCA Flow port configuration.
[in]devDevice
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.

◆ doca_flow_port_cfg_set_dev_rep()

DOCA_EXPERIMENTAL doca_error_t doca_flow_port_cfg_set_dev_rep ( struct doca_flow_port_cfg *  cfg,
struct doca_dev_rep *  dev 
)

Set port's device for representor.

Calling this function also indicates the port is representor.

Parameters
[in]cfgDOCA Flow port configuration.
[in]devDoca device representor.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.

◆ doca_flow_port_cfg_set_devargs()

DOCA_STABLE doca_error_t doca_flow_port_cfg_set_devargs ( struct doca_flow_port_cfg *  cfg,
const char *  devargs 
)

Set devargs.

Set specific configuration per port type

Parameters
[in]cfgDOCA Flow port configuration
[in]devargsSpecific configuration per port type
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.
  • DOCA_ERROR_NO_MEMORY - memory allocation failed.

◆ doca_flow_port_cfg_set_ipsec_sn_offload_disable()

DOCA_STABLE doca_error_t doca_flow_port_cfg_set_ipsec_sn_offload_disable ( struct doca_flow_port_cfg *  cfg)

Disable SN offload for ipsec - Anti-replay and sn increment will not be activated.

Parameters
[in]cfgDOCA Flow port configuration.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.

◆ doca_flow_port_cfg_set_operation_state()

DOCA_EXPERIMENTAL doca_error_t doca_flow_port_cfg_set_operation_state ( struct doca_flow_port_cfg *  cfg,
enum doca_flow_port_operation_state  state 
)

Set default rules operation state.

Note
If this setter is not called, the default state is DOCA_FLOW_PORT_OPERATION_STATE_ACTIVE.
Parameters
[in]cfgDOCA Flow port configuration.
[in]stateThe desired operation state for the port instance.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.

◆ doca_flow_port_cfg_set_port_id()

DOCA_EXPERIMENTAL doca_error_t doca_flow_port_cfg_set_port_id ( struct doca_flow_port_cfg *  cfg,
uint16_t  port_id 
)

Set the logical port ID.

Assigns a logical port ID to the specified DOCA Flow port.

Parameters
[in]cfgPointer to the DOCA Flow port configuration.
[in]port_idLogical port ID to assign to the port.
Returns
  • DOCA_SUCCESS on success.
  • Error code on failure:
    • DOCA_ERROR_INVALID_VALUE if the input is invalid.

◆ doca_flow_port_cfg_set_priv_data_size()

DOCA_STABLE doca_error_t doca_flow_port_cfg_set_priv_data_size ( struct doca_flow_port_cfg *  cfg,
uint16_t  priv_data_size 
)

Set user private data size.

Parameters
[in]cfgDOCA Flow port configuration.
[in]priv_data_sizeUser private data size
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.

◆ doca_flow_port_cfg_set_rss_cfg()

DOCA_EXPERIMENTAL doca_error_t doca_flow_port_cfg_set_rss_cfg ( struct doca_flow_port_cfg *  cfg,
const struct doca_flow_resource_rss_cfg rss_cfg 
)

Set RSS optional configuration.

Parameters
[in]cfgDOCA Flow port configuration.
[in]rss_cfgRSS configuration
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.
  • DOCA_ERROR_NO_MEMORY - memory allocation failed.

◆ doca_flow_port_cfg_set_service_threads_core()

DOCA_EXPERIMENTAL doca_error_t doca_flow_port_cfg_set_service_threads_core ( struct doca_flow_port_cfg *  cfg,
uint32_t  core 
)

Set service threads execution cpu core.

Set cpu core which will be used by service threads in this port. Default is zero. Current supported service threads: counters cache threads

Parameters
[in]cfgDOCA Flow port configuration.
[in]coreThe cpu core number.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.

◆ doca_flow_port_cfg_set_service_threads_cycle()

DOCA_EXPERIMENTAL doca_error_t doca_flow_port_cfg_set_service_threads_cycle ( struct doca_flow_port_cfg *  cfg,
uint32_t  cycle_ms 
)

Set service threads max execution cycle.

Defines the minimum time between two consecutive thread cycle executions in port. Default is 1000 ms (1 sec). Current supported service threads: counters cache threads

Parameters
[in]cfgDOCA Flow port configuration.
[in]cycle_msThe service threads cycle in ms.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.

◆ doca_flow_port_operation_state_modify()

DOCA_EXPERIMENTAL doca_error_t doca_flow_port_operation_state_modify ( struct doca_flow_port *  port,
enum doca_flow_port_operation_state  state 
)

Modifies the operation state of a port instance.

This function changes the operation state of the given port instance. If the port instance already has the required state, the function returns DOCA_SUCCESS without performing any operations.

Warning
Two instances cannot be in the same operation state simultaneously except DOCA_FLOW_PORT_OPERATION_STATE_UNCONNECTED.
Parameters
[in]portPointer to the DOCA port instance.
[in]stateThe desired operation state for the port instance.
Returns
DOCA_SUCCESS - if successful. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.
  • DOCA_ERROR_NO_MEMORY - memory allocation failed.
  • DOCA_ERROR_NOT_SUPPORTED - not supported in the current run mode.
  • DOCA_ERROR_NOT_PERMITTED - operation not permitted.
  • DOCA_ERROR_ALREADY_EXIST - another instance exists with the same state.
  • DOCA_ERROR_UNKNOWN - unknown error.

◆ doca_flow_port_pair()

DOCA_EXPERIMENTAL doca_error_t doca_flow_port_pair ( struct doca_flow_port *  port,
struct doca_flow_port *  pair_port 
)

pair two doca flow ports.

This API should be used to pair two doca ports. This pair should be the same as the actual physical layer paired information. Those two pair ports have no order, a port cannot be paired with itself.

In this API, default behavior will be handled according to each modes. In VNF mode, pair information will be translated to queue action to redirect packets to it's pair port. In REMOTE_VNF mode, default rules will be created to redirect packets between 2 pair ports.

Parameters
[in]portPointer to doca flow port.
[in]pair_portPointer to the pair port.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.
  • DOCA_ERROR_NO_MEMORY - memory allocation failed.
  • DOCA_ERROR_NOT_SUPPORTED - not supported in the current run mode.
  • DOCA_ERROR_UNKNOWN - otherwise.

◆ doca_flow_port_pipes_dump()

DOCA_EXPERIMENTAL void doca_flow_port_pipes_dump ( struct doca_flow_port *  port,
FILE *  f 
)

Dump pipes of one port.

Dump all pipes information belong to this port.

Parameters
[in]portPointer to doca flow port.
[in]fThe output file of the pipe information.

◆ doca_flow_port_pipes_flush()

DOCA_STABLE void doca_flow_port_pipes_flush ( struct doca_flow_port *  port)

Flush pipes of one port.

Destroy all pipes and all pipe entries belonging to the port.

Parameters
[in]portPointer to doca flow port.

◆ doca_flow_port_priv_data()

DOCA_STABLE uint8_t* doca_flow_port_priv_data ( struct doca_flow_port *  port)

Get pointer of user private data.

User can manage specific data structure in port structure. The size of the data structure is given on port configuration. See doca_flow_cfg for more details.

Parameters
[in]portPort struct.
Returns
Private data head pointer.

◆ doca_flow_port_start()

DOCA_EXPERIMENTAL doca_error_t doca_flow_port_start ( const struct doca_flow_port_cfg *  cfg,
struct doca_flow_port **  port 
)

Start a doca port.

Start a port with the given configuration. Will create one port in the doca flow layer, allocate all resources used by this port, and create the default offload logic for traffic.

Parameters
[in]cfgPort configuration, see doca_flow_cfg for details.
[out]portPort handler on success.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.
  • DOCA_ERROR_NO_MEMORY - memory allocation failed.
  • DOCA_ERROR_NOT_SUPPORTED - unsupported port type.
  • DOCA_ERROR_NOT_PERMITTED - operation not permitted.
  • DOCA_ERROR_ALREADY_EXIST - another instance has the same operation state.
  • DOCA_ERROR_UNKNOWN - otherwise.

◆ doca_flow_port_stop()

DOCA_STABLE doca_error_t doca_flow_port_stop ( struct doca_flow_port *  port)

Stop a doca port.

Stop the port, disable the traffic, destroy the doca port, free all resources of the port.

Parameters
[in]portPort struct.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.
  • DOCA_ERROR_IN_USE - port resources in use.
  • DOCA_ERROR_UNKNOWN - otherwise.

◆ doca_flow_port_switch_get()

DOCA_STABLE struct doca_flow_port* doca_flow_port_switch_get ( const struct doca_flow_port *  port)

Get doca flow switch port.

Parameters
[in]portThe port for which to get the switch port. If NULL, get the first switch port created. The application could use this function to get the doca switch port, then create pipes and pipe entries on this port.
Returns
The parent switch port number or NULL if none found

◆ doca_flow_resource_query_entry()

DOCA_EXPERIMENTAL doca_error_t doca_flow_resource_query_entry ( struct doca_flow_pipe_entry *  entry,
struct doca_flow_resource_query query_stats 
)

Extract information about specific entry.

Query the packet statistics about specific pipe entry

Parameters
[in]entryThe pipe entry to query.
[in]query_statsData retrieved by the query.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.
  • DOCA_ERROR_UNKNOWN - otherwise.

◆ doca_flow_resource_query_pipe_miss()

DOCA_EXPERIMENTAL doca_error_t doca_flow_resource_query_pipe_miss ( struct doca_flow_pipe *  pipe,
struct doca_flow_resource_query query_stats 
)

Extract information about pipe miss entry.

Query the packet statistics about specific pipe miss entry

Parameters
[in]pipeThe pipe to query.
[in]query_statsData retrieved by the query.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.
  • DOCA_ERROR_UNKNOWN - otherwise.

◆ doca_flow_shared_resource_set_cfg()

DOCA_EXPERIMENTAL doca_error_t doca_flow_shared_resource_set_cfg ( enum doca_flow_shared_resource_type  type,
uint32_t  id,
struct doca_flow_shared_resource_cfg cfg 
)

Configure a single shared resource.

This API can be used by bounded and unbounded resources.

Parameters
[in]typeShared resource type.
[in]idShared resource id.
[in]cfgPointer to a shared resource configuration.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.
  • DOCA_ERROR_NO_MEMORY - memory allocation failed.
  • DOCA_ERROR_NOT_SUPPORTED - unsupported shared resource type.
  • DOCA_ERROR_UNKNOWN - otherwise.

◆ doca_flow_shared_resources_bind()

DOCA_STABLE doca_error_t doca_flow_shared_resources_bind ( enum doca_flow_shared_resource_type  type,
uint32_t *  res_array,
uint32_t  res_array_len,
void *  bindable_obj 
)

Binds a bulk of shared resources to a bindable object.

Binds a bulk of shared resources from the same type to a bindable object. Currently the bindable objects are ports and pipes.

Parameters
[in]typeShared resource type.
[in]res_arrayArray of shared resource IDs.
[in]res_array_lenShared resource IDs array length.
[in]bindable_objPointer to an allowed bindable object, use NULL to bind globally.
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.
  • DOCA_ERROR_NO_MEMORY - memory allocation failed.
  • DOCA_ERROR_NOT_SUPPORTED - unsupported shared resource type.
  • DOCA_ERROR_UNKNOWN - otherwise.

◆ doca_flow_shared_resources_query()

DOCA_EXPERIMENTAL doca_error_t doca_flow_shared_resources_query ( enum doca_flow_shared_resource_type  type,
uint32_t *  res_array,
struct doca_flow_resource_query query_results_array,
uint32_t  array_len 
)

Extract information about shared counter.

Query an array of shared objects of a specific type.

Parameters
[in]typeShared object type.
[in]res_arrayArray of shared objects IDs to query.
[in]query_results_arrayData array retrieved by the query.
[in]array_lenNumber of objects and their query results in their arrays (same number).
Returns
DOCA_SUCCESS - in case of success. Error code - in case of failure:
  • DOCA_ERROR_INVALID_VALUE - received invalid input.
  • DOCA_ERROR_NO_MEMORY - memory allocation failed.
  • DOCA_ERROR_NOT_SUPPORTED - unsupported shared resource type.
  • DOCA_ERROR_UNKNOWN - otherwise.