DPDK  19.02.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 struct rte_flow_classifier * __rte_experimental
160 
169 int __rte_experimental
170 rte_flow_classifier_free(struct rte_flow_classifier *cls);
171 
182 int __rte_experimental
183 rte_flow_classify_table_create(struct rte_flow_classifier *cls,
184  struct rte_flow_classify_table_params *params);
185 
203 int __rte_experimental
204 rte_flow_classify_validate(struct rte_flow_classifier *cls,
205  const struct rte_flow_attr *attr,
206  const struct rte_flow_item pattern[],
207  const struct rte_flow_action actions[],
208  struct rte_flow_error *error);
209 
229 struct rte_flow_classify_rule * __rte_experimental
230 rte_flow_classify_table_entry_add(struct rte_flow_classifier *cls,
231  const struct rte_flow_attr *attr,
232  const struct rte_flow_item pattern[],
233  const struct rte_flow_action actions[],
234  int *key_found,
235  struct rte_flow_error *error);
236 
247 int __rte_experimental
248 rte_flow_classify_table_entry_delete(struct rte_flow_classifier *cls,
249  struct rte_flow_classify_rule *rule);
250 
268 int __rte_experimental
269 rte_flow_classifier_query(struct rte_flow_classifier *cls,
270  struct rte_mbuf **pkts,
271  const uint16_t nb_pkts,
272  struct rte_flow_classify_rule *rule,
273  struct rte_flow_classify_stats *stats);
274 
275 #ifdef __cplusplus
276 }
277 #endif
278 
279 #endif /* _RTE_FLOW_CLASSIFY_H_ */