net/mlx5: support LRO with single RxQ object
[dpdk.git] / drivers / net / mlx5 / mlx5_flow.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright 2018 Mellanox Technologies, Ltd
3  */
4
5 #ifndef RTE_PMD_MLX5_FLOW_H_
6 #define RTE_PMD_MLX5_FLOW_H_
7
8 #include <netinet/in.h>
9 #include <sys/queue.h>
10 #include <stdalign.h>
11 #include <stdint.h>
12 #include <string.h>
13
14 /* Verbs header. */
15 /* ISO C doesn't support unnamed structs/unions, disabling -pedantic. */
16 #ifdef PEDANTIC
17 #pragma GCC diagnostic ignored "-Wpedantic"
18 #endif
19 #include <infiniband/verbs.h>
20 #ifdef PEDANTIC
21 #pragma GCC diagnostic error "-Wpedantic"
22 #endif
23
24 #include <rte_atomic.h>
25 #include <rte_alarm.h>
26
27 #include "mlx5.h"
28 #include "mlx5_prm.h"
29
30 /* Pattern outer Layer bits. */
31 #define MLX5_FLOW_LAYER_OUTER_L2 (1u << 0)
32 #define MLX5_FLOW_LAYER_OUTER_L3_IPV4 (1u << 1)
33 #define MLX5_FLOW_LAYER_OUTER_L3_IPV6 (1u << 2)
34 #define MLX5_FLOW_LAYER_OUTER_L4_UDP (1u << 3)
35 #define MLX5_FLOW_LAYER_OUTER_L4_TCP (1u << 4)
36 #define MLX5_FLOW_LAYER_OUTER_VLAN (1u << 5)
37
38 /* Pattern inner Layer bits. */
39 #define MLX5_FLOW_LAYER_INNER_L2 (1u << 6)
40 #define MLX5_FLOW_LAYER_INNER_L3_IPV4 (1u << 7)
41 #define MLX5_FLOW_LAYER_INNER_L3_IPV6 (1u << 8)
42 #define MLX5_FLOW_LAYER_INNER_L4_UDP (1u << 9)
43 #define MLX5_FLOW_LAYER_INNER_L4_TCP (1u << 10)
44 #define MLX5_FLOW_LAYER_INNER_VLAN (1u << 11)
45
46 /* Pattern tunnel Layer bits. */
47 #define MLX5_FLOW_LAYER_VXLAN (1u << 12)
48 #define MLX5_FLOW_LAYER_VXLAN_GPE (1u << 13)
49 #define MLX5_FLOW_LAYER_GRE (1u << 14)
50 #define MLX5_FLOW_LAYER_MPLS (1u << 15)
51
52 /* General pattern items bits. */
53 #define MLX5_FLOW_ITEM_METADATA (1u << 16)
54 #define MLX5_FLOW_ITEM_PORT_ID (1u << 17)
55
56 /* Pattern MISC bits. */
57 #define MLX5_FLOW_LAYER_ICMP (1u << 18)
58 #define MLX5_FLOW_LAYER_ICMP6 (1u << 19)
59 #define MLX5_FLOW_LAYER_GRE_KEY (1u << 20)
60
61 #define MLX5_FLOW_LAYER_IPIP (1u << 21)
62 #define MLX5_FLOW_LAYER_IPV6_ENCAP (1u << 22)
63
64 /* Outer Masks. */
65 #define MLX5_FLOW_LAYER_OUTER_L3 \
66         (MLX5_FLOW_LAYER_OUTER_L3_IPV4 | MLX5_FLOW_LAYER_OUTER_L3_IPV6)
67 #define MLX5_FLOW_LAYER_OUTER_L4 \
68         (MLX5_FLOW_LAYER_OUTER_L4_UDP | MLX5_FLOW_LAYER_OUTER_L4_TCP)
69 #define MLX5_FLOW_LAYER_OUTER \
70         (MLX5_FLOW_LAYER_OUTER_L2 | MLX5_FLOW_LAYER_OUTER_L3 | \
71          MLX5_FLOW_LAYER_OUTER_L4)
72
73 /* LRO support mask, i.e. flow contains IPv4/IPv6 and TCP. */
74 #define MLX5_FLOW_LAYER_IPV4_LRO \
75         (MLX5_FLOW_LAYER_OUTER_L3_IPV4 | MLX5_FLOW_LAYER_OUTER_L4_TCP)
76 #define MLX5_FLOW_LAYER_IPV6_LRO \
77         (MLX5_FLOW_LAYER_OUTER_L3_IPV6 | MLX5_FLOW_LAYER_OUTER_L4_TCP)
78
79 /* Tunnel Masks. */
80 #define MLX5_FLOW_LAYER_TUNNEL \
81         (MLX5_FLOW_LAYER_VXLAN | MLX5_FLOW_LAYER_VXLAN_GPE | \
82          MLX5_FLOW_LAYER_GRE | MLX5_FLOW_LAYER_MPLS | \
83          MLX5_FLOW_LAYER_IPIP | MLX5_FLOW_LAYER_IPV6_ENCAP)
84
85 /* Inner Masks. */
86 #define MLX5_FLOW_LAYER_INNER_L3 \
87         (MLX5_FLOW_LAYER_INNER_L3_IPV4 | MLX5_FLOW_LAYER_INNER_L3_IPV6)
88 #define MLX5_FLOW_LAYER_INNER_L4 \
89         (MLX5_FLOW_LAYER_INNER_L4_UDP | MLX5_FLOW_LAYER_INNER_L4_TCP)
90 #define MLX5_FLOW_LAYER_INNER \
91         (MLX5_FLOW_LAYER_INNER_L2 | MLX5_FLOW_LAYER_INNER_L3 | \
92          MLX5_FLOW_LAYER_INNER_L4)
93
94 /* Layer Masks. */
95 #define MLX5_FLOW_LAYER_L2 \
96         (MLX5_FLOW_LAYER_OUTER_L2 | MLX5_FLOW_LAYER_INNER_L2)
97 #define MLX5_FLOW_LAYER_L3_IPV4 \
98         (MLX5_FLOW_LAYER_OUTER_L3_IPV4 | MLX5_FLOW_LAYER_INNER_L3_IPV4)
99 #define MLX5_FLOW_LAYER_L3_IPV6 \
100         (MLX5_FLOW_LAYER_OUTER_L3_IPV6 | MLX5_FLOW_LAYER_INNER_L3_IPV6)
101 #define MLX5_FLOW_LAYER_L3 \
102         (MLX5_FLOW_LAYER_L3_IPV4 | MLX5_FLOW_LAYER_L3_IPV6)
103 #define MLX5_FLOW_LAYER_L4 \
104         (MLX5_FLOW_LAYER_OUTER_L4 | MLX5_FLOW_LAYER_INNER_L4)
105
106 /* Actions */
107 #define MLX5_FLOW_ACTION_DROP (1u << 0)
108 #define MLX5_FLOW_ACTION_QUEUE (1u << 1)
109 #define MLX5_FLOW_ACTION_RSS (1u << 2)
110 #define MLX5_FLOW_ACTION_FLAG (1u << 3)
111 #define MLX5_FLOW_ACTION_MARK (1u << 4)
112 #define MLX5_FLOW_ACTION_COUNT (1u << 5)
113 #define MLX5_FLOW_ACTION_PORT_ID (1u << 6)
114 #define MLX5_FLOW_ACTION_OF_POP_VLAN (1u << 7)
115 #define MLX5_FLOW_ACTION_OF_PUSH_VLAN (1u << 8)
116 #define MLX5_FLOW_ACTION_OF_SET_VLAN_VID (1u << 9)
117 #define MLX5_FLOW_ACTION_OF_SET_VLAN_PCP (1u << 10)
118 #define MLX5_FLOW_ACTION_SET_IPV4_SRC (1u << 11)
119 #define MLX5_FLOW_ACTION_SET_IPV4_DST (1u << 12)
120 #define MLX5_FLOW_ACTION_SET_IPV6_SRC (1u << 13)
121 #define MLX5_FLOW_ACTION_SET_IPV6_DST (1u << 14)
122 #define MLX5_FLOW_ACTION_SET_TP_SRC (1u << 15)
123 #define MLX5_FLOW_ACTION_SET_TP_DST (1u << 16)
124 #define MLX5_FLOW_ACTION_JUMP (1u << 17)
125 #define MLX5_FLOW_ACTION_SET_TTL (1u << 18)
126 #define MLX5_FLOW_ACTION_DEC_TTL (1u << 19)
127 #define MLX5_FLOW_ACTION_SET_MAC_SRC (1u << 20)
128 #define MLX5_FLOW_ACTION_SET_MAC_DST (1u << 21)
129 #define MLX5_FLOW_ACTION_VXLAN_ENCAP (1u << 22)
130 #define MLX5_FLOW_ACTION_VXLAN_DECAP (1u << 23)
131 #define MLX5_FLOW_ACTION_NVGRE_ENCAP (1u << 24)
132 #define MLX5_FLOW_ACTION_NVGRE_DECAP (1u << 25)
133 #define MLX5_FLOW_ACTION_RAW_ENCAP (1u << 26)
134 #define MLX5_FLOW_ACTION_RAW_DECAP (1u << 27)
135 #define MLX5_FLOW_ACTION_INC_TCP_SEQ (1u << 28)
136 #define MLX5_FLOW_ACTION_DEC_TCP_SEQ (1u << 29)
137 #define MLX5_FLOW_ACTION_INC_TCP_ACK (1u << 30)
138 #define MLX5_FLOW_ACTION_DEC_TCP_ACK (1u << 31)
139
140 #define MLX5_FLOW_FATE_ACTIONS \
141         (MLX5_FLOW_ACTION_DROP | MLX5_FLOW_ACTION_QUEUE | \
142          MLX5_FLOW_ACTION_RSS | MLX5_FLOW_ACTION_JUMP)
143
144 #define MLX5_FLOW_FATE_ESWITCH_ACTIONS \
145         (MLX5_FLOW_ACTION_DROP | MLX5_FLOW_ACTION_PORT_ID | \
146          MLX5_FLOW_ACTION_JUMP)
147
148 #define MLX5_FLOW_ENCAP_ACTIONS (MLX5_FLOW_ACTION_VXLAN_ENCAP | \
149                                  MLX5_FLOW_ACTION_NVGRE_ENCAP | \
150                                  MLX5_FLOW_ACTION_RAW_ENCAP)
151
152 #define MLX5_FLOW_DECAP_ACTIONS (MLX5_FLOW_ACTION_VXLAN_DECAP | \
153                                  MLX5_FLOW_ACTION_NVGRE_DECAP | \
154                                  MLX5_FLOW_ACTION_RAW_DECAP)
155
156 #define MLX5_FLOW_MODIFY_HDR_ACTIONS (MLX5_FLOW_ACTION_SET_IPV4_SRC | \
157                                       MLX5_FLOW_ACTION_SET_IPV4_DST | \
158                                       MLX5_FLOW_ACTION_SET_IPV6_SRC | \
159                                       MLX5_FLOW_ACTION_SET_IPV6_DST | \
160                                       MLX5_FLOW_ACTION_SET_TP_SRC | \
161                                       MLX5_FLOW_ACTION_SET_TP_DST | \
162                                       MLX5_FLOW_ACTION_SET_TTL | \
163                                       MLX5_FLOW_ACTION_DEC_TTL | \
164                                       MLX5_FLOW_ACTION_SET_MAC_SRC | \
165                                       MLX5_FLOW_ACTION_SET_MAC_DST | \
166                                       MLX5_FLOW_ACTION_INC_TCP_SEQ | \
167                                       MLX5_FLOW_ACTION_DEC_TCP_SEQ | \
168                                       MLX5_FLOW_ACTION_INC_TCP_ACK | \
169                                       MLX5_FLOW_ACTION_DEC_TCP_ACK)
170
171 #ifndef IPPROTO_MPLS
172 #define IPPROTO_MPLS 137
173 #endif
174
175 /* UDP port number for MPLS */
176 #define MLX5_UDP_PORT_MPLS 6635
177
178 /* UDP port numbers for VxLAN. */
179 #define MLX5_UDP_PORT_VXLAN 4789
180 #define MLX5_UDP_PORT_VXLAN_GPE 4790
181
182 /* Priority reserved for default flows. */
183 #define MLX5_FLOW_PRIO_RSVD ((uint32_t)-1)
184
185 /*
186  * Number of sub priorities.
187  * For each kind of pattern matching i.e. L2, L3, L4 to have a correct
188  * matching on the NIC (firmware dependent) L4 most have the higher priority
189  * followed by L3 and ending with L2.
190  */
191 #define MLX5_PRIORITY_MAP_L2 2
192 #define MLX5_PRIORITY_MAP_L3 1
193 #define MLX5_PRIORITY_MAP_L4 0
194 #define MLX5_PRIORITY_MAP_MAX 3
195
196 /* Valid layer type for IPV4 RSS. */
197 #define MLX5_IPV4_LAYER_TYPES \
198         (ETH_RSS_IPV4 | ETH_RSS_FRAG_IPV4 | \
199          ETH_RSS_NONFRAG_IPV4_TCP | ETH_RSS_NONFRAG_IPV4_UDP | \
200          ETH_RSS_NONFRAG_IPV4_OTHER)
201
202 /* IBV hash source bits  for IPV4. */
203 #define MLX5_IPV4_IBV_RX_HASH (IBV_RX_HASH_SRC_IPV4 | IBV_RX_HASH_DST_IPV4)
204
205 /* Valid layer type for IPV6 RSS. */
206 #define MLX5_IPV6_LAYER_TYPES \
207         (ETH_RSS_IPV6 | ETH_RSS_FRAG_IPV6 | ETH_RSS_NONFRAG_IPV6_TCP | \
208          ETH_RSS_NONFRAG_IPV6_UDP | ETH_RSS_IPV6_EX  | ETH_RSS_IPV6_TCP_EX | \
209          ETH_RSS_IPV6_UDP_EX | ETH_RSS_NONFRAG_IPV6_OTHER)
210
211 /* IBV hash source bits  for IPV6. */
212 #define MLX5_IPV6_IBV_RX_HASH (IBV_RX_HASH_SRC_IPV6 | IBV_RX_HASH_DST_IPV6)
213
214 enum mlx5_flow_drv_type {
215         MLX5_FLOW_TYPE_MIN,
216         MLX5_FLOW_TYPE_DV,
217         MLX5_FLOW_TYPE_VERBS,
218         MLX5_FLOW_TYPE_MAX,
219 };
220
221 /* Matcher PRM representation */
222 struct mlx5_flow_dv_match_params {
223         size_t size;
224         /**< Size of match value. Do NOT split size and key! */
225         uint32_t buf[MLX5_ST_SZ_DW(fte_match_param)];
226         /**< Matcher value. This value is used as the mask or as a key. */
227 };
228
229 /* Matcher structure. */
230 struct mlx5_flow_dv_matcher {
231         LIST_ENTRY(mlx5_flow_dv_matcher) next;
232         /* Pointer to the next element. */
233         rte_atomic32_t refcnt; /**< Reference counter. */
234         void *matcher_object; /**< Pointer to DV matcher */
235         uint16_t crc; /**< CRC of key. */
236         uint16_t priority; /**< Priority of matcher. */
237         uint8_t egress; /**< Egress matcher. */
238         uint8_t transfer; /**< 1 if the flow is E-Switch flow. */
239         uint32_t group; /**< The matcher group. */
240         struct mlx5_flow_dv_match_params mask; /**< Matcher mask. */
241 };
242
243 #define MLX5_ENCAP_MAX_LEN 132
244
245 /* Encap/decap resource structure. */
246 struct mlx5_flow_dv_encap_decap_resource {
247         LIST_ENTRY(mlx5_flow_dv_encap_decap_resource) next;
248         /* Pointer to next element. */
249         rte_atomic32_t refcnt; /**< Reference counter. */
250         void *verbs_action;
251         /**< Verbs encap/decap action object. */
252         uint8_t buf[MLX5_ENCAP_MAX_LEN];
253         size_t size;
254         uint8_t reformat_type;
255         uint8_t ft_type;
256         uint64_t flags; /**< Flags for RDMA API. */
257 };
258
259 /* Tag resource structure. */
260 struct mlx5_flow_dv_tag_resource {
261         LIST_ENTRY(mlx5_flow_dv_tag_resource) next;
262         /* Pointer to next element. */
263         rte_atomic32_t refcnt; /**< Reference counter. */
264         void *action;
265         /**< Verbs tag action object. */
266         uint32_t tag; /**< the tag value. */
267 };
268
269 /* Number of modification commands. */
270 #define MLX5_MODIFY_NUM 8
271
272 /* Modify resource structure */
273 struct mlx5_flow_dv_modify_hdr_resource {
274         LIST_ENTRY(mlx5_flow_dv_modify_hdr_resource) next;
275         /* Pointer to next element. */
276         rte_atomic32_t refcnt; /**< Reference counter. */
277         struct ibv_flow_action *verbs_action;
278         /**< Verbs modify header action object. */
279         uint8_t ft_type; /**< Flow table type, Rx or Tx. */
280         uint32_t actions_num; /**< Number of modification actions. */
281         struct mlx5_modification_cmd actions[MLX5_MODIFY_NUM];
282         /**< Modification actions. */
283         uint64_t flags; /**< Flags for RDMA API. */
284 };
285
286 /* Jump action resource structure. */
287 struct mlx5_flow_dv_jump_tbl_resource {
288         LIST_ENTRY(mlx5_flow_dv_jump_tbl_resource) next;
289         /* Pointer to next element. */
290         rte_atomic32_t refcnt; /**< Reference counter. */
291         void *action; /**< Pointer to the rdma core action. */
292         uint8_t ft_type; /**< Flow table type, Rx or Tx. */
293         struct mlx5_flow_tbl_resource *tbl; /**< The target table. */
294 };
295
296 /* Port ID resource structure. */
297 struct mlx5_flow_dv_port_id_action_resource {
298         LIST_ENTRY(mlx5_flow_dv_port_id_action_resource) next;
299         /* Pointer to next element. */
300         rte_atomic32_t refcnt; /**< Reference counter. */
301         void *action;
302         /**< Verbs tag action object. */
303         uint32_t port_id; /**< Port ID value. */
304 };
305
306 /*
307  * Max number of actions per DV flow.
308  * See CREATE_FLOW_MAX_FLOW_ACTIONS_SUPPORTED
309  * In rdma-core file providers/mlx5/verbs.c
310  */
311 #define MLX5_DV_MAX_NUMBER_OF_ACTIONS 8
312
313 /* DV flows structure. */
314 struct mlx5_flow_dv {
315         uint64_t hash_fields; /**< Fields that participate in the hash. */
316         struct mlx5_hrxq *hrxq; /**< Hash Rx queues. */
317         /* Flow DV api: */
318         struct mlx5_flow_dv_matcher *matcher; /**< Cache to matcher. */
319         struct mlx5_flow_dv_match_params value;
320         /**< Holds the value that the packet is compared to. */
321         struct mlx5_flow_dv_encap_decap_resource *encap_decap;
322         /**< Pointer to encap/decap resource in cache. */
323         struct mlx5_flow_dv_modify_hdr_resource *modify_hdr;
324         /**< Pointer to modify header resource in cache. */
325         struct ibv_flow *flow; /**< Installed flow. */
326         struct mlx5_flow_dv_jump_tbl_resource *jump;
327         /**< Pointer to the jump action resource. */
328         struct mlx5_flow_dv_port_id_action_resource *port_id_action;
329         /**< Pointer to port ID action resource. */
330 #ifdef HAVE_IBV_FLOW_DV_SUPPORT
331         void *actions[MLX5_DV_MAX_NUMBER_OF_ACTIONS];
332         /**< Action list. */
333 #endif
334         int actions_n; /**< number of actions. */
335 };
336
337 /* Verbs specification header. */
338 struct ibv_spec_header {
339         enum ibv_flow_spec_type type;
340         uint16_t size;
341 };
342
343 /** Handles information leading to a drop fate. */
344 struct mlx5_flow_verbs {
345         LIST_ENTRY(mlx5_flow_verbs) next;
346         unsigned int size; /**< Size of the attribute. */
347         struct {
348                 struct ibv_flow_attr *attr;
349                 /**< Pointer to the Specification buffer. */
350                 uint8_t *specs; /**< Pointer to the specifications. */
351         };
352         struct ibv_flow *flow; /**< Verbs flow pointer. */
353         struct mlx5_hrxq *hrxq; /**< Hash Rx queue object. */
354         uint64_t hash_fields; /**< Verbs hash Rx queue hash fields. */
355 };
356
357 /** Device flow structure. */
358 struct mlx5_flow {
359         LIST_ENTRY(mlx5_flow) next;
360         struct rte_flow *flow; /**< Pointer to the main flow. */
361         uint64_t layers;
362         /**< Bit-fields of present layers, see MLX5_FLOW_LAYER_*. */
363         union {
364 #ifdef HAVE_IBV_FLOW_DV_SUPPORT
365                 struct mlx5_flow_dv dv;
366 #endif
367                 struct mlx5_flow_verbs verbs;
368         };
369 };
370
371 /* Flow structure. */
372 struct rte_flow {
373         TAILQ_ENTRY(rte_flow) next; /**< Pointer to the next flow structure. */
374         enum mlx5_flow_drv_type drv_type; /**< Driver type. */
375         struct mlx5_flow_counter *counter; /**< Holds flow counter. */
376         struct mlx5_flow_dv_tag_resource *tag_resource;
377         /**< pointer to the tag action. */
378         struct rte_flow_action_rss rss;/**< RSS context. */
379         uint8_t key[MLX5_RSS_HASH_KEY_LEN]; /**< RSS hash key. */
380         uint16_t (*queue)[]; /**< Destination queues to redirect traffic to. */
381         LIST_HEAD(dev_flows, mlx5_flow) dev_flows;
382         /**< Device flows that are part of the flow. */
383         uint64_t actions;
384         /**< Bit-fields of detected actions, see MLX5_FLOW_ACTION_*. */
385         struct mlx5_fdir *fdir; /**< Pointer to associated FDIR if any. */
386         uint8_t ingress; /**< 1 if the flow is ingress. */
387         uint32_t group; /**< The group index. */
388         uint8_t transfer; /**< 1 if the flow is E-Switch flow. */
389 };
390
391 typedef int (*mlx5_flow_validate_t)(struct rte_eth_dev *dev,
392                                     const struct rte_flow_attr *attr,
393                                     const struct rte_flow_item items[],
394                                     const struct rte_flow_action actions[],
395                                     struct rte_flow_error *error);
396 typedef struct mlx5_flow *(*mlx5_flow_prepare_t)
397         (const struct rte_flow_attr *attr, const struct rte_flow_item items[],
398          const struct rte_flow_action actions[], struct rte_flow_error *error);
399 typedef int (*mlx5_flow_translate_t)(struct rte_eth_dev *dev,
400                                      struct mlx5_flow *dev_flow,
401                                      const struct rte_flow_attr *attr,
402                                      const struct rte_flow_item items[],
403                                      const struct rte_flow_action actions[],
404                                      struct rte_flow_error *error);
405 typedef int (*mlx5_flow_apply_t)(struct rte_eth_dev *dev, struct rte_flow *flow,
406                                  struct rte_flow_error *error);
407 typedef void (*mlx5_flow_remove_t)(struct rte_eth_dev *dev,
408                                    struct rte_flow *flow);
409 typedef void (*mlx5_flow_destroy_t)(struct rte_eth_dev *dev,
410                                     struct rte_flow *flow);
411 typedef int (*mlx5_flow_query_t)(struct rte_eth_dev *dev,
412                                  struct rte_flow *flow,
413                                  const struct rte_flow_action *actions,
414                                  void *data,
415                                  struct rte_flow_error *error);
416 struct mlx5_flow_driver_ops {
417         mlx5_flow_validate_t validate;
418         mlx5_flow_prepare_t prepare;
419         mlx5_flow_translate_t translate;
420         mlx5_flow_apply_t apply;
421         mlx5_flow_remove_t remove;
422         mlx5_flow_destroy_t destroy;
423         mlx5_flow_query_t query;
424 };
425
426 #define MLX5_CNT_CONTAINER(sh, batch, thread) (&(sh)->cmng.ccont \
427         [(((sh)->cmng.mhi[batch] >> (thread)) & 0x1) * 2 + (batch)])
428 #define MLX5_CNT_CONTAINER_UNUSED(sh, batch, thread) (&(sh)->cmng.ccont \
429         [(~((sh)->cmng.mhi[batch] >> (thread)) & 0x1) * 2 + (batch)])
430
431 /* mlx5_flow.c */
432
433 uint64_t mlx5_flow_hashfields_adjust(struct mlx5_flow *dev_flow, int tunnel,
434                                      uint64_t layer_types,
435                                      uint64_t hash_fields);
436 uint32_t mlx5_flow_adjust_priority(struct rte_eth_dev *dev, int32_t priority,
437                                    uint32_t subpriority);
438 int mlx5_flow_validate_action_count(struct rte_eth_dev *dev,
439                                     const struct rte_flow_attr *attr,
440                                     struct rte_flow_error *error);
441 int mlx5_flow_validate_action_drop(uint64_t action_flags,
442                                    const struct rte_flow_attr *attr,
443                                    struct rte_flow_error *error);
444 int mlx5_flow_validate_action_flag(uint64_t action_flags,
445                                    const struct rte_flow_attr *attr,
446                                    struct rte_flow_error *error);
447 int mlx5_flow_validate_action_mark(const struct rte_flow_action *action,
448                                    uint64_t action_flags,
449                                    const struct rte_flow_attr *attr,
450                                    struct rte_flow_error *error);
451 int mlx5_flow_validate_action_queue(const struct rte_flow_action *action,
452                                     uint64_t action_flags,
453                                     struct rte_eth_dev *dev,
454                                     const struct rte_flow_attr *attr,
455                                     struct rte_flow_error *error);
456 int mlx5_flow_validate_action_rss(const struct rte_flow_action *action,
457                                   uint64_t action_flags,
458                                   struct rte_eth_dev *dev,
459                                   const struct rte_flow_attr *attr,
460                                   uint64_t item_flags,
461                                   struct rte_flow_error *error);
462 int mlx5_flow_validate_attributes(struct rte_eth_dev *dev,
463                                   const struct rte_flow_attr *attributes,
464                                   struct rte_flow_error *error);
465 int mlx5_flow_item_acceptable(const struct rte_flow_item *item,
466                               const uint8_t *mask,
467                               const uint8_t *nic_mask,
468                               unsigned int size,
469                               struct rte_flow_error *error);
470 int mlx5_flow_validate_item_eth(const struct rte_flow_item *item,
471                                 uint64_t item_flags,
472                                 struct rte_flow_error *error);
473 int mlx5_flow_validate_item_gre(const struct rte_flow_item *item,
474                                 uint64_t item_flags,
475                                 uint8_t target_protocol,
476                                 struct rte_flow_error *error);
477 int mlx5_flow_validate_item_gre_key(const struct rte_flow_item *item,
478                                     uint64_t item_flags,
479                                     const struct rte_flow_item *gre_item,
480                                     struct rte_flow_error *error);
481 int mlx5_flow_validate_item_ipv4(const struct rte_flow_item *item,
482                                  uint64_t item_flags,
483                                  const struct rte_flow_item_ipv4 *acc_mask,
484                                  struct rte_flow_error *error);
485 int mlx5_flow_validate_item_ipv6(const struct rte_flow_item *item,
486                                  uint64_t item_flags,
487                                  const struct rte_flow_item_ipv6 *acc_mask,
488                                  struct rte_flow_error *error);
489 int mlx5_flow_validate_item_mpls(struct rte_eth_dev *dev,
490                                  const struct rte_flow_item *item,
491                                  uint64_t item_flags,
492                                  uint64_t prev_layer,
493                                  struct rte_flow_error *error);
494 int mlx5_flow_validate_item_tcp(const struct rte_flow_item *item,
495                                 uint64_t item_flags,
496                                 uint8_t target_protocol,
497                                 const struct rte_flow_item_tcp *flow_mask,
498                                 struct rte_flow_error *error);
499 int mlx5_flow_validate_item_udp(const struct rte_flow_item *item,
500                                 uint64_t item_flags,
501                                 uint8_t target_protocol,
502                                 struct rte_flow_error *error);
503 int mlx5_flow_validate_item_vlan(const struct rte_flow_item *item,
504                                  uint64_t item_flags,
505                                  struct rte_flow_error *error);
506 int mlx5_flow_validate_item_vxlan(const struct rte_flow_item *item,
507                                   uint64_t item_flags,
508                                   struct rte_flow_error *error);
509 int mlx5_flow_validate_item_vxlan_gpe(const struct rte_flow_item *item,
510                                       uint64_t item_flags,
511                                       struct rte_eth_dev *dev,
512                                       struct rte_flow_error *error);
513 int mlx5_flow_validate_item_icmp(const struct rte_flow_item *item,
514                                  uint64_t item_flags,
515                                  uint8_t target_protocol,
516                                  struct rte_flow_error *error);
517 int mlx5_flow_validate_item_icmp6(const struct rte_flow_item *item,
518                                    uint64_t item_flags,
519                                    uint8_t target_protocol,
520                                    struct rte_flow_error *error);
521
522 #endif /* RTE_PMD_MLX5_FLOW_H_ */