Data Accelerator Offload
Loading...
Searching...
No Matches
Data Structures | Macros | Functions
dao_flow.h File Reference
#include <rte_flow.h>

Go to the source code of this file.

Data Structures

struct  dao_flow_query_count
 
struct  dao_flow_count
 
struct  dao_flow_offload_config
 
struct  dao_flow
 

Macros

#define DAO_FLOW_PROFILE_NAME_MAX   60
 

Functions

int dao_flow_init (uint16_t port_id, struct dao_flow_offload_config *config)
 
int dao_flow_fini (uint16_t port_id)
 
struct dao_flowdao_flow_create (uint16_t port_id, const struct rte_flow_attr *attr, const struct rte_flow_item pattern[], const struct rte_flow_action actions[], struct rte_flow_error *error)
 
struct dao_flowdao_flow_hw_install (uint16_t port_id, const struct rte_flow_attr *attr, const struct rte_flow_item pattern[], const struct rte_flow_action actions[], struct rte_flow_error *error)
 
int dao_flow_destroy (uint16_t port_id, struct dao_flow *flow, struct rte_flow_error *error)
 
int dao_flow_hw_uninstall (uint16_t port_id, struct dao_flow *flow, struct rte_flow_error *error)
 
int dao_flow_lookup (uint16_t port_id, struct rte_mbuf **objs, uint16_t nb_objs)
 
int dao_flow_query (uint16_t port_id, struct dao_flow *flow, const struct rte_flow_action *action, void *data, struct rte_flow_error *error)
 
int dao_flow_dev_dump (uint16_t port_id, struct dao_flow *flow, FILE *file, struct rte_flow_error *error)
 
int dao_flow_flush (uint16_t port_id, struct rte_flow_error *error)
 
int dao_flow_info (uint16_t port_id, FILE *file, struct rte_flow_error *error)
 
int dao_flow_count (uint16_t port_id, struct dao_flow_count *count, struct rte_flow_error *error)
 

Detailed Description

DAO Flow offload library

Definition in file dao_flow.h.

Macro Definition Documentation

◆ DAO_FLOW_PROFILE_NAME_MAX

#define DAO_FLOW_PROFILE_NAME_MAX   60

Key exchange profile name maximum length

Definition at line 17 of file dao_flow.h.

Function Documentation

◆ dao_flow_init()

int dao_flow_init ( uint16_t  port_id,
struct dao_flow_offload_config config 
)

Setting up the flow configurations based on input provided by user. This function should be invoked for each port, taking into account that an application can have two types of ports: ethernet ports, which require hardware flow offloading, and virtio ports, which do not have hardware TCAM backing.

Parameters
[in]port_idPort identifier of Ethernet device.
[in]configFlow offloading configuration
Returns
0 on success, otherwise a negative errno value.

◆ dao_flow_fini()

int dao_flow_fini ( uint16_t  port_id)

Global flow configuration cleanup

Parameters
[in]port_idPort identifier of Ethernet device.
Returns
0 on success, otherwise a negative errno value.

◆ dao_flow_create()

struct dao_flow * dao_flow_create ( uint16_t  port_id,
const struct rte_flow_attr *  attr,
const struct rte_flow_item  pattern[],
const struct rte_flow_action  actions[],
struct rte_flow_error *  error 
)

Create a flow rule on a given port.

Parameters
[in]port_idPort identifier of Ethernet device.
[in]attrFlow rule attributes.
[in]patternPattern specification (list terminated by the END pattern item).
[in]actionsAssociated actions (list terminated by the END action).
[out]errorPerform verbose error reporting if not NULL.
Returns
A valid handle in case of success, NULL otherwise and errno is set.

◆ dao_flow_hw_install()

struct dao_flow * dao_flow_hw_install ( uint16_t  port_id,
const struct rte_flow_attr *  attr,
const struct rte_flow_item  pattern[],
const struct rte_flow_action  actions[],
struct rte_flow_error *  error 
)

Install a flow rule on a given port which gets offloaded directly into the HW.

