xref: /dpdk/drivers/net/dpaa2/dpaa2_tm.h (revision 72100f0dee212597c9fe4fe4366ae39011ebf4a9)
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright 2020-2021 NXP
3  */
4 
5 #ifndef _DPAA2_TM_H_
6 #define _DPAA2_TM_H_
7 
8 #include <rte_tm.h>
9 
10 enum node_type {
11 	NON_LEAF_NODE = 0,
12 	LEAF_NODE
13 };
14 
15 enum level_type {
16 	LNI_LEVEL = 0,
17 	CHANNEL_LEVEL,
18 	QUEUE_LEVEL,
19 	MAX_LEVEL
20 };
21 
22 struct dpaa2_tm_shaper_profile {
23 	LIST_ENTRY(dpaa2_tm_shaper_profile) next;
24 	uint32_t id;
25 	int refcnt;
26 	struct rte_tm_shaper_params params;
27 };
28 
29 struct dpaa2_tm_node {
30 	LIST_ENTRY(dpaa2_tm_node) next;
31 	uint32_t id;
32 	uint32_t type;
33 	uint32_t level_id;
34 	uint16_t channel_id; /* Only for level 1 nodes */
35 	uint16_t tc_id; /* Only for level 1 nodes */
36 	int refcnt;
37 	struct dpaa2_tm_node *parent;
38 	struct dpaa2_tm_shaper_profile *profile;
39 	uint32_t weight;
40 	uint32_t priority;
41 	uint64_t stats_mask;
42 };
43 
44 int dpaa2_tm_init(struct rte_eth_dev *dev);
45 void dpaa2_tm_deinit(struct rte_eth_dev *dev);
46 
47 #endif /* _DPAA2_TM_H_ */
48