1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(C) 2021 Marvell.
9 nix_tm_node_search(struct nix *nix, uint32_t node_id, enum roc_nix_tm_tree tree)
11 struct nix_tm_node_list *list;
12 struct nix_tm_node *node;
14 list = nix_tm_node_list(nix, tree);
15 TAILQ_FOREACH(node, list, node) {
16 if (node->id == node_id)
23 nix_tm_sw_xoff_prep(struct nix_tm_node *node, bool enable,
24 volatile uint64_t *reg, volatile uint64_t *regval)
26 uint32_t hw_lvl = node->hw_lvl;
27 uint32_t schq = node->hw_id;
30 plt_tm_dbg("sw xoff config node %s(%u) lvl %u id %u, enable %u (%p)",
31 nix_tm_hwlvl2str(hw_lvl), schq, node->lvl, node->id, enable,
37 case NIX_TXSCH_LVL_MDQ:
38 reg[k] = NIX_AF_MDQX_SW_XOFF(schq);
41 case NIX_TXSCH_LVL_TL4:
42 reg[k] = NIX_AF_TL4X_SW_XOFF(schq);
45 case NIX_TXSCH_LVL_TL3:
46 reg[k] = NIX_AF_TL3X_SW_XOFF(schq);
49 case NIX_TXSCH_LVL_TL2:
50 reg[k] = NIX_AF_TL2X_SW_XOFF(schq);
53 case NIX_TXSCH_LVL_TL1:
54 reg[k] = NIX_AF_TL1X_SW_XOFF(schq);