numam-dpdk/drivers/net/hns3/hns3_flow.h
Chengwen Feng fdfcb94d8f net/hns3: support indirect counter flow action
This patch support indirect counter action because the shared counter
attribute has been deprecated in DPDK 21.11.

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Min Hu (Connor) <humin29@huawei.com>
2022-01-27 14:39:13 +01:00

54 lines
1.2 KiB
C

/* SPDX-License-Identifier: BSD-3-Clause
* Copyright(C) 2021 HiSilicon Limited
*/
#ifndef _HNS3_FLOW_H_
#define _HNS3_FLOW_H_
#include <rte_flow.h>
struct hns3_flow_counter {
LIST_ENTRY(hns3_flow_counter) next; /* Pointer to the next counter. */
uint32_t indirect:1; /* Indirect counter flag */
uint32_t ref_cnt:31; /* Reference counter. */
uint16_t id; /* Counter ID. */
uint64_t hits; /* Number of packets matched by the rule. */
};
struct rte_flow {
enum rte_filter_type filter_type;
void *rule;
uint32_t counter_id;
};
/* rss filter list structure */
struct hns3_rss_conf_ele {
TAILQ_ENTRY(hns3_rss_conf_ele) entries;
struct hns3_rss_conf filter_info;
};
/* hns3_flow memory list structure */
struct hns3_flow_mem {
TAILQ_ENTRY(hns3_flow_mem) entries;
struct rte_flow *flow;
};
enum {
HNS3_INDIRECT_ACTION_TYPE_COUNT = 1,
};
struct rte_flow_action_handle {
int indirect_type;
uint32_t counter_id;
};
TAILQ_HEAD(hns3_rss_filter_list, hns3_rss_conf_ele);
TAILQ_HEAD(hns3_flow_mem_list, hns3_flow_mem);
int hns3_dev_flow_ops_get(struct rte_eth_dev *dev,
const struct rte_flow_ops **ops);
void hns3_flow_init(struct rte_eth_dev *dev);
void hns3_flow_uninit(struct rte_eth_dev *dev);
#endif /* _HNS3_FLOW_H_ */