DPDK  20.05.0
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 
44 #include <rte_compat.h>
45 #include <rte_common.h>
46 #include <rte_ethdev.h>
47 #include <rte_ether.h>
48 #include <rte_flow.h>
49 #include <rte_acl.h>
50 #include <rte_table_acl.h>
51 
52 #ifdef __cplusplus
53 extern "C" {
54 #endif
55 
56 extern int librte_flow_classify_logtype;
57 
58 #define RTE_FLOW_CLASSIFY_LOG(level, ...) \
59  rte_log(RTE_LOG_ ## level, \
60  librte_flow_classify_logtype, \
61  RTE_FMT("%s(): " RTE_FMT_HEAD(__VA_ARGS__,), \
62  __func__, \
63  RTE_FMT_TAIL(__VA_ARGS__,)))
64 
65 #ifndef RTE_FLOW_CLASSIFY_TABLE_MAX
66 #define RTE_FLOW_CLASSIFY_TABLE_MAX 32
67 #endif
68 
70 struct rte_flow_classifier;
71 
73 struct rte_flow_classify_rule;
74 
81 };
82 
93 
94 };
95 
99  const char *name;
100 
104 };
105 
110 
112  void *arg_create;
113 
116 };
117 
120  uint32_t dst_ip;
121  uint32_t dst_ip_mask;
122  uint32_t src_ip;
123  uint32_t src_ip_mask;
124  uint16_t dst_port;
125  uint16_t dst_port_mask;
126  uint16_t src_port;
127  uint16_t src_port_mask;
128  uint8_t proto;
129  uint8_t proto_mask;
130 };
131 
140  void *stats;
141 };
142 
143 struct rte_flow_classify_ipv4_5tuple_stats {
145  uint64_t counter1;
147  struct rte_flow_classify_ipv4_5tuple ipv4_5tuple;
148 };
149 
158 __rte_experimental
159 struct rte_flow_classifier *
161 
170 __rte_experimental
171 int
172 rte_flow_classifier_free(struct rte_flow_classifier *cls);
173 
184 __rte_experimental
185 int
186 rte_flow_classify_table_create(struct rte_flow_classifier *cls,
187  struct rte_flow_classify_table_params *params);
188 
206 __rte_experimental
207 int
208 rte_flow_classify_validate(struct rte_flow_classifier *cls,
209  const struct rte_flow_attr *attr,
210  const struct rte_flow_item pattern[],
211  const struct rte_flow_action actions[],
212  struct rte_flow_error *error);
213 
233 __rte_experimental
234 struct rte_flow_classify_rule *
235 rte_flow_classify_table_entry_add(struct rte_flow_classifier *cls,
236  const struct rte_flow_attr *attr,
237  const struct rte_flow_item pattern[],
238  const struct rte_flow_action actions[],
239  int *key_found,
240  struct rte_flow_error *error);
241 
252 __rte_experimental
253 int
254 rte_flow_classify_table_entry_delete(struct rte_flow_classifier *cls,
255  struct rte_flow_classify_rule *rule);
256 
274 __rte_experimental
275 int
276 rte_flow_classifier_query(struct rte_flow_classifier *cls,
277  struct rte_mbuf **pkts,
278  const uint16_t nb_pkts,
279  struct rte_flow_classify_rule *rule,
280  struct rte_flow_classify_stats *stats);
281 
282 #ifdef __cplusplus
283 }
284 #endif
285 
286 #endif /* _RTE_FLOW_CLASSIFY_H_ */
__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_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_classify_table_entry_delete(struct rte_flow_classifier *cls, struct rte_flow_classify_rule *rule)
rte_flow_classify_table_type
__rte_experimental int rte_flow_classify_table_create(struct rte_flow_classifier *cls, struct rte_flow_classify_table_params *params)
enum rte_flow_classify_table_type type
__rte_experimental struct rte_flow_classifier * rte_flow_classifier_create(struct rte_flow_classifier_params *params)
__rte_experimental int rte_flow_classifier_free(struct rte_flow_classifier *cls)
rte_flow_classify_rule_type
__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)