DPDK  20.11.10
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 "rte_ethdev_driver.h"
22 #include "rte_flow.h"
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
64 struct rte_flow_ops {
66  int (*validate)
67  (struct rte_eth_dev *,
68  const struct rte_flow_attr *,
69  const struct rte_flow_item [],
70  const struct rte_flow_action [],
71  struct rte_flow_error *);
73  struct rte_flow *(*create)
74  (struct rte_eth_dev *,
75  const struct rte_flow_attr *,
76  const struct rte_flow_item [],
77  const struct rte_flow_action [],
78  struct rte_flow_error *);
80  int (*destroy)
81  (struct rte_eth_dev *,
82  struct rte_flow *,
83  struct rte_flow_error *);
85  int (*flush)
86  (struct rte_eth_dev *,
87  struct rte_flow_error *);
89  int (*query)
90  (struct rte_eth_dev *,
91  struct rte_flow *,
92  const struct rte_flow_action *,
93  void *,
94  struct rte_flow_error *);
96  int (*isolate)
97  (struct rte_eth_dev *,
98  int,
99  struct rte_flow_error *);
101  int (*dev_dump)
102  (struct rte_eth_dev *dev,
103  FILE *file,
104  struct rte_flow_error *error);
106  int (*get_aged_flows)
107  (struct rte_eth_dev *dev,
108  void **context,
109  uint32_t nb_contexts,
110  struct rte_flow_error *err);
112  struct rte_flow_shared_action *(*shared_action_create)
113  (struct rte_eth_dev *dev,
114  const struct rte_flow_shared_action_conf *conf,
115  const struct rte_flow_action *action,
116  struct rte_flow_error *error);
118  int (*shared_action_destroy)
119  (struct rte_eth_dev *dev,
120  struct rte_flow_shared_action *shared_action,
121  struct rte_flow_error *error);
123  int (*shared_action_update)
124  (struct rte_eth_dev *dev,
125  struct rte_flow_shared_action *shared_action,
126  const struct rte_flow_action *update,
127  struct rte_flow_error *error);
129  int (*shared_action_query)
130  (struct rte_eth_dev *dev,
131  const struct rte_flow_shared_action *shared_action,
132  void *data,
133  struct rte_flow_error *error);
135  int (*tunnel_decap_set)
136  (struct rte_eth_dev *dev,
137  struct rte_flow_tunnel *tunnel,
138  struct rte_flow_action **pmd_actions,
139  uint32_t *num_of_actions,
140  struct rte_flow_error *err);
142  int (*tunnel_match)
143  (struct rte_eth_dev *dev,
144  struct rte_flow_tunnel *tunnel,
145  struct rte_flow_item **pmd_items,
146  uint32_t *num_of_items,
147  struct rte_flow_error *err);
149  int (*get_restore_info)
150  (struct rte_eth_dev *dev,
151  struct rte_mbuf *m,
152  struct rte_flow_restore_info *info,
153  struct rte_flow_error *err);
156  (struct rte_eth_dev *dev,
157  struct rte_flow_action *pmd_actions,
158  uint32_t num_of_actions,
159  struct rte_flow_error *err);
161  int (*tunnel_item_release)
162  (struct rte_eth_dev *dev,
163  struct rte_flow_item *pmd_items,
164  uint32_t num_of_items,
165  struct rte_flow_error *err);
166 };
167 
181 const struct rte_flow_ops *
182 rte_flow_ops_get(uint16_t port_id, struct rte_flow_error *error);
183 
184 #ifdef __cplusplus
185 }
186 #endif
187 
188 #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(* dev_dump)(struct rte_eth_dev *dev, FILE *file, 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(* query)(struct rte_eth_dev *, struct rte_flow *, const struct rte_flow_action *, void *, struct rte_flow_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(* get_aged_flows)(struct rte_eth_dev *dev, void **context, uint32_t nb_contexts, 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_restore_info)(struct rte_eth_dev *dev, struct rte_mbuf *m, struct rte_flow_restore_info *info, struct rte_flow_error *err)
int(* shared_action_destroy)(struct rte_eth_dev *dev, struct rte_flow_shared_action *shared_action, struct rte_flow_error *error)
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(* shared_action_query)(struct rte_eth_dev *dev, const struct rte_flow_shared_action *shared_action, void *data, struct rte_flow_error *error)
int(* shared_action_update)(struct rte_eth_dev *dev, struct rte_flow_shared_action *shared_action, const struct rte_flow_action *update, struct rte_flow_error *error)
int(* isolate)(struct rte_eth_dev *, int, 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 *)
const struct rte_flow_ops * rte_flow_ops_get(uint16_t port_id, struct rte_flow_error *error)