DPDK  18.11.11
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
55 extern "C" {
56 #endif
57 
58 extern 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 
72 struct rte_flow_classifier;
73 
75 struct rte_flow_classify_rule;
76 
83 };
84 
95 
96 };
97 
101  const char *name;
102 
106 };
107 
112 
114  void *arg_create;
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 
145 struct rte_flow_classify_ipv4_5tuple_stats {
147  uint64_t counter1;
149  struct rte_flow_classify_ipv4_5tuple ipv4_5tuple;
150 };
151 
160 struct rte_flow_classifier * __rte_experimental
162 
171 int __rte_experimental
172 rte_flow_classifier_free(struct rte_flow_classifier *cls);
173 
184 int __rte_experimental
185 rte_flow_classify_table_create(struct rte_flow_classifier *cls,
186  struct rte_flow_classify_table_params *params);
187 
205 int __rte_experimental
206 rte_flow_classify_validate(struct rte_flow_classifier *cls,
207  const struct rte_flow_attr *attr,
208  const struct rte_flow_item pattern[],
209  const struct rte_flow_action actions[],
210  struct rte_flow_error *error);
211 
231 struct rte_flow_classify_rule * __rte_experimental
232 rte_flow_classify_table_entry_add(struct rte_flow_classifier *cls,
233  const struct rte_flow_attr *attr,
234  const struct rte_flow_item pattern[],
235  const struct rte_flow_action actions[],
236  int *key_found,
237  struct rte_flow_error *error);
238 
249 int __rte_experimental
250 rte_flow_classify_table_entry_delete(struct rte_flow_classifier *cls,
251  struct rte_flow_classify_rule *rule);
252 
270 int __rte_experimental
271 rte_flow_classifier_query(struct rte_flow_classifier *cls,
272  struct rte_mbuf **pkts,
273  const uint16_t nb_pkts,
274  struct rte_flow_classify_rule *rule,
275  struct rte_flow_classify_stats *stats);
276 
277 #ifdef __cplusplus
278 }
279 #endif
280 
281 #endif /* _RTE_FLOW_CLASSIFY_H_ */
int __rte_experimental rte_flow_classifier_free(struct rte_flow_classifier *cls)
struct rte_flow_classify_rule *__rte_experimental 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_flow_classify_table_type
enum rte_flow_classify_table_type type
int __rte_experimental 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)
int __rte_experimental rte_flow_classify_table_entry_delete(struct rte_flow_classifier *cls, struct rte_flow_classify_rule *rule)
int __rte_experimental 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
int __rte_experimental rte_flow_classify_table_create(struct rte_flow_classifier *cls, struct rte_flow_classify_table_params *params)
struct rte_flow_classifier *__rte_experimental rte_flow_classifier_create(struct rte_flow_classifier_params *params)