Parameters
[in]port_idPort identifier of Ethernet device.
[in]attrFlow rule attributes.
[in]patternPattern specification (list terminated by the END pattern item).
[in]actionsAssociated actions (list terminated by the END action).
[out]errorPerform verbose error reporting if not NULL.
Returns
A valid handle in case of success, NULL otherwise and errno is set.

◆ dao_flow_destroy()

int dao_flow_destroy ( uint16_t  port_id,
struct dao_flow flow,
struct rte_flow_error *  error 
)

Destroy a flow rule on a given port.

Parameters
[in]port_idPort identifier of Ethernet device.
[in]flowFlow rule handle to destroy.
[out]errorPerform verbose error reporting if not NULL.
Returns
0 on success, a negative errno value.

◆ dao_flow_hw_uninstall()

int dao_flow_hw_uninstall ( uint16_t  port_id,
struct dao_flow flow,
struct rte_flow_error *  error 
)

Uninstall a flow rule on a given port which was directly offloaded to hardware.

Parameters
[in]port_idPort identifier of Ethernet device.
[in]flowFlow rule handle to destroy.
[out]errorPerform verbose error reporting if not NULL.
Returns
0 on success, a negative errno value.

◆ dao_flow_lookup()

int dao_flow_lookup ( uint16_t  port_id,
struct rte_mbuf **  objs,
uint16_t  nb_objs 
)

Lookup for a flow on a given port.

Its a fast path API which takes buffer stream as an input and looks up for a flow hit/miss. On hit appropriate action is performed based on the flow rule created. Also if HW offloading is enabled, respective flow is installed in the HW CAM.

Parameters
[in]port_idPort identifier of Ethernet device.
[in]objsArray of packet buffers
[in]nb_objsNo of packet buffers
Returns
0 on success, a negative errno value.

◆ dao_flow_query()

int dao_flow_query ( uint16_t  port_id,
struct dao_flow flow,
const struct rte_flow_action *  action,
void *  data,
struct rte_flow_error *  error 
)

Query an existing flow rule.

This function allows retrieving flow-specific data such as counters. Data is gathered by special actions which must be present in the flow rule definition.

Parameters
port_idPort identifier of Ethernet device.
flowFlow rule handle to query.
actionAction definition as defined in original flow rule.
[in,out]dataPointer to storage for the associated query data type.
[out]errorPerform verbose error reporting if not NULL.
Returns
0 on success, a negative errno value otherwise.

◆ dao_flow_dev_dump()

int dao_flow_dev_dump ( uint16_t  port_id,
struct dao_flow flow,
FILE *  file,
struct rte_flow_error *  error 
)

Dump internal representation information of dao flow to file.

Parameters
[in]port_idThe port identifier of the Ethernet device.
[in]flowThe pointer of flow rule to dump. Dump all rules if NULL.
[in]fileA pointer to a file for output.
[out]errorPerform verbose error reporting if not NULL.
Returns
0 on success, a negative value otherwise.

◆ dao_flow_flush()

int dao_flow_flush ( uint16_t  port_id,
struct rte_flow_error *  error 
)

Destroy all flow rules associated with a port.

In the unlikely event of failure, handles are still considered destroyed and no longer valid but the port must be assumed to be in an inconsistent state.

Parameters
port_idPort identifier of Ethernet device.
[out]errorPerform verbose error reporting if not NULL.
Returns
0 on success, a negative errno value otherwise.

◆ dao_flow_info()

int dao_flow_info ( uint16_t  port_id,
FILE *  file,
struct rte_flow_error *  error 
)

Get information of all flows associated with a port.

Retrieving information about all flows associated with a port.

Parameters
port_idPort identifier of Ethernet device.
[in]fileA pointer to a file for output.
[out]errorPerform verbose error reporting if not NULL.
Returns
0 on success, a negative errno value otherwise.

◆ dao_flow_count()

int dao_flow_count ( uint16_t  port_id,
struct dao_flow_count count,
struct rte_flow_error *  error 
)

Get flow count. Retrieving no of flows associated with a port.

Parameters
port_idPort identifier of Ethernet device.
[out]countA pointer to a flow count structure.
[out]errorPerform verbose error reporting if not NULL.
Returns
0 on success, a negative errno value otherwise.