xref: /dpdk/drivers/net/cxgbe/cxgbe_flow.h (revision fb7ad441d43d4152cb7bde992a1136c20d9166e9)
1ee61f511SShagun Agrawal /* SPDX-License-Identifier: BSD-3-Clause
2ee61f511SShagun Agrawal  * Copyright(c) 2018 Chelsio Communications.
3ee61f511SShagun Agrawal  * All rights reserved.
4ee61f511SShagun Agrawal  */
5ee61f511SShagun Agrawal #ifndef _CXGBE_FLOW_H_
6ee61f511SShagun Agrawal #define _CXGBE_FLOW_H_
7ee61f511SShagun Agrawal 
8ee61f511SShagun Agrawal #include <rte_flow_driver.h>
9ee61f511SShagun Agrawal #include "cxgbe_filter.h"
10fefee7a6SShagun Agrawal #include "mps_tcam.h"
119eb2c9a4SShagun Agrawal #include "cxgbe.h"
129eb2c9a4SShagun Agrawal 
13f1e9d2afSRahul Lakkireddy /* Max poll time is 100 * 100msec = 10 sec */
14f1e9d2afSRahul Lakkireddy #define CXGBE_FLOW_POLL_MS  100 /* 100 milliseconds */
15f1e9d2afSRahul Lakkireddy #define CXGBE_FLOW_POLL_CNT 100 /* Max number of times to poll */
16ee61f511SShagun Agrawal 
17ee61f511SShagun Agrawal struct chrte_fparse {
18ee61f511SShagun Agrawal 	int (*fptr)(const void *mask, /* currently supported mask */
19ee61f511SShagun Agrawal 		    const struct rte_flow_item *item, /* user input */
20ee61f511SShagun Agrawal 		    struct ch_filter_specification *fs, /* where to parse */
21ee61f511SShagun Agrawal 		    struct rte_flow_error *e);
22ee61f511SShagun Agrawal 	const void *dmask; /* Specify what is supported by chelsio by default*/
23ee61f511SShagun Agrawal };
24ee61f511SShagun Agrawal 
25ee61f511SShagun Agrawal struct rte_flow {
26ee61f511SShagun Agrawal 	struct filter_entry *f;
27ee61f511SShagun Agrawal 	struct ch_filter_specification fs; /* temp, to create filter */
28ee61f511SShagun Agrawal 	struct chrte_fparse *item_parser;
29ee61f511SShagun Agrawal 	/*
30ee61f511SShagun Agrawal 	 * filter_entry doesn't store user priority.
31ee61f511SShagun Agrawal 	 * Post creation of filter this will indicate the
32ee61f511SShagun Agrawal 	 * flow index (fidx) for both hash and tcam filters
33ee61f511SShagun Agrawal 	 */
34ee61f511SShagun Agrawal 	unsigned int fidx;
35ee61f511SShagun Agrawal 	struct rte_eth_dev *dev;
36ee61f511SShagun Agrawal };
37ee61f511SShagun Agrawal 
38*fb7ad441SThomas Monjalon int cxgbe_dev_flow_ops_get(struct rte_eth_dev *dev,
39*fb7ad441SThomas Monjalon 			   const struct rte_flow_ops **ops);
40ee61f511SShagun Agrawal 
41ee61f511SShagun Agrawal #endif /* _CXGBE_FLOW_H_ */
42