DPDK  19.11.4
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 __rte_experimental
161 struct rte_flow_classifier *
163 
172 __rte_experimental
173 int
174 rte_flow_classifier_free(struct rte_flow_classifier *cls);
175 
186 __rte_experimental
187 int
188 rte_flow_classify_table_create(struct rte_flow_classifier *cls,
189  struct rte_flow_classify_table_params *params);
190 
208 __rte_experimental
209 int
210 rte_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
236 struct rte_flow_classify_rule *
237 rte_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
255 int
256 rte_flow_classify_table_entry_delete(struct rte_flow_classifier *cls,
257  struct rte_flow_classify_rule *rule);
258 
276 __rte_experimental
277 int
278 rte_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_flow_classify_ipv4_5tuple::src_port_mask
uint16_t src_port_mask
Definition: rte_flow_classify.h:129
rte_table_acl.h
rte_flow_classify_ipv4_5tuple::src_ip
uint32_t src_ip
Definition: rte_flow_classify.h:124
rte_flow_classifier_params
Definition: rte_flow_classify.h:99
rte_flow_classify_ipv4_5tuple::src_ip_mask
uint32_t src_ip_mask
Definition: rte_flow_classify.h:125
rte_flow_classifier_params::name
const char * name
Definition: rte_flow_classify.h:101
rte_flow_classify_table_params::type
enum rte_flow_classify_table_type type
Definition: rte_flow_classify.h:117
rte_flow_classify_table_entry_add
__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_flow_classify_validate
__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_acl.h
RTE_FLOW_CLASSIFY_TABLE_ACL_QINQ_IP4_5TUPLE
@ RTE_FLOW_CLASSIFY_TABLE_ACL_QINQ_IP4_5TUPLE
Definition: rte_flow_classify.h:94
rte_flow_classify_table_params
Definition: rte_flow_classify.h:109
rte_flow_classify_ipv4_5tuple::dst_port_mask
uint16_t dst_port_mask
Definition: rte_flow_classify.h:127
rte_flow_classify_ipv4_5tuple::dst_port
uint16_t dst_port
Definition: rte_flow_classify.h:126
rte_flow_classify_ipv4_5tuple::proto
uint8_t proto
Definition: rte_flow_classify.h:130
rte_flow_item
Definition: rte_flow.h:1517
rte_flow_classify_table_entry_delete
__rte_experimental int rte_flow_classify_table_entry_delete(struct rte_flow_classifier *cls, struct rte_flow_classify_rule *rule)
RTE_FLOW_CLASSIFY_RULE_TYPE_IPV4_5TUPLE
@ RTE_FLOW_CLASSIFY_RULE_TYPE_IPV4_5TUPLE
Definition: rte_flow_classify.h:82
rte_flow_classify_ipv4_5tuple::dst_ip_mask
uint32_t dst_ip_mask
Definition: rte_flow_classify.h:123
RTE_FLOW_CLASSIFY_TABLE_TYPE_NONE
@ RTE_FLOW_CLASSIFY_TABLE_TYPE_NONE
Definition: rte_flow_classify.h:88
rte_flow_classify_ipv4_5tuple::dst_ip
uint32_t dst_ip
Definition: rte_flow_classify.h:122
rte_ether.h
rte_mbuf
Definition: rte_mbuf_core.h:480
rte_flow_classify_table_type
rte_flow_classify_table_type
Definition: rte_flow_classify.h:86
rte_flow_classify_table_create
__rte_experimental int rte_flow_classify_table_create(struct rte_flow_classifier *cls, struct rte_flow_classify_table_params *params)
rte_flow_classifier_create
__rte_experimental struct rte_flow_classifier * rte_flow_classifier_create(struct rte_flow_classifier_params *params)
rte_flow.h
rte_flow_classifier_params::socket_id
int socket_id
Definition: rte_flow_classify.h:105
RTE_FLOW_CLASSIFY_RULE_TYPE_NONE
@ RTE_FLOW_CLASSIFY_RULE_TYPE_NONE
Definition: rte_flow_classify.h:80
rte_flow_classify_stats
Definition: rte_flow_classify.h:141
RTE_FLOW_CLASSIFY_TABLE_ACL_IP4_5TUPLE
@ RTE_FLOW_CLASSIFY_TABLE_ACL_IP4_5TUPLE
Definition: rte_flow_classify.h:90
rte_flow_classify_rule_type
rte_flow_classify_rule_type
Definition: rte_flow_classify.h:78
rte_flow_classify_table_params::ops
struct rte_table_ops * ops
Definition: rte_flow_classify.h:111
rte_common.h
rte_table_ops
Definition: rte_table.h:257
rte_flow_classifier_free
__rte_experimental int rte_flow_classifier_free(struct rte_flow_classifier *cls)
rte_flow_attr
Definition: rte_flow.h:75
rte_ethdev.h
rte_flow_classify_ipv4_5tuple::proto_mask
uint8_t proto_mask
Definition: rte_flow_classify.h:131
rte_flow_error
Definition: rte_flow.h:2618
rte_flow_classifier_query
__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_flow_classify_ipv4_5tuple::src_port
uint16_t src_port
Definition: rte_flow_classify.h:128
rte_flow_classify_table_params::arg_create
void * arg_create
Definition: rte_flow_classify.h:114
RTE_FLOW_CLASSIFY_TABLE_ACL_VLAN_IP4_5TUPLE
@ RTE_FLOW_CLASSIFY_TABLE_ACL_VLAN_IP4_5TUPLE
Definition: rte_flow_classify.h:92
rte_flow_classify_ipv4_5tuple
Definition: rte_flow_classify.h:121