1 /* SPDX-License-Identifier: BSD-3-Clause 2 * Copyright(C) 2021 Marvell. 3 */ 4 #ifndef __CNXK_RTE_FLOW_H__ 5 #define __CNXK_RTE_FLOW_H__ 6 7 #include <rte_flow_driver.h> 8 #include <rte_malloc.h> 9 10 #include "cnxk_ethdev.h" 11 #include "roc_api.h" 12 #include "roc_npc_priv.h" 13 14 struct cnxk_rte_flow_term_info { 15 uint16_t item_type; 16 uint16_t item_size; 17 }; 18 19 struct cnxk_rte_flow_action_info { 20 uint16_t conf_size; 21 }; 22 23 extern const struct cnxk_rte_flow_term_info term[]; 24 25 struct roc_npc_flow *cnxk_flow_create(struct rte_eth_dev *dev, const struct rte_flow_attr *attr, 26 const struct rte_flow_item pattern[], 27 const struct rte_flow_action actions[], 28 struct rte_flow_error *error); 29 int cnxk_flow_destroy(struct rte_eth_dev *dev, struct roc_npc_flow *flow, 30 struct rte_flow_error *error); 31 32 struct roc_npc_flow *cnxk_flow_create_common(struct rte_eth_dev *eth_dev, 33 const struct rte_flow_attr *attr, 34 const struct rte_flow_item pattern[], 35 const struct rte_flow_action actions[], 36 struct rte_flow_error *error, bool is_rep); 37 int cnxk_flow_validate_common(struct rte_eth_dev *eth_dev, const struct rte_flow_attr *attr, 38 const struct rte_flow_item pattern[], 39 const struct rte_flow_action actions[], struct rte_flow_error *error, 40 bool is_rep); 41 int cnxk_flow_destroy_common(struct rte_eth_dev *eth_dev, struct roc_npc_flow *flow, 42 struct rte_flow_error *error, bool is_rep); 43 int cnxk_flow_flush_common(struct rte_eth_dev *eth_dev, struct rte_flow_error *error, bool is_rep); 44 int cnxk_flow_query_common(struct rte_eth_dev *eth_dev, struct rte_flow *flow, 45 const struct rte_flow_action *action, void *data, 46 struct rte_flow_error *error, bool is_rep); 47 int cnxk_flow_dev_dump_common(struct rte_eth_dev *eth_dev, struct rte_flow *flow, FILE *file, 48 struct rte_flow_error *error, bool is_rep); 49 50 #endif /* __CNXK_RTE_FLOW_H__ */ 51