DPDK  20.05.0-rc0
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_flow.h"
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
63 struct rte_flow_ops {
65  int (*validate)
66  (struct rte_eth_dev *,
67  const struct rte_flow_attr *,
68  const struct rte_flow_item [],
69  const struct rte_flow_action [],
70  struct rte_flow_error *);
72  struct rte_flow *(*create)
73  (struct rte_eth_dev *,
74  const struct rte_flow_attr *,
75  const struct rte_flow_item [],
76  const struct rte_flow_action [],
77  struct rte_flow_error *);
79  int (*destroy)
80  (struct rte_eth_dev *,
81  struct rte_flow *,
82  struct rte_flow_error *);
84  int (*flush)
85  (struct rte_eth_dev *,
86  struct rte_flow_error *);
88  int (*query)
89  (struct rte_eth_dev *,
90  struct rte_flow *,
91  const struct rte_flow_action *,
92  void *,
93  struct rte_flow_error *);
95  int (*isolate)
96  (struct rte_eth_dev *,
97  int,
98  struct rte_flow_error *);
100  int (*dev_dump)
101  (struct rte_eth_dev *dev,
102  FILE *file,
103  struct rte_flow_error *error);
104 };
105 
119 const struct rte_flow_ops *
120 rte_flow_ops_get(uint16_t port_id, struct rte_flow_error *error);
121 
123 #define RTE_FLOW_EXPAND_RSS_NEXT(...) \
124  (const int []){ \
125  __VA_ARGS__, 0, \
126  }
127 
130  const int *const next;
136  uint64_t rss_types;
141 };
142 
145  uint32_t entries;
147  struct {
149  uint32_t priority;
150  } entry[];
151 };
152 
179 __rte_experimental
180 int
181 rte_flow_expand_rss(struct rte_flow_expand_rss *buf, size_t size,
182  const struct rte_flow_item *pattern, uint64_t types,
183  const struct rte_flow_expand_node graph[],
184  int graph_root_index);
185 
186 #ifdef __cplusplus
187 }
188 #endif
189 
190 #endif /* RTE_FLOW_DRIVER_H_ */
rte_flow_ops::validate
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 *)
Definition: rte_flow_driver.h:66
rte_flow_ops_get
const struct rte_flow_ops * rte_flow_ops_get(uint16_t port_id, struct rte_flow_error *error)
rte_flow_expand_rss::entries
uint32_t entries
Definition: rte_flow_driver.h:145
rte_flow_item
Definition: rte_flow.h:1574
rte_flow_ops::isolate
int(* isolate)(struct rte_eth_dev *, int, struct rte_flow_error *)
Definition: rte_flow_driver.h:96
rte_flow_ops::destroy
int(* destroy)(struct rte_eth_dev *, struct rte_flow *, struct rte_flow_error *)
Definition: rte_flow_driver.h:80
rte_flow_expand_node::next
const int *const next
Definition: rte_flow_driver.h:130
rte_flow_expand_node
Definition: rte_flow_driver.h:129
rte_flow.h
rte_flow_ops
Definition: rte_flow_driver.h:63
rte_flow_expand_node::type
enum rte_flow_item_type type
Definition: rte_flow_driver.h:134
rte_flow_expand_rss
__rte_experimental int rte_flow_expand_rss(struct rte_flow_expand_rss *buf, size_t size, const struct rte_flow_item *pattern, uint64_t types, const struct rte_flow_expand_node graph[], int graph_root_index)
rte_flow_ops::flush
int(* flush)(struct rte_eth_dev *, struct rte_flow_error *)
Definition: rte_flow_driver.h:85
rte_flow_attr
Definition: rte_flow.h:75
rte_flow_expand_rss
Definition: rte_flow_driver.h:144
rte_flow_ops::query
int(* query)(struct rte_eth_dev *, struct rte_flow *, const struct rte_flow_action *, void *, struct rte_flow_error *)
Definition: rte_flow_driver.h:89
rte_ethdev.h
rte_flow_expand_rss::pattern
struct rte_flow_item * pattern
Definition: rte_flow_driver.h:148
rte_flow_expand_rss::priority
uint32_t priority
Definition: rte_flow_driver.h:149
rte_flow_error
Definition: rte_flow.h:2711
rte_flow_ops::dev_dump
int(* dev_dump)(struct rte_eth_dev *dev, FILE *file, struct rte_flow_error *error)
Definition: rte_flow_driver.h:101
rte_flow_expand_node::rss_types
uint64_t rss_types
Definition: rte_flow_driver.h:136
rte_flow_item_type
rte_flow_item_type
Definition: rte_flow.h:118