New upstream version 18.11-rc1
[deb_dpdk.git] / drivers / net / cxgbe / cxgbe_flow.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2018 Chelsio Communications.
3  * All rights reserved.
4  */
5 #ifndef _CXGBE_FLOW_H_
6 #define _CXGBE_FLOW_H_
7
8 #include <rte_flow_driver.h>
9 #include "cxgbe_filter.h"
10 #include "mps_tcam.h"
11 #include "cxgbe.h"
12
13 #define CXGBE_FLOW_POLL_US  10
14 #define CXGBE_FLOW_POLL_CNT 10
15
16 struct chrte_fparse {
17         int (*fptr)(const void *mask, /* currently supported mask */
18                     const struct rte_flow_item *item, /* user input */
19                     struct ch_filter_specification *fs, /* where to parse */
20                     struct rte_flow_error *e);
21         const void *dmask; /* Specify what is supported by chelsio by default*/
22 };
23
24 struct rte_flow {
25         struct filter_entry *f;
26         struct ch_filter_specification fs; /* temp, to create filter */
27         struct chrte_fparse *item_parser;
28         /*
29          * filter_entry doesn't store user priority.
30          * Post creation of filter this will indicate the
31          * flow index (fidx) for both hash and tcam filters
32          */
33         unsigned int fidx;
34         struct rte_eth_dev *dev;
35 };
36
37 int
38 cxgbe_dev_filter_ctrl(struct rte_eth_dev *dev,
39                       enum rte_filter_type filter_type,
40                       enum rte_filter_op filter_op,
41                       void *arg);
42
43 #endif /* _CXGBE_FLOW_H_ */