DPDK 22.11.7
rte_flow_driver.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright 2016 6WIND S.A.
3 * Copyright 2016 Mellanox Technologies, Ltd
4 */
5
6#ifndef RTE_FLOW_DRIVER_H_
7#define RTE_FLOW_DRIVER_H_
8
18#include <stdint.h>
19
20#include "rte_ethdev.h"
21#include "ethdev_driver.h"
22#include "rte_flow.h"
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
41 int (*validate)
42 (struct rte_eth_dev *,
43 const struct rte_flow_attr *,
44 const struct rte_flow_item [],
45 const struct rte_flow_action [],
46 struct rte_flow_error *);
48 struct rte_flow *(*create)
49 (struct rte_eth_dev *,
50 const struct rte_flow_attr *,
51 const struct rte_flow_item [],
52 const struct rte_flow_action [],
53 struct rte_flow_error *);
55 int (*destroy)
56 (struct rte_eth_dev *,
57 struct rte_flow *,
58 struct rte_flow_error *);
60 int (*flush)
61 (struct rte_eth_dev *,
62 struct rte_flow_error *);
64 int (*query)
65 (struct rte_eth_dev *,
66 struct rte_flow *,
67 const struct rte_flow_action *,
68 void *,
69 struct rte_flow_error *);
71 int (*isolate)
72 (struct rte_eth_dev *,
73 int,
74 struct rte_flow_error *);
76 int (*dev_dump)
77 (struct rte_eth_dev *dev,
78 struct rte_flow *flow,
79 FILE *file,
80 struct rte_flow_error *error);
83 (struct rte_eth_dev *dev,
84 void **context,
85 uint32_t nb_contexts,
86 struct rte_flow_error *err);
89 (struct rte_eth_dev *dev,
90 uint32_t queue_id,
91 void **contexts,
92 uint32_t nb_contexts,
93 struct rte_flow_error *error);
95 struct rte_flow_action_handle *(*action_handle_create)
96 (struct rte_eth_dev *dev,
97 const struct rte_flow_indir_action_conf *conf,
98 const struct rte_flow_action *action,
99 struct rte_flow_error *error);
102 (struct rte_eth_dev *dev,
103 struct rte_flow_action_handle *handle,
104 struct rte_flow_error *error);
107 (struct rte_eth_dev *dev,
108 struct rte_flow_action_handle *handle,
109 const void *update,
110 struct rte_flow_error *error);
113 (struct rte_eth_dev *dev,
114 const struct rte_flow_action_handle *handle,
115 void *data,
116 struct rte_flow_error *error);
119 (struct rte_eth_dev *dev,
120 struct rte_flow_tunnel *tunnel,
121 struct rte_flow_action **pmd_actions,
122 uint32_t *num_of_actions,
123 struct rte_flow_error *err);
126 (struct rte_eth_dev *dev,
127 struct rte_flow_tunnel *tunnel,
128 struct rte_flow_item **pmd_items,
129 uint32_t *num_of_items,
130 struct rte_flow_error *err);
133 (struct rte_eth_dev *dev,
134 struct rte_mbuf *m,
135 struct rte_flow_restore_info *info,
136 struct rte_flow_error *err);
139 (struct rte_eth_dev *dev,
140 struct rte_flow_action *pmd_actions,
141 uint32_t num_of_actions,
142 struct rte_flow_error *err);
145 (struct rte_eth_dev *dev,
146 struct rte_flow_item *pmd_items,
147 uint32_t num_of_items,
148 struct rte_flow_error *err);
151 (struct rte_eth_dev *dev,
152 uint16_t *proxy_port_id,
153 struct rte_flow_error *error);
154 struct rte_flow_item_flex_handle *(*flex_item_create)
155 (struct rte_eth_dev *dev,
156 const struct rte_flow_item_flex_conf *conf,
157 struct rte_flow_error *error);
158 int (*flex_item_release)
159 (struct rte_eth_dev *dev,
160 const struct rte_flow_item_flex_handle *handle,
161 struct rte_flow_error *error);
163 int (*info_get)
164 (struct rte_eth_dev *dev,
165 struct rte_flow_port_info *port_info,
166 struct rte_flow_queue_info *queue_info,
167 struct rte_flow_error *err);
170 (struct rte_eth_dev *dev,
171 const struct rte_flow_port_attr *port_attr,
172 uint16_t nb_queue,
173 const struct rte_flow_queue_attr *queue_attr[],
174 struct rte_flow_error *err);
176 struct rte_flow_pattern_template *(*pattern_template_create)
177 (struct rte_eth_dev *dev,
178 const struct rte_flow_pattern_template_attr *template_attr,
179 const struct rte_flow_item pattern[],
180 struct rte_flow_error *err);
183 (struct rte_eth_dev *dev,
184 struct rte_flow_pattern_template *pattern_template,
185 struct rte_flow_error *err);
187 struct rte_flow_actions_template *(*actions_template_create)
188 (struct rte_eth_dev *dev,
189 const struct rte_flow_actions_template_attr *template_attr,
190 const struct rte_flow_action actions[],
191 const struct rte_flow_action masks[],
192 struct rte_flow_error *err);
195 (struct rte_eth_dev *dev,
196 struct rte_flow_actions_template *actions_template,
197 struct rte_flow_error *err);
199 struct rte_flow_template_table *(*template_table_create)
200 (struct rte_eth_dev *dev,
201 const struct rte_flow_template_table_attr *table_attr,
202 struct rte_flow_pattern_template *pattern_templates[],
203 uint8_t nb_pattern_templates,
204 struct rte_flow_actions_template *actions_templates[],
205 uint8_t nb_actions_templates,
206 struct rte_flow_error *err);
209 (struct rte_eth_dev *dev,
210 struct rte_flow_template_table *template_table,
211 struct rte_flow_error *err);
213 struct rte_flow *(*async_create)
214 (struct rte_eth_dev *dev,
215 uint32_t queue_id,
216 const struct rte_flow_op_attr *op_attr,
217 struct rte_flow_template_table *template_table,
218 const struct rte_flow_item pattern[],
219 uint8_t pattern_template_index,
220 const struct rte_flow_action actions[],
221 uint8_t actions_template_index,
222 void *user_data,
223 struct rte_flow_error *err);
226 (struct rte_eth_dev *dev,
227 uint32_t queue_id,
228 const struct rte_flow_op_attr *op_attr,
229 struct rte_flow *flow,
230 void *user_data,
231 struct rte_flow_error *err);
233 int (*push)
234 (struct rte_eth_dev *dev,
235 uint32_t queue_id,
236 struct rte_flow_error *err);
238 int (*pull)
239 (struct rte_eth_dev *dev,
240 uint32_t queue_id,
241 struct rte_flow_op_result res[],
242 uint16_t n_res,
243 struct rte_flow_error *error);
245 struct rte_flow_action_handle *(*async_action_handle_create)
246 (struct rte_eth_dev *dev,
247 uint32_t queue_id,
248 const struct rte_flow_op_attr *op_attr,
249 const struct rte_flow_indir_action_conf *indir_action_conf,
250 const struct rte_flow_action *action,
251 void *user_data,
252 struct rte_flow_error *err);
255 (struct rte_eth_dev *dev,
256 uint32_t queue_id,
257 const struct rte_flow_op_attr *op_attr,
258 struct rte_flow_action_handle *action_handle,
259 void *user_data,
260 struct rte_flow_error *error);
263 (struct rte_eth_dev *dev,
264 uint32_t queue_id,
265 const struct rte_flow_op_attr *op_attr,
266 struct rte_flow_action_handle *action_handle,
267 const void *update,
268 void *user_data,
269 struct rte_flow_error *error);
272 (struct rte_eth_dev *dev,
273 uint32_t queue_id,
274 const struct rte_flow_op_attr *op_attr,
275 const struct rte_flow_action_handle *action_handle,
276 void *data,
277 void *user_data,
278 struct rte_flow_error *error);
279};
280
294const struct rte_flow_ops *
295rte_flow_ops_get(uint16_t port_id, struct rte_flow_error *error);
296
297#ifdef __cplusplus
298}
299#endif
300
301#endif /* RTE_FLOW_DRIVER_H_ */
const struct rte_flow_ops * rte_flow_ops_get(uint16_t port_id, struct rte_flow_error *error)
int(* pattern_template_destroy)(struct rte_eth_dev *dev, struct rte_flow_pattern_template *pattern_template, struct rte_flow_error *err)
int(* get_aged_flows)(struct rte_eth_dev *dev, void **context, uint32_t nb_contexts, struct rte_flow_error *err)
int(* async_destroy)(struct rte_eth_dev *dev, uint32_t queue_id, const struct rte_flow_op_attr *op_attr, struct rte_flow *flow, void *user_data, struct rte_flow_error *err)
int(* tunnel_action_decap_release)(struct rte_eth_dev *dev, struct rte_flow_action *pmd_actions, uint32_t num_of_actions, struct rte_flow_error *err)
int(* action_handle_query)(struct rte_eth_dev *dev, const struct rte_flow_action_handle *handle, void *data, struct rte_flow_error *error)
int(* tunnel_match)(struct rte_eth_dev *dev, struct rte_flow_tunnel *tunnel, struct rte_flow_item **pmd_items, uint32_t *num_of_items, struct rte_flow_error *err)
int(* async_action_handle_query)(struct rte_eth_dev *dev, uint32_t queue_id, const struct rte_flow_op_attr *op_attr, const struct rte_flow_action_handle *action_handle, void *data, void *user_data, struct rte_flow_error *error)
int(* tunnel_item_release)(struct rte_eth_dev *dev, struct rte_flow_item *pmd_items, uint32_t num_of_items, struct rte_flow_error *err)
int(* get_restore_info)(struct rte_eth_dev *dev, struct rte_mbuf *m, struct rte_flow_restore_info *info, struct rte_flow_error *err)
int(* tunnel_decap_set)(struct rte_eth_dev *dev, struct rte_flow_tunnel *tunnel, struct rte_flow_action **pmd_actions, uint32_t *num_of_actions, struct rte_flow_error *err)
int(* get_q_aged_flows)(struct rte_eth_dev *dev, uint32_t queue_id, void **contexts, uint32_t nb_contexts, struct rte_flow_error *error)
int(* actions_template_destroy)(struct rte_eth_dev *dev, struct rte_flow_actions_template *actions_template, struct rte_flow_error *err)
int(* pull)(struct rte_eth_dev *dev, uint32_t queue_id, struct rte_flow_op_result res[], uint16_t n_res, struct rte_flow_error *error)
int(* template_table_destroy)(struct rte_eth_dev *dev, struct rte_flow_template_table *template_table, struct rte_flow_error *err)
int(* async_action_handle_update)(struct rte_eth_dev *dev, uint32_t queue_id, const struct rte_flow_op_attr *op_attr, struct rte_flow_action_handle *action_handle, const void *update, void *user_data, struct rte_flow_error *error)
int(* validate)(struct rte_eth_dev *, const struct rte_flow_attr *, const struct rte_flow_item[], const struct rte_flow_action[], struct rte_flow_error *)
int(* info_get)(struct rte_eth_dev *dev, struct rte_flow_port_info *port_info, struct rte_flow_queue_info *queue_info, struct rte_flow_error *err)
int(* async_action_handle_destroy)(struct rte_eth_dev *dev, uint32_t queue_id, const struct rte_flow_op_attr *op_attr, struct rte_flow_action_handle *action_handle, void *user_data, struct rte_flow_error *error)
int(* pick_transfer_proxy)(struct rte_eth_dev *dev, uint16_t *proxy_port_id, struct rte_flow_error *error)
int(* configure)(struct rte_eth_dev *dev, const struct rte_flow_port_attr *port_attr, uint16_t nb_queue, const struct rte_flow_queue_attr *queue_attr[], struct rte_flow_error *err)
int(* action_handle_destroy)(struct rte_eth_dev *dev, struct rte_flow_action_handle *handle, struct rte_flow_error *error)
int(* push)(struct rte_eth_dev *dev, uint32_t queue_id, struct rte_flow_error *err)
int(* query)(struct rte_eth_dev *, struct rte_flow *, const struct rte_flow_action *, void *, struct rte_flow_error *)
int(* flush)(struct rte_eth_dev *, struct rte_flow_error *)
int(* destroy)(struct rte_eth_dev *, struct rte_flow *, struct rte_flow_error *)
int(* isolate)(struct rte_eth_dev *, int, struct rte_flow_error *)
int(* dev_dump)(struct rte_eth_dev *dev, struct rte_flow *flow, FILE *file, struct rte_flow_error *error)
int(* action_handle_update)(struct rte_eth_dev *dev, struct rte_flow_action_handle *handle, const void *update, struct rte_flow_error *error)