DPDK 21.11.9
rte_flow_classify.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2017 Intel Corporation
3 */
4
5#ifndef _RTE_FLOW_CLASSIFY_H_
6#define _RTE_FLOW_CLASSIFY_H_
7
46#include <rte_compat.h>
47#include <rte_common.h>
48#include <rte_ethdev.h>
49#include <rte_ether.h>
50#include <rte_flow.h>
51#include <rte_acl.h>
52#include <rte_table_acl.h>
53
54#ifdef __cplusplus
55extern "C" {
56#endif
57
58extern int librte_flow_classify_logtype;
59
60#define RTE_FLOW_CLASSIFY_LOG(level, ...) \
61 rte_log(RTE_LOG_ ## level, \
62 librte_flow_classify_logtype, \
63 RTE_FMT("%s(): " RTE_FMT_HEAD(__VA_ARGS__,), \
64 __func__, \
65 RTE_FMT_TAIL(__VA_ARGS__,)))
66
67#ifndef RTE_FLOW_CLASSIFY_TABLE_MAX
68#define RTE_FLOW_CLASSIFY_TABLE_MAX 32
69#endif
70
72struct rte_flow_classifier;
73
75struct rte_flow_classify_rule;
76
83};
84
95
96};
97
101 const char *name;
102
106};
107
112
115
118};
119
122 uint32_t dst_ip;
123 uint32_t dst_ip_mask;
124 uint32_t src_ip;
125 uint32_t src_ip_mask;
126 uint16_t dst_port;
127 uint16_t dst_port_mask;
128 uint16_t src_port;
129 uint16_t src_port_mask;
130 uint8_t proto;
131 uint8_t proto_mask;
132};
133
142 void *stats;
143};
144
145struct rte_flow_classify_ipv4_5tuple_stats {
147 uint64_t counter1;
149 struct rte_flow_classify_ipv4_5tuple ipv4_5tuple;
150};
151
160__rte_experimental
161struct rte_flow_classifier *
163
172__rte_experimental
173int
174rte_flow_classifier_free(struct rte_flow_classifier *cls);
175
186__rte_experimental
187int
188rte_flow_classify_table_create(struct rte_flow_classifier *cls,
189 struct rte_flow_classify_table_params *params);
190
208__rte_experimental
209int
210rte_flow_classify_validate(struct rte_flow_classifier *cls,
211 const struct rte_flow_attr *attr,
212 const struct rte_flow_item pattern[],
213 const struct rte_flow_action actions[],
214 struct rte_flow_error *error);
215
235__rte_experimental
236struct rte_flow_classify_rule *
237rte_flow_classify_table_entry_add(struct rte_flow_classifier *cls,
238 const struct rte_flow_attr *attr,
239 const struct rte_flow_item pattern[],
240 const struct rte_flow_action actions[],
241 int *key_found,
242 struct rte_flow_error *error);
243
254__rte_experimental
255int
256rte_flow_classify_table_entry_delete(struct rte_flow_classifier *cls,
257 struct rte_flow_classify_rule *rule);
258
276__rte_experimental
277int
278rte_flow_classifier_query(struct rte_flow_classifier *cls,
279 struct rte_mbuf **pkts,
280 const uint16_t nb_pkts,
281 struct rte_flow_classify_rule *rule,
282 struct rte_flow_classify_stats *stats);
283
284#ifdef __cplusplus
285}
286#endif
287
288#endif /* _RTE_FLOW_CLASSIFY_H_ */
__rte_experimental struct rte_flow_classify_rule * rte_flow_classify_table_entry_add(struct rte_flow_classifier *cls, const struct rte_flow_attr *attr, const struct rte_flow_item pattern[], const struct rte_flow_action actions[], int *key_found, struct rte_flow_error *error)
__rte_experimental int rte_flow_classifier_free(struct rte_flow_classifier *cls)
rte_flow_classify_table_type
@ RTE_FLOW_CLASSIFY_TABLE_TYPE_NONE
@ RTE_FLOW_CLASSIFY_TABLE_ACL_VLAN_IP4_5TUPLE
@ RTE_FLOW_CLASSIFY_TABLE_ACL_QINQ_IP4_5TUPLE
@ RTE_FLOW_CLASSIFY_TABLE_ACL_IP4_5TUPLE
__rte_experimental int rte_flow_classifier_query(struct rte_flow_classifier *cls, struct rte_mbuf **pkts, const uint16_t nb_pkts, struct rte_flow_classify_rule *rule, struct rte_flow_classify_stats *stats)
__rte_experimental int rte_flow_classify_table_create(struct rte_flow_classifier *cls, struct rte_flow_classify_table_params *params)
__rte_experimental int rte_flow_classify_validate(struct rte_flow_classifier *cls, const struct rte_flow_attr *attr, const struct rte_flow_item pattern[], const struct rte_flow_action actions[], struct rte_flow_error *error)
rte_flow_classify_rule_type
@ RTE_FLOW_CLASSIFY_RULE_TYPE_IPV4_5TUPLE
@ RTE_FLOW_CLASSIFY_RULE_TYPE_NONE
__rte_experimental struct rte_flow_classifier * rte_flow_classifier_create(struct rte_flow_classifier_params *params)
__rte_experimental int rte_flow_classify_table_entry_delete(struct rte_flow_classifier *cls, struct rte_flow_classify_rule *rule)
enum rte_flow_classify_table_type type