36 #include "flow_common.h"
41 #define WAITING_TIME 5
54 struct doca_flow_pipe_cfg *pipe_cfg;
55 uint32_t sequence_number = 2;
58 memset(&match, 0,
sizeof(match));
59 memset(&
fwd, 0,
sizeof(
fwd));
109 struct doca_flow_pipe *next_pipe,
113 struct doca_flow_pipe_entry *
entry;
117 memset(&match, 0,
sizeof(match));
118 memset(&
fwd, 0,
sizeof(
fwd));
139 struct doca_flow_pipe *gt_pipe,
140 struct doca_flow_pipe *lt_pipe)
171 struct doca_flow_pipe_cfg *pipe_cfg;
206 struct doca_flow_pipe_entry *
entry;
211 memset(&match, 0,
sizeof(match));
212 memset(&condition, 0,
sizeof(condition));
213 memset(&
fwd, 0,
sizeof(
fwd));
217 condition.
field_op.a.field_string =
"tunnel.esp.sn";
218 condition.
field_op.a.bit_offset = 0;
221 condition.
field_op.b.bit_offset = 0;
266 struct doca_flow_pipe *root_pipe;
267 struct doca_flow_pipe *gt_pipe;
268 struct doca_flow_pipe *lt_pipe;
270 uint32_t num_of_entries = 4;
280 memset(dev_arr, 0,
sizeof(
struct doca_dev *) *
nb_ports);
289 for (port_id = 0; port_id <
nb_ports; port_id++) {
290 memset(&status, 0,
sizeof(status));
struct doca_flow_port * init_doca_flow(uint16_t port_id, uint8_t rxq_num)
static doca_error_t add_root_pipe_entries(struct doca_flow_pipe *pipe, struct entries_status *status, struct doca_flow_pipe *gt_pipe, struct doca_flow_pipe *lt_pipe)
doca_error_t flow_esp(int nb_queues)
DOCA_LOG_REGISTER(FLOW_ESP)
static doca_error_t add_comparison_pipe_entry(struct doca_flow_pipe *pipe, uint16_t port_id, bool gt, struct entries_status *status)
static doca_error_t create_root_pipe(struct doca_flow_port *port, struct doca_flow_pipe **pipe)
static doca_error_t add_root_pipe_entry(struct doca_flow_pipe *pipe, struct doca_flow_pipe *next_pipe, uint32_t spi, struct entries_status *status)
static doca_error_t create_comparison_pipe(struct doca_flow_port *port, const char *name, struct doca_flow_pipe **pipe)
static doca_error_t destroy_pipe_cfg(struct doca_flow_pipe_cfg *cfg)
static struct doca_flow_fwd fwd
static struct doca_flow_pipe_entry * entry[MAX_ENTRIES]
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_STABLE doca_error_t doca_flow_pipe_cfg_destroy(struct doca_flow_pipe_cfg *cfg)
Destroy DOCA Flow pipe configuration struct.
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_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_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_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_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_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.
#define DOCA_LOG_ERR(format,...)
Generates an ERROR application log message.
#define DOCA_LOG_INFO(format,...)
Generates an INFO application log message.
doca_error_t flow_process_entries(struct doca_flow_port *port, struct entries_status *status, uint32_t nr_entries)
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)
struct doca_flow_pipe * next_pipe
struct doca_flow_pipe * pipe
enum doca_flow_fwd_type type
doca flow match condition information
enum doca_flow_compare_op operation
struct doca_flow_match_condition::@68::@70 field_op
doca flow matcher information
struct doca_flow_parser_meta parser_meta
enum doca_flow_tun_type type
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]