net/hns3: mark unchecked return of snprintf
[dpdk.git] / drivers / net / hns3 / hns3_flow.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(C) 2021 HiSilicon Limited
3  */
4
5 #ifndef _HNS3_FLOW_H_
6 #define _HNS3_FLOW_H_
7
8 #include <rte_flow.h>
9
10 struct hns3_flow_counter {
11         LIST_ENTRY(hns3_flow_counter) next; /* Pointer to the next counter. */
12         uint32_t shared:1;   /* Share counter ID with other flow rules. */
13         uint32_t ref_cnt:31; /* Reference counter. */
14         uint16_t id;   /* Counter ID. */
15         uint64_t hits; /* Number of packets matched by the rule. */
16 };
17
18 struct rte_flow {
19         enum rte_filter_type filter_type;
20         void *rule;
21         uint32_t counter_id;
22 };
23
24 /* rss filter list structure */
25 struct hns3_rss_conf_ele {
26         TAILQ_ENTRY(hns3_rss_conf_ele) entries;
27         struct hns3_rss_conf filter_info;
28 };
29
30 /* hns3_flow memory list structure */
31 struct hns3_flow_mem {
32         TAILQ_ENTRY(hns3_flow_mem) entries;
33         struct rte_flow *flow;
34 };
35
36 TAILQ_HEAD(hns3_rss_filter_list, hns3_rss_conf_ele);
37 TAILQ_HEAD(hns3_flow_mem_list, hns3_flow_mem);
38
39 int hns3_dev_flow_ops_get(struct rte_eth_dev *dev,
40                           const struct rte_flow_ops **ops);
41 void hns3_flow_init(struct rte_eth_dev *dev);
42 void hns3_flow_uninit(struct rte_eth_dev *dev);
43
44 #endif /* _HNS3_FLOW_H_ */