#include <rte_flow.h>
Go to the source code of this file.
|
int | dao_flow_init (uint16_t port_id, struct dao_flow_offload_config *config) |
|
int | dao_flow_fini (uint16_t port_id) |
|
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) |
|
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) |
|
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) |
|
DAO Flow offload library
Definition in file dao_flow.h.
◆ 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.
◆ dao_flow_init()
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_id | Port identifier of Ethernet device. |
[in] | config | Flow 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_id | Port 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_id | Port identifier of Ethernet device. |
[in] | attr | Flow rule attributes. |
[in] | pattern | Pattern specification (list terminated by the END pattern item). |
[in] | actions | Associated actions (list terminated by the END action). |
[out] | error | Perform 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_id | Port identifier of Ethernet device. |
[in] | attr | Flow rule attributes. |
[in] | pattern | Pattern specification (list terminated by the END pattern item). |
[in] | actions | Associated actions (list terminated by the END action). |
[out] | error | Perform 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_id | Port identifier of Ethernet device. |
[in] | flow | Flow rule handle to destroy. |
[out] | error | Perform 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_id | Port identifier of Ethernet device. |
[in] | flow | Flow rule handle to destroy. |
[out] | error | Perform 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_id | Port identifier of Ethernet device. |
[in] | objs | Array of packet buffers |
[in] | nb_objs | No 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_id | Port identifier of Ethernet device. |
| flow | Flow rule handle to query. |
| action | Action definition as defined in original flow rule. |
[in,out] | data | Pointer to storage for the associated query data type. |
[out] | error | Perform 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_id | The port identifier of the Ethernet device. |
[in] | flow | The pointer of flow rule to dump. Dump all rules if NULL. |
[in] | file | A pointer to a file for output. |
[out] | error | Perform 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_id | Port identifier of Ethernet device. |
[out] | error | Perform 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_id | Port identifier of Ethernet device. |
[in] | file | A pointer to a file for output. |
[out] | error | Perform verbose error reporting if not NULL. |
- Returns
- 0 on success, a negative errno value otherwise.
◆ dao_flow_count()
Get flow count. Retrieving no of flows associated with a port.
- Parameters
-
| port_id | Port identifier of Ethernet device. |
[out] | count | A pointer to a flow count structure. |
[out] | error | Perform verbose error reporting if not NULL. |
- Returns
- 0 on success, a negative errno value otherwise.