29 #include <rte_byteorder.h>
35 #include "flow_common.h"
37 #define NB_ACTION_DESC (1)
38 #define NB_VXLAN_ENTRIES (1)
39 #define NB_GPE_ENTRIES (1)
40 #define NB_MODIFY_HDR_ENTRIES (1)
41 #define TOTAL_ENTRIES (NB_VXLAN_ENTRIES + NB_GPE_ENTRIES + NB_MODIFY_HDR_ENTRIES)
58 struct doca_flow_pipe_cfg *pipe_cfg;
61 memset(&match, 0,
sizeof(match));
63 memset(&
fwd, 0,
sizeof(
fwd));
120 struct doca_flow_pipe_entry *
entry;
123 memset(&match, 0,
sizeof(match));
163 struct doca_flow_pipe *miss_pipe,
164 struct doca_flow_pipe **pipe)
169 struct doca_flow_pipe_cfg *pipe_cfg;
172 memset(&match, 0,
sizeof(match));
174 memset(&
fwd, 0,
sizeof(
fwd));
234 struct doca_flow_pipe_entry *
entry;
237 memset(&match, 0,
sizeof(match));
279 struct doca_flow_pipe *miss_pipe,
280 struct doca_flow_pipe **pipe)
288 struct doca_flow_pipe_cfg *pipe_cfg;
291 memset(&match, 0,
sizeof(match));
293 memset(&
fwd, 0,
sizeof(
fwd));
295 memset(&descs, 0,
sizeof(descs));
307 descs_arr[0] = &descs;
316 desc_array[0].
field_op.dst.field_string =
"outer.ipv4.ttl";
317 desc_array[0].
field_op.dst.bit_offset = 0;
364 struct doca_flow_pipe_entry *
entry;
368 memset(&match, 0,
sizeof(match));
398 struct doca_flow_pipe *pipe, *vxlan_pipe, *vxlan_gpe_pipe;
400 int num_of_entries = 0;
410 memset(dev_arr, 0,
sizeof(
struct doca_dev *) *
nb_ports);
419 for (port_id = 0; port_id <
nb_ports; port_id++, num_of_entries = 0) {
420 memset(&status, 0,
sizeof(status));
struct doca_flow_port * init_doca_flow(uint16_t port_id, uint8_t rxq_num)
#define SET_MAC_ADDR(addr, a, b, c, d, e, f)
static doca_error_t destroy_pipe_cfg(struct doca_flow_pipe_cfg *cfg)
static struct doca_flow_fwd fwd_miss
static struct doca_flow_actions actions
#define BE_IPV4_ADDR(a, b, c, d)
static struct doca_flow_fwd fwd
static struct doca_flow_pipe_entry * entry[MAX_ENTRIES]
#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.
#define DOCA_FLOW_VXLAN_GPE_DEFAULT_PORT
#define DOCA_FLOW_VXLAN_DEFAULT_PORT
@ DOCA_FLOW_L4_TYPE_EXT_UDP
@ DOCA_FLOW_TUN_EXT_VXLAN_STANDARD
@ DOCA_FLOW_TUN_EXT_VXLAN_GPE
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_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_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_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_FLOW_L2_VALID_HEADER_VLAN_0
@ DOCA_FLOW_WAIT_FOR_BATCH
#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 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)
enum doca_flow_action_type type
struct doca_flow_action_desc::@108::@110 field_op
struct doca_flow_action_desc * desc_array
doca flow actions information
struct doca_flow_header_format outer
struct doca_flow_pipe * next_pipe
enum doca_flow_fwd_type type
doca flow matcher information
struct doca_flow_parser_meta parser_meta
struct doca_flow_header_format outer
enum doca_flow_tun_type type
enum doca_flow_tun_ext_vxlan_type vxlan_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]