38 #define COUNTERS_NUM (1 << 19)
39 #define DEFAULT_METADATA 1234
40 #define DEFAULT_FLOW_TAG 5678
52 struct doca_flow_cfg *rxq_flow_cfg;
100 struct doca_flow_port_cfg *port_cfg;
111 goto destroy_port_cfg;
117 goto destroy_port_cfg;
123 goto destroy_port_cfg;
146 uint16_t *rxq_flow_queue_ids,
148 struct doca_flow_pipe **root_pipe,
149 struct doca_flow_pipe_entry **root_entry)
154 struct doca_flow_pipe_cfg *pipe_cfg;
155 const char *pipe_name =
"ROOT_PIPE";
161 .queues_array = rxq_flow_queue_ids,
162 .nr_queues = nb_queues,
170 memset(&all_match, 0,
sizeof(all_match));
249 DOCA_LOG_ERR(
"Failed to allocate eth_rxq_flow_resources: failed to init DOCA flow, err: %s",
259 DOCA_LOG_ERR(
"Failed to allocate eth_rxq_flow_resources: failed to init DOCA flow port, err: %s",
261 goto destroy_doca_flow;
277 cfg->rxq_flow_queue_ids,
282 DOCA_LOG_ERR(
"Failed to allocate eth_rxq_flow_resources: failed to create root pipe, err: %s",
284 goto destroy_doca_flow_port;
289 destroy_doca_flow_port:
323 void *pkt_head, *pkt_data;
336 *headroom_size = (uint8_t *)(pkt_data) - (uint8_t *)(pkt_head);
343 size_t pkt_len, pkt_data_len;
345 uint16_t headroom_size;
362 *tailroom_size = pkt_len - pkt_data_len - headroom_size;
static doca_error_t create_root_pipe(struct doca_flow_port *df_port, uint16_t *rxq_flow_queue_ids, uint16_t nb_queues, struct doca_flow_pipe **root_pipe, struct doca_flow_pipe_entry **root_entry)
static doca_error_t init_doca_flow(void)
doca_error_t destroy_eth_rxq_flow_resources(struct eth_rxq_flow_resources *resources)
static bool is_flow_initialized
doca_error_t get_pkt_tailroom(struct doca_buf *pkt, uint16_t *tailroom_size)
doca_error_t get_pkt_headroom(struct doca_buf *pkt, uint16_t *headroom_size)
doca_error_t allocate_eth_rxq_flow_resources(struct eth_rxq_flow_config *cfg, struct eth_rxq_flow_resources *resources)
doca_error_t rxq_common_init_doca_flow(struct doca_dev *dev, struct eth_rxq_flow_resources *resources)
static doca_error_t start_doca_flow_port(struct doca_dev *dev, struct doca_flow_port **df_port)
DOCA_LOG_REGISTER(ETH::RXQ::COMMON)
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
static struct doca_flow_port * df_port
struct rdma_resources resources
DOCA_STABLE doca_error_t doca_buf_get_len(const struct doca_buf *buf, size_t *len)
Get the buffer's length.
DOCA_STABLE doca_error_t doca_buf_get_data(const struct doca_buf *buf, void **data)
Get the buffer's data.
DOCA_STABLE doca_error_t doca_buf_get_data_len(const struct doca_buf *buf, size_t *data_len)
Get buffer's data length.
DOCA_STABLE doca_error_t doca_buf_get_head(const struct doca_buf *buf, void **head)
Get the buffer's head.
#define DOCA_ERROR_PROPAGATE(r, t)
Save the first encountered doca_error_t.
enum doca_error doca_error_t
DOCA API return codes.
DOCA_STABLE const char * doca_error_get_name(doca_error_t error)
Returns the string representation of an error code name.
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_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_cfg_set_mode_args(struct doca_flow_cfg *cfg, const char *mode_args)
Set DOCA mode args.
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_STABLE doca_error_t doca_flow_pipe_cfg_set_name(struct doca_flow_pipe_cfg *cfg, const char *name)
Set pipe's name.
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_port_start(const struct doca_flow_port_cfg *cfg, struct doca_flow_port **port)
Start a doca port.
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.
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_STABLE doca_error_t doca_flow_cfg_create(struct doca_flow_cfg **cfg)
Create DOCA Flow configuration struct.
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.
DOCA_EXPERIMENTAL doca_error_t doca_flow_init(struct doca_flow_cfg *cfg)
Initialize the doca flow.
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.
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.
DOCA_STABLE void doca_flow_pipe_destroy(struct doca_flow_pipe *pipe)
Destroy one 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_STABLE doca_error_t doca_flow_port_stop(struct doca_flow_port *port)
Stop a doca port.
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_port_cfg_set_port_id(struct doca_flow_port_cfg *cfg, uint16_t port_id)
Set the logical port ID.
DOCA_STABLE doca_error_t doca_flow_port_cfg_create(struct doca_flow_port_cfg **cfg)
Create DOCA Flow port configuration struct.
DOCA_STABLE doca_error_t doca_flow_port_cfg_destroy(struct doca_flow_port_cfg *cfg)
Destroy DOCA Flow port configuration struct.
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_RESOURCE_TYPE_NON_SHARED
#define DOCA_LOG_ERR(format,...)
Generates an ERROR application log message.
#define DOCA_LOG_INFO(format,...)
Generates an INFO application log message.
const struct ip_frag_config * cfg
doca flow actions information
struct doca_flow_meta meta
enum doca_flow_fwd_type type
doca flow matcher information