2018-06-08 17:58:12 +00:00
|
|
|
/* SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
* Copyright(c) 2018 Chelsio Communications.
|
|
|
|
* All rights reserved.
|
|
|
|
*/
|
|
|
|
#ifndef _CXGBE_FLOW_H_
|
|
|
|
#define _CXGBE_FLOW_H_
|
|
|
|
|
|
|
|
#include <rte_flow_driver.h>
|
|
|
|
#include "cxgbe_filter.h"
|
2018-08-27 12:52:32 +00:00
|
|
|
#include "mps_tcam.h"
|
2018-06-08 17:58:14 +00:00
|
|
|
#include "cxgbe.h"
|
|
|
|
|
2018-11-09 07:56:26 +00:00
|
|
|
/* Max poll time is 100 * 100msec = 10 sec */
|
|
|
|
#define CXGBE_FLOW_POLL_MS 100 /* 100 milliseconds */
|
|
|
|
#define CXGBE_FLOW_POLL_CNT 100 /* Max number of times to poll */
|
2018-06-08 17:58:12 +00:00
|
|
|
|
|
|
|
struct chrte_fparse {
|
|
|
|
int (*fptr)(const void *mask, /* currently supported mask */
|
|
|
|
const struct rte_flow_item *item, /* user input */
|
|
|
|
struct ch_filter_specification *fs, /* where to parse */
|
|
|
|
struct rte_flow_error *e);
|
|
|
|
const void *dmask; /* Specify what is supported by chelsio by default*/
|
|
|
|
};
|
|
|
|
|
|
|
|
struct rte_flow {
|
|
|
|
struct filter_entry *f;
|
|
|
|
struct ch_filter_specification fs; /* temp, to create filter */
|
|
|
|
struct chrte_fparse *item_parser;
|
|
|
|
/*
|
|
|
|
* filter_entry doesn't store user priority.
|
|
|
|
* Post creation of filter this will indicate the
|
|
|
|
* flow index (fidx) for both hash and tcam filters
|
|
|
|
*/
|
|
|
|
unsigned int fidx;
|
|
|
|
struct rte_eth_dev *dev;
|
|
|
|
};
|
|
|
|
|
|
|
|
int
|
|
|
|
cxgbe_dev_filter_ctrl(struct rte_eth_dev *dev,
|
|
|
|
enum rte_filter_type filter_type,
|
|
|
|
enum rte_filter_op filter_op,
|
|
|
|
void *arg);
|
|
|
|
|
|
|
|
#endif /* _CXGBE_FLOW_H_ */
|