32 #include "flow_common.h"
46 struct doca_flow_pipe *next_pipe,
47 struct doca_flow_pipe **pipe)
52 struct doca_flow_pipe_cfg *pipe_cfg;
55 memset(&match, 0,
sizeof(match));
57 memset(&
fwd, 0,
sizeof(
fwd));
112 struct doca_flow_pipe *next_pipe,
117 struct doca_flow_pipe_entry *entry1;
118 struct doca_flow_pipe_entry *entry2;
125 memset(&match, 0,
sizeof(match));
126 memset(&
fwd, 0,
sizeof(
fwd));
163 const int nb_ordered_lists = 2;
168 struct doca_flow_pipe_cfg *pipe_cfg;
177 memset(&
fwd, 0,
sizeof(
fwd));
178 memset(&counter, 0,
sizeof(counter));
180 memset(&actions_mask, 0,
sizeof(actions_mask));
181 memset(&ordered_list_0, 0,
sizeof(ordered_list_0));
182 memset(&ordered_list_1, 0,
sizeof(ordered_list_1));
183 memset(&element_0, 0,
sizeof(element_0));
184 memset(&element_1, 0,
sizeof(element_1));
185 memset(&element_2, 0,
sizeof(element_2));
187 ordered_lists[0] = &ordered_list_0;
188 ordered_lists[1] = &ordered_list_1;
196 element_2.
actions = &actions_2;
198 ordered_list_0.
idx = 0;
199 ordered_list_0.
size = 2;
202 ordered_list_1.
idx = 1;
203 ordered_list_1.
size = 3;
256 struct doca_flow_pipe_entry *entry1;
257 struct doca_flow_pipe_entry *entry2;
268 memset(&counter, 0,
sizeof(counter));
270 memset(&actions_mask, 0,
sizeof(actions_mask));
271 memset(&element_0, 0,
sizeof(element_0));
272 memset(&element_1, 0,
sizeof(element_1));
273 memset(&element_2, 0,
sizeof(element_2));
274 memset(&ordered_list_0, 0,
sizeof(ordered_list_0));
275 memset(&ordered_list_1, 0,
sizeof(ordered_list_1));
285 ordered_list_0.
idx = 0;
286 ordered_list_0.
size = 2;
303 ordered_list_1.
idx = 1;
304 ordered_list_1.
size = 3;
337 struct doca_flow_pipe *root_pipe;
338 struct doca_flow_pipe *ordered_list_pipe;
339 uint32_t shared_counter_ids[] = {0, 1, 2, 3};
344 int num_of_entries = 4;
356 memset(dev_arr, 0,
sizeof(
struct doca_dev *) *
nb_ports);
365 for (port_id = 0; port_id <
nb_ports; port_id++) {
366 memset(&status, 0,
sizeof(status));
377 shared_counter_ids[port_id],
380 DOCA_LOG_ERR(
"Failed to configure shared counter to port %d", port_id);
387 &shared_counter_ids[port_id],
398 shared_counter_ids[port_id + 2],
401 DOCA_LOG_ERR(
"Failed to configure shared counter to port %d", port_id);
408 &shared_counter_ids[port_id + 2],
471 for (port_id = 0; port_id < 4; port_id++) {
struct doca_flow_port * init_doca_flow(uint16_t port_id, uint8_t rxq_num)
static doca_error_t destroy_pipe_cfg(struct doca_flow_pipe_cfg *cfg)
doca_error_t add_root_pipe_entries(struct doca_flow_pipe *pipe, struct doca_flow_pipe *next_pipe, struct entries_status *status)
doca_error_t create_root_pipe(struct doca_flow_port *port, struct doca_flow_pipe *next_pipe, struct doca_flow_pipe **pipe)
DOCA_LOG_REGISTER(FLOW_ORDERED_LIST)
doca_error_t add_ordered_list_pipe_entries(struct doca_flow_pipe *pipe, int port_id, struct entries_status *status)
doca_error_t create_ordered_list_pipe(struct doca_flow_port *port, int port_id, struct doca_flow_pipe **pipe)
doca_error_t flow_ordered_list(int nb_queues)
static struct doca_flow_actions actions
#define BE_IPV4_ADDR(a, b, c, d)
static struct doca_flow_fwd fwd
#define DEFAULT_TIMEOUT_US
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_FLOW_L4_TYPE_EXT_TCP
DOCA_STABLE doca_error_t doca_flow_pipe_cfg_destroy(struct doca_flow_pipe_cfg *cfg)
Destroy DOCA Flow pipe configuration struct.
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_pipe_cfg_create(struct doca_flow_pipe_cfg **cfg, struct doca_flow_port *port)
Create DOCA Flow pipe configuration struct.
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_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.
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.
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.
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.
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.
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.
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 void doca_flow_destroy(void)
Destroy the doca flow.
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.
@ DOCA_FLOW_SHARED_RESOURCE_COUNTER
@ DOCA_FLOW_PIPE_ORDERED_LIST
@ DOCA_FLOW_ORDERED_LIST_ELEMENT_ACTIONS
@ DOCA_FLOW_ORDERED_LIST_ELEMENT_MONITOR
@ DOCA_FLOW_RESOURCE_TYPE_SHARED
@ DOCA_FLOW_FWD_ORDERED_LIST_PIPE
#define DOCA_LOG_ERR(format,...)
Generates an ERROR application log message.
#define DOCA_LOG_INFO(format,...)
Generates an INFO application log message.
uint16_t doca_be16_t
Declare DOCA endianity types.
const struct ip_frag_config * cfg
doca_error_t stop_doca_flow_ports(int nb_ports, struct doca_flow_port *ports[])
doca_error_t init_doca_flow_ports(int nb_ports, struct doca_flow_port *ports[], bool is_hairpin, struct doca_dev *dev_arr[], uint32_t actions_mem_size[])
doca_error_t set_flow_pipe_cfg(struct doca_flow_pipe_cfg *cfg, const char *name, enum doca_flow_pipe_type type, bool is_root)
#define SHARED_RESOURCE_NUM_VALUES
#define ACTIONS_MEM_SIZE(nr_queues, entries)
#define ARRAY_INIT(array, val)
doca flow actions information
struct doca_flow_header_format outer
struct doca_flow_fwd::@80::@88 ordered_list_pipe
enum doca_flow_fwd_type type
doca flow matcher information
struct doca_flow_parser_meta parser_meta
struct doca_flow_header_format outer
doca monitor action configuration
struct doca_flow_monitor::@103::@107 shared_counter
enum doca_flow_resource_type counter_type
struct doca_flow_monitor * monitor
enum doca_flow_ordered_list_element_type type
struct doca_flow_actions * actions_mask
struct doca_flow_actions * actions
Ordered list configuration.
struct doca_flow_ordered_list_element * elements
doca flow shared resource configuration
user context struct that will be used in entries process callback
static uint32_t actions_mem_size[FLOW_SWITCH_PORTS_MAX]
static struct doca_flow_port * ports[FLOW_SWITCH_PORTS_MAX]