1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(C) 2019 Marvell International Ltd.
10 #include <rte_tm_driver.h>
12 #define NIX_TM_DEFAULT_TREE BIT_ULL(0)
16 void otx2_nix_tm_conf_init(struct rte_eth_dev *eth_dev);
17 int otx2_nix_tm_init_default(struct rte_eth_dev *eth_dev);
18 int otx2_nix_tm_fini(struct rte_eth_dev *eth_dev);
20 struct otx2_nix_tm_node {
21 TAILQ_ENTRY(otx2_nix_tm_node) node;
31 uint32_t parent_hw_id;
33 #define NIX_TM_NODE_HWRES BIT_ULL(0)
34 #define NIX_TM_NODE_ENABLED BIT_ULL(1)
35 #define NIX_TM_NODE_USER BIT_ULL(2)
36 struct otx2_nix_tm_node *parent;
37 struct rte_tm_node_params params;
40 struct otx2_nix_tm_shaper_profile {
41 TAILQ_ENTRY(otx2_nix_tm_shaper_profile) shaper;
42 uint32_t shaper_profile_id;
43 uint32_t reference_count;
44 struct rte_tm_shaper_params profile;
47 struct shaper_params {
48 uint64_t burst_exponent;
49 uint64_t burst_mantissa;
57 TAILQ_HEAD(otx2_nix_tm_node_list, otx2_nix_tm_node);
58 TAILQ_HEAD(otx2_nix_tm_shaper_profile_list, otx2_nix_tm_shaper_profile);
60 #define MAX_SCHED_WEIGHT ((uint8_t)~0)
61 #define NIX_TM_RR_QUANTUM_MAX ((1 << 24) - 1)
63 /* DEFAULT_RR_WEIGHT * NIX_TM_RR_QUANTUM_MAX / MAX_SCHED_WEIGHT */
64 /* = NIX_MAX_HW_MTU */
65 #define DEFAULT_RR_WEIGHT 71
67 #endif /* __OTX2_TM_H__ */