35 #define DEFAULT_QUEUE_DEPTH 128
36 #define DEFAULT_TIMEOUT_US 10000
116 DOCA_LOG_ERR(
"Entries acquisition callback must be provided");
121 DOCA_LOG_ERR(
"Aging callback must be provided when enable handle aging");
126 DOCA_LOG_ERR(
"Queue depth should be at least twice larger than nb_entries");
146 goto free_program_ctx;
152 goto free_queue_counter;
154 for (i = 0; i < skeleton_cfg->
nb_ports; i++) {
160 for (j = 0; j < i; j++)
163 goto free_queue_state;
170 goto free_queue_state_raw;
176 goto destroy_flow_cfg;
182 goto destroy_flow_cfg;
188 goto destroy_flow_cfg;
195 goto destroy_flow_cfg;
201 goto free_queue_state_raw;
209 free_queue_state_raw:
210 for (i = 0; i < skeleton_cfg->
nb_ports; i++)
258 switch (
entry->ctx.type) {
275 entry->ctx.match_mask,
278 entry->ctx.actions_mask,
279 entry->ctx.action_descs,
289 entry->ctx.match_mask,
301 entry->ctx.match_mask,
312 entry->ctx.ordered_list,
381 DOCA_LOG_ERR(
"Failed to add/remove entry in index [%d]: %s",
404 for (port_id = 0; port_id < params->
nb_ports; port_id++) {
420 for (port_id = 0; port_id < params->
nb_ports; port_id++) {
447 for (port_id = 0; port_id < params->
nb_ports; port_id++) {
static struct doca_flow_pipe_entry * entry[MAX_ENTRIES]
doca_error_t flow_skeleton_init(struct doca_flow_cfg *flow_cfg, struct flow_skeleton_cfg *skeleton_cfg)
static doca_error_t add_entry(uint16_t pipe_queue, uint32_t flag, struct flow_skeleton_entry *entry)
void flow_skeleton_main_loop(void *main_loop_params)
#define DEFAULT_TIMEOUT_US
void flow_skeleton_destroy(void)
DOCA_LOG_REGISTER(FLOW_SKELETON)
static void add_batch_entries(struct main_loop_params *params, uint32_t nb_entries, int port_id)
static void process_callback(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)
#define DEFAULT_QUEUE_DEPTH
void flow_skeleton_notify_exit(void)
static volatile bool force_quit
enum doca_error doca_error_t
DOCA API return codes.
DOCA_STABLE const char * doca_error_get_descr(doca_error_t error)
Returns the description string of an error code.
@ DOCA_ERROR_INVALID_VALUE
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_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.
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.
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.
doca_flow_entry_op
doca flow entry operation
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.
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.
DOCA_STABLE doca_error_t doca_flow_cfg_create(struct doca_flow_cfg **cfg)
Create DOCA Flow configuration struct.
DOCA_EXPERIMENTAL doca_error_t doca_flow_init(struct doca_flow_cfg *cfg)
Initialize the doca flow.
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.
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.
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.
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.
doca_flow_entry_status
doca flow entry status
DOCA_STABLE void doca_flow_destroy(void)
Destroy the doca flow.
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.
DOCA_STABLE doca_error_t doca_flow_cfg_set_pipe_queues(struct doca_flow_cfg *cfg, uint16_t pipe_queues)
Set pipe queues.
DOCA_STABLE doca_error_t doca_flow_cfg_destroy(struct doca_flow_cfg *cfg)
Destroy DOCA Flow configuration struct.
@ DOCA_FLOW_ENTRY_OP_AGED
@ DOCA_FLOW_PIPE_ORDERED_LIST
@ DOCA_FLOW_WAIT_FOR_BATCH
@ DOCA_FLOW_ENTRY_STATUS_SUCCESS
#define DOCA_LOG_ERR(format,...)
Generates an ERROR application log message.
#define DOCA_LOG_WARN(format,...)
Generates a WARNING application log message.
flow_skeleton_aging_cb aging_cb
flow_skeleton_entries_acquisition_cb entries_acquisition_cb
flow_skeleton_failure_cb failure_cb
flow_skeleton_process_cb add_cb
flow_skeleton_process_cb remove_cb
flow_skeleton_initialize_cb init_cb
struct doca_flow_pipe_entry ** entry
enum doca_flow_entry_op op
struct flow_skeleton_entry_ctx ctx
struct doca_flow_port * ports[]
struct flow_skeleton_cfg skeleton_cfg
struct flow_skeleton_entry * entries