DPDK
17.11.10
|
#include <rte_common.h>
#include <rte_ethdev.h>
#include <rte_ether.h>
#include <rte_flow.h>
#include <rte_acl.h>
#include <rte_table_acl.h>
Go to the source code of this file.
Data Structures | |
struct | rte_flow_classifier_params |
struct | rte_flow_classify_table_params |
struct | rte_flow_classify_ipv4_5tuple |
struct | rte_flow_classify_stats |
Macros | |
#define | RTE_FLOW_CLASSIFY_TABLE_MAX 64 |
Functions | |
struct rte_flow_classifier * | rte_flow_classifier_create (struct rte_flow_classifier_params *params) |
int | rte_flow_classifier_free (struct rte_flow_classifier *cls) |
int | rte_flow_classify_table_create (struct rte_flow_classifier *cls, struct rte_flow_classify_table_params *params, uint32_t *table_id) |
struct rte_flow_classify_rule * | rte_flow_classify_table_entry_add (struct rte_flow_classifier *cls, uint32_t table_id, int *key_found, const struct rte_flow_attr *attr, const struct rte_flow_item pattern[], const struct rte_flow_action actions[], struct rte_flow_error *error) |
int | rte_flow_classify_table_entry_delete (struct rte_flow_classifier *cls, uint32_t table_id, struct rte_flow_classify_rule *rule) |
int | rte_flow_classifier_query (struct rte_flow_classifier *cls, uint32_t table_id, struct rte_mbuf **pkts, const uint16_t nb_pkts, struct rte_flow_classify_rule *rule, struct rte_flow_classify_stats *stats) |
RTE Flow Classify Library
EXPERIMENTAL: this API may change without prior notice
This library provides flow record information with some measured properties.
Application should define the flow and measurement criteria (action) for it.
The Library doesn't maintain any flow records itself, instead flow information is returned to upper layer only for given packets.
It is application's responsibility to call rte_flow_classifier_query() for a burst of packets, just after receiving them or before transmitting them. Application should provide the flow type interested in, measurement to apply to that flow in rte_flow_classify_table_entry_add() API, and should provide the rte_flow_classifier object and storage to put results in for the rte_flow_classifier_query() API.
Usage:
Definition in file rte_flow_classify.h.
#define RTE_FLOW_CLASSIFY_TABLE_MAX 64 |
Maximum number of tables allowed for any Flow Classifier instance. The value of this parameter cannot be changed.
Definition at line 119 of file rte_flow_classify.h.
Flow classify rule type
Enumerator | |
---|---|
RTE_FLOW_CLASSIFY_RULE_TYPE_NONE |
no type |
RTE_FLOW_CLASSIFY_RULE_TYPE_IPV4_5TUPLE |
IPv4 5tuple type |
Definition at line 100 of file rte_flow_classify.h.
Flow classify table type
Enumerator | |
---|---|
RTE_FLOW_CLASSIFY_TABLE_TYPE_NONE |
no type |
RTE_FLOW_CLASSIFY_TABLE_TYPE_ACL |
ACL type |
Definition at line 108 of file rte_flow_classify.h.
struct rte_flow_classifier* rte_flow_classifier_create | ( | struct rte_flow_classifier_params * | params | ) |
Flow classifier create
params | Parameters for flow classifier creation |
int rte_flow_classifier_free | ( | struct rte_flow_classifier * | cls | ) |
Flow classifier free
cls | Handle to flow classifier instance |
int rte_flow_classify_table_create | ( | struct rte_flow_classifier * | cls, |
struct rte_flow_classify_table_params * | params, | ||
uint32_t * | table_id | ||
) |
Flow classify table create
cls | Handle to flow classifier instance |
params | Parameters for flow_classify table creation |
table_id | Table ID. Valid only within the scope of table IDs of the current classifier. Only returned after a successful invocation. |
struct rte_flow_classify_rule* rte_flow_classify_table_entry_add | ( | struct rte_flow_classifier * | cls, |
uint32_t | table_id, | ||
int * | key_found, | ||
const struct rte_flow_attr * | attr, | ||
const struct rte_flow_item | pattern[], | ||
const struct rte_flow_action | actions[], | ||
struct rte_flow_error * | error | ||
) |
Add a flow classify rule to the flow_classifer table.
[in] | cls | Flow classifier handle |
[in] | table_id | id of table |
[out] | key_found | returns 1 if key present already, 0 otherwise. |
[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 pattern item). |
[out] | error | Perform verbose error reporting if not NULL. Structure initialised in case of error only. |
int rte_flow_classify_table_entry_delete | ( | struct rte_flow_classifier * | cls, |
uint32_t | table_id, | ||
struct rte_flow_classify_rule * | rule | ||
) |
Delete a flow classify rule from the flow_classifer table.
[in] | cls | Flow classifier handle |
[in] | table_id | id of table |
[in] | rule | Flow classify rule |
int rte_flow_classifier_query | ( | struct rte_flow_classifier * | cls, |
uint32_t | table_id, | ||
struct rte_mbuf ** | pkts, | ||
const uint16_t | nb_pkts, | ||
struct rte_flow_classify_rule * | rule, | ||
struct rte_flow_classify_stats * | stats | ||
) |
Query flow classifier for given rule.
[in] | cls | Flow classifier handle |
[in] | table_id | id of table |
[in] | pkts | Pointer to packets to process |
[in] | nb_pkts | Number of packets to process |
[in] | rule | Flow classify rule |
[in] | stats | Flow classify stats |