DPDK  22.03.0
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
25 extern "C" {
26 #endif
27 
39 struct rte_flow_ops {
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);
82  int (*get_aged_flows)
83  (struct rte_eth_dev *dev,
84  void **context,
85  uint32_t nb_contexts,
86  struct rte_flow_error *err);
88  struct rte_flow_action_handle *(*action_handle_create)
89  (struct rte_eth_dev *dev,
90  const struct rte_flow_indir_action_conf *conf,
91  const struct rte_flow_action *action,
92  struct rte_flow_error *error);
95  (struct rte_eth_dev *dev,
96  struct rte_flow_action_handle *handle,
97  struct rte_flow_error *error);
100  (struct rte_eth_dev *dev,
101  struct rte_flow_action_handle *handle,
102  const void *update,
103  struct rte_flow_error *error);
105  int (*action_handle_query)
106  (struct rte_eth_dev *dev,
107  const struct rte_flow_action_handle *handle,
108  void *data,
109  struct rte_flow_error *error);
111  int (*tunnel_decap_set)
112  (struct rte_eth_dev *dev,
113  struct rte_flow_tunnel *tunnel,
114  struct rte_flow_action **pmd_actions,
115  uint32_t *num_of_actions,
116  struct rte_flow_error *err);
118  int (*tunnel_match)
119  (struct rte_eth_dev *dev,
120  struct rte_flow_tunnel *tunnel,
121  struct rte_flow_item **pmd_items,
122  uint32_t *num_of_items,
123  struct rte_flow_error *err);
125  int (*get_restore_info)
126  (struct rte_eth_dev *dev,
127  struct rte_mbuf *m,
128  struct rte_flow_restore_info *info,
129  struct rte_flow_error *err);
132  (struct rte_eth_dev *dev,
133  struct rte_flow_action *pmd_actions,
134  uint32_t num_of_actions,
135  struct rte_flow_error *err);
137  int (*tunnel_item_release)
138  (struct rte_eth_dev *dev,
139  struct rte_flow_item *pmd_items,
140  uint32_t num_of_items,
141  struct rte_flow_error *err);
143  int (*pick_transfer_proxy)
144  (struct rte_eth_dev *dev,
145  uint16_t *proxy_port_id,
146  struct rte_flow_error *error);
147  struct rte_flow_item_flex_handle *(*flex_item_create)
148  (struct rte_eth_dev *dev,
149  const struct rte_flow_item_flex_conf *conf,
150  struct rte_flow_error *error);
151  int (*flex_item_release)
152  (struct rte_eth_dev *dev,
153  const struct rte_flow_item_flex_handle *handle,
154  struct rte_flow_error *error);
156  int (*info_get)
157  (struct rte_eth_dev *dev,
158  struct rte_flow_port_info *port_info,
159  struct rte_flow_queue_info *queue_info,
160  struct rte_flow_error *err);
162  int (*configure)
163  (struct rte_eth_dev *dev,
164  const struct rte_flow_port_attr *port_attr,
165  uint16_t nb_queue,
166  const struct rte_flow_queue_attr *queue_attr[],
167  struct rte_flow_error *err);
169  struct rte_flow_pattern_template *(*pattern_template_create)
170  (struct rte_eth_dev *dev,
171  const struct rte_flow_pattern_template_attr *template_attr,
172  const struct rte_flow_item pattern[],
173  struct rte_flow_error *err);
176  (struct rte_eth_dev *dev,
177  struct rte_flow_pattern_template *pattern_template,
178  struct rte_flow_error *err);
180  struct rte_flow_actions_template *(*actions_template_create)
181  (struct rte_eth_dev *dev,
182  const struct rte_flow_actions_template_attr *template_attr,
183  const struct rte_flow_action actions[],
184  const struct rte_flow_action masks[],
185  struct rte_flow_error *err);
188  (struct rte_eth_dev *dev,
189  struct rte_flow_actions_template *actions_template,
190  struct rte_flow_error *err);
192  struct rte_flow_template_table *(*template_table_create)
193  (struct rte_eth_dev *dev,
194  const struct rte_flow_template_table_attr *table_attr,
195  struct rte_flow_pattern_template *pattern_templates[],
196  uint8_t nb_pattern_templates,
197  struct rte_flow_actions_template *actions_templates[],
198  uint8_t nb_actions_templates,
199  struct rte_flow_error *err);
202  (struct rte_eth_dev *dev,
203  struct rte_flow_template_table *template_table,
204  struct rte_flow_error *err);
206  struct rte_flow *(*async_create)
207  (struct rte_eth_dev *dev,
208  uint32_t queue_id,
209  const struct rte_flow_op_attr *op_attr,
210  struct rte_flow_template_table *template_table,
211  const struct rte_flow_item pattern[],
212  uint8_t pattern_template_index,
213  const struct rte_flow_action actions[],
214  uint8_t actions_template_index,
215  void *user_data,
216  struct rte_flow_error *err);
218  int (*async_destroy)
219  (struct rte_eth_dev *dev,
220  uint32_t queue_id,
221  const struct rte_flow_op_attr *op_attr,
222  struct rte_flow *flow,
223  void *user_data,
224  struct rte_flow_error *err);
226  int (*push)
227  (struct rte_eth_dev *dev,
228  uint32_t queue_id,
229  struct rte_flow_error *err);
231  int (*pull)
232  (struct rte_eth_dev *dev,
233  uint32_t queue_id,
234  struct rte_flow_op_result res[],
235  uint16_t n_res,
236  struct rte_flow_error *error);
238  struct rte_flow_action_handle *(*async_action_handle_create)
239  (struct rte_eth_dev *dev,
240  uint32_t queue_id,
241  const struct rte_flow_op_attr *op_attr,
242  const struct rte_flow_indir_action_conf *indir_action_conf,
243  const struct rte_flow_action *action,
244  void *user_data,
245  struct rte_flow_error *err);
248  (struct rte_eth_dev *dev,
249  uint32_t queue_id,
250  const struct rte_flow_op_attr *op_attr,
251  struct rte_flow_action_handle *action_handle,
252  void *user_data,
253  struct rte_flow_error *error);
256  (struct rte_eth_dev *dev,
257  uint32_t queue_id,
258  const struct rte_flow_op_attr *op_attr,
259  struct rte_flow_action_handle *action_handle,
260  const void *update,
261  void *user_data,
262  struct rte_flow_error *error);
263 };
264 
278 const struct rte_flow_ops *
279 rte_flow_ops_get(uint16_t port_id, struct rte_flow_error *error);
280 
281 #ifdef __cplusplus
282 }
283 #endif
284 
285 #endif /* RTE_FLOW_DRIVER_H_ */
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(* 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(* template_table_destroy)(struct rte_eth_dev *dev, struct rte_flow_template_table *template_table, struct rte_flow_error *err)
int(* actions_template_destroy)(struct rte_eth_dev *dev, struct rte_flow_actions_template *actions_template, struct rte_flow_error *err)
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(* 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(* 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(* query)(struct rte_eth_dev *, struct rte_flow *, const struct rte_flow_action *, void *, struct rte_flow_error *)
int(* action_handle_query)(struct rte_eth_dev *dev, const struct rte_flow_action_handle *handle, void *data, struct rte_flow_error *error)
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(* 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(* push)(struct rte_eth_dev *dev, uint32_t queue_id, struct rte_flow_error *err)
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(* 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(* action_handle_destroy)(struct rte_eth_dev *dev, struct rte_flow_action_handle *handle, 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(* 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_restore_info)(struct rte_eth_dev *dev, struct rte_mbuf *m, struct rte_flow_restore_info *info, 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(* isolate)(struct rte_eth_dev *, int, struct rte_flow_error *)
int(* flush)(struct rte_eth_dev *, struct rte_flow_error *)
int(* dev_dump)(struct rte_eth_dev *dev, struct rte_flow *flow, FILE *file, struct rte_flow_error *error)
int(* destroy)(struct rte_eth_dev *, struct rte_flow *, struct rte_flow_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_update)(struct rte_eth_dev *dev, struct rte_flow_action_handle *handle, const void *update, struct rte_flow_error *error)
const struct rte_flow_ops * rte_flow_ops_get(uint16_t port_id, struct rte_flow_error *error)