Lines Matching full:node
44 static void otx2_qos_get_regaddr(struct otx2_qos_node *node, in otx2_qos_get_regaddr() argument
48 if (node->level == NIX_TXSCH_LVL_SMQ) { in otx2_qos_get_regaddr()
49 cfg->reg[index++] = NIX_AF_MDQX_PARENT(node->schq); in otx2_qos_get_regaddr()
50 cfg->reg[index++] = NIX_AF_MDQX_SCHEDULE(node->schq); in otx2_qos_get_regaddr()
51 cfg->reg[index++] = NIX_AF_MDQX_PIR(node->schq); in otx2_qos_get_regaddr()
52 cfg->reg[index] = NIX_AF_MDQX_CIR(node->schq); in otx2_qos_get_regaddr()
53 } else if (node->level == NIX_TXSCH_LVL_TL4) { in otx2_qos_get_regaddr()
54 cfg->reg[index++] = NIX_AF_TL4X_PARENT(node->schq); in otx2_qos_get_regaddr()
55 cfg->reg[index++] = NIX_AF_TL4X_SCHEDULE(node->schq); in otx2_qos_get_regaddr()
56 cfg->reg[index++] = NIX_AF_TL4X_PIR(node->schq); in otx2_qos_get_regaddr()
57 cfg->reg[index] = NIX_AF_TL4X_CIR(node->schq); in otx2_qos_get_regaddr()
58 } else if (node->level == NIX_TXSCH_LVL_TL3) { in otx2_qos_get_regaddr()
59 cfg->reg[index++] = NIX_AF_TL3X_PARENT(node->schq); in otx2_qos_get_regaddr()
60 cfg->reg[index++] = NIX_AF_TL3X_SCHEDULE(node->schq); in otx2_qos_get_regaddr()
61 cfg->reg[index++] = NIX_AF_TL3X_PIR(node->schq); in otx2_qos_get_regaddr()
62 cfg->reg[index] = NIX_AF_TL3X_CIR(node->schq); in otx2_qos_get_regaddr()
63 } else if (node->level == NIX_TXSCH_LVL_TL2) { in otx2_qos_get_regaddr()
64 cfg->reg[index++] = NIX_AF_TL2X_PARENT(node->schq); in otx2_qos_get_regaddr()
65 cfg->reg[index++] = NIX_AF_TL2X_SCHEDULE(node->schq); in otx2_qos_get_regaddr()
66 cfg->reg[index++] = NIX_AF_TL2X_PIR(node->schq); in otx2_qos_get_regaddr()
67 cfg->reg[index] = NIX_AF_TL2X_CIR(node->schq); in otx2_qos_get_regaddr()
83 struct otx2_qos_node *node, in otx2_config_sched_shaping() argument
91 otx2_qos_get_regaddr(node, cfg, *num_regs); in otx2_config_sched_shaping()
94 cfg->regval[*num_regs] = node->parent->schq << 16; in otx2_config_sched_shaping()
98 if (node->qid == OTX2_QOS_QID_NONE) { in otx2_config_sched_shaping()
99 cfg->regval[*num_regs] = node->prio << 24 | in otx2_config_sched_shaping()
106 if (node->is_static) { in otx2_config_sched_shaping()
108 (node->schq - node->parent->prio_anchor) << 24; in otx2_config_sched_shaping()
110 quantum = node->quantum ? in otx2_config_sched_shaping()
111 node->quantum : pfvf->tx_max_pktlen; in otx2_config_sched_shaping()
113 cfg->regval[*num_regs] = node->parent->child_dwrr_prio << 24 | in otx2_config_sched_shaping()
119 maxrate = (node->rate > node->ceil) ? node->rate : node->ceil; in otx2_config_sched_shaping()
132 otx2_get_txschq_rate_regval(pfvf, node->rate, 65536); in otx2_config_sched_shaping()
137 struct otx2_qos_node *node, in __otx2_qos_txschq_cfg() argument
144 level = node->level; in __otx2_qos_txschq_cfg()
148 cfg->reg[num_regs] = NIX_AF_SMQX_CFG(node->schq); in __otx2_qos_txschq_cfg()
155 otx2_config_sched_shaping(pfvf, node, cfg, &num_regs); in __otx2_qos_txschq_cfg()
157 otx2_config_sched_shaping(pfvf, node, cfg, &num_regs); in __otx2_qos_txschq_cfg()
161 cfg->reg[num_regs] = NIX_AF_TL3_TL2X_LINKX_CFG(node->schq, hw->tx_link); in __otx2_qos_txschq_cfg()
166 otx2_config_sched_shaping(pfvf, node, cfg, &num_regs); in __otx2_qos_txschq_cfg()
169 cfg->reg[num_regs] = NIX_AF_TL2X_PARENT(node->schq); in __otx2_qos_txschq_cfg()
175 cfg->reg[num_regs] = NIX_AF_TL3_TL2X_LINKX_CFG(node->schq, hw->tx_link); in __otx2_qos_txschq_cfg()
180 /* check if node is root */ in __otx2_qos_txschq_cfg()
181 if (node->qid == OTX2_QOS_QID_INNER && !node->parent) { in __otx2_qos_txschq_cfg()
182 cfg->reg[num_regs] = NIX_AF_TL2X_SCHEDULE(node->schq); in __otx2_qos_txschq_cfg()
190 otx2_config_sched_shaping(pfvf, node, cfg, &num_regs); in __otx2_qos_txschq_cfg()
241 struct otx2_qos_node *node; in otx2_qos_free_hw_node_schq() local
243 list_for_each_entry_reverse(node, &parent->child_schq_list, list) in otx2_qos_free_hw_node_schq()
244 otx2_txschq_free_one(pfvf, node->level, node->schq); in otx2_qos_free_hw_node_schq()
250 struct otx2_qos_node *node, *tmp; in otx2_qos_free_hw_node() local
252 list_for_each_entry_safe(node, tmp, &parent->child_list, list) { in otx2_qos_free_hw_node()
253 otx2_qos_free_hw_node(pfvf, node); in otx2_qos_free_hw_node()
254 otx2_qos_free_hw_node_schq(pfvf, node); in otx2_qos_free_hw_node()
255 otx2_txschq_free_one(pfvf, node->level, node->schq); in otx2_qos_free_hw_node()
260 struct otx2_qos_node *node) in otx2_qos_free_hw_cfg() argument
264 /* free child node hw mappings */ in otx2_qos_free_hw_cfg()
265 otx2_qos_free_hw_node(pfvf, node); in otx2_qos_free_hw_cfg()
266 otx2_qos_free_hw_node_schq(pfvf, node); in otx2_qos_free_hw_cfg()
268 /* free node hw mappings */ in otx2_qos_free_hw_cfg()
269 otx2_txschq_free_one(pfvf, node->level, node->schq); in otx2_qos_free_hw_cfg()
275 struct otx2_qos_node *node) in otx2_qos_sw_node_delete() argument
277 hash_del_rcu(&node->hlist); in otx2_qos_sw_node_delete()
279 if (node->qid != OTX2_QOS_QID_INNER && node->qid != OTX2_QOS_QID_NONE) { in otx2_qos_sw_node_delete()
280 __clear_bit(node->qid, pfvf->qos.qos_sq_bmap); in otx2_qos_sw_node_delete()
284 list_del(&node->list); in otx2_qos_sw_node_delete()
285 kfree(node); in otx2_qos_sw_node_delete()
291 struct otx2_qos_node *node, *tmp; in otx2_qos_free_sw_node_schq() local
293 list_for_each_entry_safe(node, tmp, &parent->child_schq_list, list) { in otx2_qos_free_sw_node_schq()
294 list_del(&node->list); in otx2_qos_free_sw_node_schq()
295 kfree(node); in otx2_qos_free_sw_node_schq()
302 struct otx2_qos_node *node, *tmp; in __otx2_qos_free_sw_node() local
304 list_for_each_entry_safe(node, tmp, &parent->child_list, list) { in __otx2_qos_free_sw_node()
305 __otx2_qos_free_sw_node(pfvf, node); in __otx2_qos_free_sw_node()
306 otx2_qos_free_sw_node_schq(pfvf, node); in __otx2_qos_free_sw_node()
307 otx2_qos_sw_node_delete(pfvf, node); in __otx2_qos_free_sw_node()
312 struct otx2_qos_node *node) in otx2_qos_free_sw_node() argument
316 __otx2_qos_free_sw_node(pfvf, node); in otx2_qos_free_sw_node()
317 otx2_qos_free_sw_node_schq(pfvf, node); in otx2_qos_free_sw_node()
318 otx2_qos_sw_node_delete(pfvf, node); in otx2_qos_free_sw_node()
324 struct otx2_qos_node *node) in otx2_qos_destroy_node() argument
326 otx2_qos_free_hw_cfg(pfvf, node); in otx2_qos_destroy_node()
327 otx2_qos_free_sw_node(pfvf, node); in otx2_qos_destroy_node()
333 struct otx2_qos_node *node; in otx2_qos_fill_cfg_schq() local
335 list_for_each_entry(node, &parent->child_schq_list, list) in otx2_qos_fill_cfg_schq()
336 cfg->schq[node->level]++; in otx2_qos_fill_cfg_schq()
342 struct otx2_qos_node *node; in otx2_qos_fill_cfg_tl() local
344 list_for_each_entry(node, &parent->child_list, list) { in otx2_qos_fill_cfg_tl()
345 otx2_qos_fill_cfg_tl(node, cfg); in otx2_qos_fill_cfg_tl()
346 otx2_qos_fill_cfg_schq(node, cfg); in otx2_qos_fill_cfg_tl()
368 struct otx2_qos_node *node; in otx2_qos_read_txschq_cfg_schq() local
371 list_for_each_entry(node, &parent->child_schq_list, list) { in otx2_qos_read_txschq_cfg_schq()
372 cnt = cfg->dwrr_node_pos[node->level]; in otx2_qos_read_txschq_cfg_schq()
373 cfg->schq_list[node->level][cnt] = node->schq; in otx2_qos_read_txschq_cfg_schq()
374 cfg->schq[node->level]++; in otx2_qos_read_txschq_cfg_schq()
375 cfg->dwrr_node_pos[node->level]++; in otx2_qos_read_txschq_cfg_schq()
382 struct otx2_qos_node *node; in otx2_qos_read_txschq_cfg_tl() local
385 list_for_each_entry(node, &parent->child_list, list) { in otx2_qos_read_txschq_cfg_tl()
386 otx2_qos_read_txschq_cfg_tl(node, cfg); in otx2_qos_read_txschq_cfg_tl()
387 cnt = cfg->static_node_pos[node->level]; in otx2_qos_read_txschq_cfg_tl()
388 cfg->schq_contig_list[node->level][cnt] = node->schq; in otx2_qos_read_txschq_cfg_tl()
389 cfg->schq_index_used[node->level][cnt] = true; in otx2_qos_read_txschq_cfg_tl()
390 cfg->schq_contig[node->level]++; in otx2_qos_read_txschq_cfg_tl()
391 cfg->static_node_pos[node->level]++; in otx2_qos_read_txschq_cfg_tl()
392 otx2_qos_read_txschq_cfg_schq(node, cfg); in otx2_qos_read_txschq_cfg_tl()
397 struct otx2_qos_node *node, in otx2_qos_read_txschq_cfg() argument
401 otx2_qos_read_txschq_cfg_tl(node, cfg); in otx2_qos_read_txschq_cfg()
408 struct otx2_qos_node *node; in otx2_qos_alloc_root() local
410 node = kzalloc(sizeof(*node), GFP_KERNEL); in otx2_qos_alloc_root()
411 if (!node) in otx2_qos_alloc_root()
414 node->parent = NULL; in otx2_qos_alloc_root()
416 node->level = NIX_TXSCH_LVL_TL1; in otx2_qos_alloc_root()
418 node->level = NIX_TXSCH_LVL_TL2; in otx2_qos_alloc_root()
419 node->child_dwrr_prio = OTX2_QOS_DEFAULT_PRIO; in otx2_qos_alloc_root()
422 WRITE_ONCE(node->qid, OTX2_QOS_QID_INNER); in otx2_qos_alloc_root()
423 node->classid = OTX2_QOS_ROOT_CLASSID; in otx2_qos_alloc_root()
425 hash_add_rcu(pfvf->qos.qos_hlist, &node->hlist, node->classid); in otx2_qos_alloc_root()
426 list_add_tail(&node->list, &pfvf->qos.qos_tree); in otx2_qos_alloc_root()
427 INIT_LIST_HEAD(&node->child_list); in otx2_qos_alloc_root()
428 INIT_LIST_HEAD(&node->child_schq_list); in otx2_qos_alloc_root()
430 return node; in otx2_qos_alloc_root()
434 struct otx2_qos_node *node) in otx2_qos_add_child_node() argument
440 if (node->prio > parent->max_static_prio) in otx2_qos_add_child_node()
441 parent->max_static_prio = node->prio; in otx2_qos_add_child_node()
445 if (tmp_node->prio == node->prio && in otx2_qos_add_child_node()
448 if (tmp_node->prio > node->prio) { in otx2_qos_add_child_node()
449 list_add_tail(&node->list, tmp); in otx2_qos_add_child_node()
454 list_add_tail(&node->list, head); in otx2_qos_add_child_node()
459 struct otx2_qos_node *node) in otx2_qos_alloc_txschq_node() argument
464 parent = node; in otx2_qos_alloc_txschq_node()
465 for (lvl = node->level - 1; lvl >= NIX_TXSCH_LVL_MDQ; lvl--) { in otx2_qos_alloc_txschq_node()
483 list_add_tail(&txschq_node->list, &node->child_schq_list); in otx2_qos_alloc_txschq_node()
494 list_for_each_entry_safe(txschq_node, tmp, &node->child_schq_list, in otx2_qos_alloc_txschq_node()
508 struct otx2_qos_node *node; in otx2_qos_sw_create_leaf_node() local
511 node = kzalloc(sizeof(*node), GFP_KERNEL); in otx2_qos_sw_create_leaf_node()
512 if (!node) in otx2_qos_sw_create_leaf_node()
515 node->parent = parent; in otx2_qos_sw_create_leaf_node()
516 node->level = parent->level - 1; in otx2_qos_sw_create_leaf_node()
517 node->classid = classid; in otx2_qos_sw_create_leaf_node()
518 WRITE_ONCE(node->qid, qid); in otx2_qos_sw_create_leaf_node()
520 node->rate = otx2_convert_rate(rate); in otx2_qos_sw_create_leaf_node()
521 node->ceil = otx2_convert_rate(ceil); in otx2_qos_sw_create_leaf_node()
522 node->prio = prio; in otx2_qos_sw_create_leaf_node()
523 node->quantum = quantum; in otx2_qos_sw_create_leaf_node()
524 node->is_static = static_cfg; in otx2_qos_sw_create_leaf_node()
525 node->child_dwrr_prio = OTX2_QOS_DEFAULT_PRIO; in otx2_qos_sw_create_leaf_node()
526 node->txschq_idx = OTX2_QOS_INVALID_TXSCHQ_IDX; in otx2_qos_sw_create_leaf_node()
530 hash_add_rcu(pfvf->qos.qos_hlist, &node->hlist, classid); in otx2_qos_sw_create_leaf_node()
533 err = otx2_qos_add_child_node(parent, node); in otx2_qos_sw_create_leaf_node()
540 INIT_LIST_HEAD(&node->child_list); in otx2_qos_sw_create_leaf_node()
541 INIT_LIST_HEAD(&node->child_schq_list); in otx2_qos_sw_create_leaf_node()
543 err = otx2_qos_alloc_txschq_node(pfvf, node); in otx2_qos_sw_create_leaf_node()
545 otx2_qos_sw_node_delete(pfvf, node); in otx2_qos_sw_create_leaf_node()
549 return node; in otx2_qos_sw_create_leaf_node()
555 struct otx2_qos_node *node = NULL; in otx2_sw_node_find_by_qid() local
558 hash_for_each(pfvf->qos.qos_hlist, bkt, node, hlist) { in otx2_sw_node_find_by_qid()
559 if (node->qid == qid) in otx2_sw_node_find_by_qid()
563 return node; in otx2_sw_node_find_by_qid()
569 struct otx2_qos_node *node = NULL; in otx2_sw_node_find() local
571 hash_for_each_possible(pfvf->qos.qos_hlist, node, hlist, classid) { in otx2_sw_node_find()
572 if (node->classid == classid) in otx2_sw_node_find()
576 return node; in otx2_sw_node_find()
582 struct otx2_qos_node *node = NULL; in otx2_sw_node_find_rcu() local
584 hash_for_each_possible_rcu(pfvf->qos.qos_hlist, node, hlist, classid) { in otx2_sw_node_find_rcu()
585 if (node->classid == classid) in otx2_sw_node_find_rcu()
589 return node; in otx2_sw_node_find_rcu()
594 struct otx2_qos_node *node; in otx2_get_txq_by_classid() local
598 node = otx2_sw_node_find_rcu(pfvf, classid); in otx2_get_txq_by_classid()
599 if (!node) { in otx2_get_txq_by_classid()
603 qid = READ_ONCE(node->qid); in otx2_get_txq_by_classid()
614 otx2_qos_txschq_config(struct otx2_nic *pfvf, struct otx2_qos_node *node) in otx2_qos_txschq_config() argument
628 req->lvl = node->level; in otx2_qos_txschq_config()
629 __otx2_qos_txschq_cfg(pfvf, node, req); in otx2_qos_txschq_config()
710 struct otx2_qos_node *node, in otx2_qos_txschq_fill_cfg_schq() argument
716 list_for_each_entry(tmp, &node->child_schq_list, list) { in otx2_qos_txschq_fill_cfg_schq()
724 struct otx2_qos_node *node, in otx2_qos_txschq_fill_cfg_tl() argument
730 list_for_each_entry(tmp, &node->child_list, list) { in otx2_qos_txschq_fill_cfg_tl()
736 node->prio_anchor = in otx2_qos_txschq_fill_cfg_tl()
744 struct otx2_qos_node *node, in otx2_qos_txschq_fill_cfg() argument
748 otx2_qos_txschq_fill_cfg_tl(pfvf, node, cfg); in otx2_qos_txschq_fill_cfg()
749 otx2_qos_txschq_fill_cfg_schq(pfvf, node, cfg); in otx2_qos_txschq_fill_cfg()
781 struct otx2_qos_node *node) in otx2_qos_assign_base_idx_tl() argument
787 list_for_each_entry(tmp, &node->child_list, list) in otx2_qos_assign_base_idx_tl()
791 child_cnt = node->child_dwrr_cnt + node->max_static_prio + 1; in otx2_qos_assign_base_idx_tl()
798 list_for_each_entry(tmp, &node->child_list, list) in otx2_qos_assign_base_idx_tl()
802 list_for_each_entry(tmp, &node->child_list, list) { in otx2_qos_assign_base_idx_tl()
810 list_for_each_entry(tmp, &node->child_list, list) in otx2_qos_assign_base_idx_tl()
820 struct otx2_qos_node *node) in otx2_qos_assign_base_idx() argument
825 ret = otx2_qos_assign_base_idx_tl(pfvf, node); in otx2_qos_assign_base_idx()
832 struct otx2_qos_node *node, in otx2_qos_txschq_push_cfg_schq() argument
838 list_for_each_entry(tmp, &node->child_schq_list, list) { in otx2_qos_txschq_push_cfg_schq()
851 struct otx2_qos_node *node, in otx2_qos_txschq_push_cfg_tl() argument
857 list_for_each_entry(tmp, &node->child_list, list) { in otx2_qos_txschq_push_cfg_tl()
869 ret = otx2_qos_txschq_set_parent_topology(pfvf, node); in otx2_qos_txschq_push_cfg_tl()
877 struct otx2_qos_node *node, in otx2_qos_txschq_push_cfg() argument
883 ret = otx2_qos_txschq_push_cfg_tl(pfvf, node, cfg); in otx2_qos_txschq_push_cfg()
886 ret = otx2_qos_txschq_push_cfg_schq(pfvf, node, cfg); in otx2_qos_txschq_push_cfg()
893 struct otx2_qos_node *node, in otx2_qos_txschq_update_config() argument
896 otx2_qos_txschq_fill_cfg(pfvf, node, cfg); in otx2_qos_txschq_update_config()
898 return otx2_qos_txschq_push_cfg(pfvf, node, cfg); in otx2_qos_txschq_update_config()
931 struct otx2_qos_node *node, in otx2_qos_enadis_sq() argument
937 pfvf->qos.qid_to_sqmap[qid] = node->schq; in otx2_qos_enadis_sq()
938 otx2_qos_txschq_config(pfvf, node); in otx2_qos_enadis_sq()
943 struct otx2_qos_node *node, in otx2_qos_update_smq_schq() argument
948 if (node->qid == OTX2_QOS_QID_INNER) in otx2_qos_update_smq_schq()
951 list_for_each_entry(tmp, &node->child_schq_list, list) { in otx2_qos_update_smq_schq()
956 otx2_qos_enadis_sq(pfvf, tmp, node->qid); in otx2_qos_update_smq_schq()
962 struct otx2_qos_node *node, in __otx2_qos_update_smq() argument
967 list_for_each_entry(tmp, &node->child_list, list) { in __otx2_qos_update_smq()
983 struct otx2_qos_node *node, in otx2_qos_update_smq() argument
987 __otx2_qos_update_smq(pfvf, node, action); in otx2_qos_update_smq()
988 otx2_qos_update_smq_schq(pfvf, node, action); in otx2_qos_update_smq()
993 struct otx2_qos_node *node, in otx2_qos_push_txschq_cfg() argument
1002 ret = otx2_qos_assign_base_idx(pfvf, node); in otx2_qos_push_txschq_cfg()
1007 otx2_qos_txschq_fill_cfg(pfvf, node, cfg); in otx2_qos_push_txschq_cfg()
1011 ret = otx2_qos_txschq_update_config(pfvf, node, cfg); in otx2_qos_push_txschq_cfg()
1017 otx2_qos_update_smq(pfvf, node, QOS_CFG_SQ); in otx2_qos_push_txschq_cfg()
1023 struct otx2_qos_node *node, in otx2_qos_update_tree() argument
1026 otx2_qos_prepare_txschq_cfg(pfvf, node->parent, cfg); in otx2_qos_update_tree()
1027 return otx2_qos_push_txschq_cfg(pfvf, node->parent, cfg); in otx2_qos_update_tree()
1054 /* allocate htb root node */ in otx2_qos_root_add()
1104 /* find root node */ in otx2_qos_root_destroy()
1175 /* For PF, root node dwrr priority is static */ in otx2_reset_dwrr_prio()
1189 struct otx2_qos_node *node; in is_qos_node_dwrr() local
1196 list_for_each_entry(node, &parent->child_list, list) { in is_qos_node_dwrr()
1197 if (prio == node->prio) { in is_qos_node_dwrr()
1202 if (otx2_qos_validate_quantum(pfvf, node->quantum)) { in is_qos_node_dwrr()
1205 node->classid, node->quantum, in is_qos_node_dwrr()
1206 node->prio); in is_qos_node_dwrr()
1209 /* mark old node as dwrr */ in is_qos_node_dwrr()
1210 node->is_static = false; in is_qos_node_dwrr()
1228 struct otx2_qos_node *node, *parent; in otx2_qos_leaf_alloc_queue() local
1248 /* get parent node */ in otx2_qos_leaf_alloc_queue()
1251 NL_SET_ERR_MSG_MOD(extack, "parent node not found"); in otx2_qos_leaf_alloc_queue()
1301 /* allocate and initialize a new child node */ in otx2_qos_leaf_alloc_queue()
1302 node = otx2_qos_sw_create_leaf_node(pfvf, parent, classid, prio, rate, in otx2_qos_leaf_alloc_queue()
1304 if (IS_ERR(node)) { in otx2_qos_leaf_alloc_queue()
1305 NL_SET_ERR_MSG_MOD(extack, "Unable to allocate leaf node"); in otx2_qos_leaf_alloc_queue()
1306 ret = PTR_ERR(node); in otx2_qos_leaf_alloc_queue()
1317 ret = otx2_qos_update_tree(pfvf, node, new_cfg); in otx2_qos_leaf_alloc_queue()
1321 otx2_qos_sw_node_delete(pfvf, node); in otx2_qos_leaf_alloc_queue()
1347 otx2_qos_sw_node_delete(pfvf, node); in otx2_qos_leaf_alloc_queue()
1366 struct otx2_qos_node *node, *child; in otx2_qos_leaf_to_inner() local
1387 /* find node related to classid */ in otx2_qos_leaf_to_inner()
1388 node = otx2_sw_node_find(pfvf, classid); in otx2_qos_leaf_to_inner()
1389 if (!node) { in otx2_qos_leaf_to_inner()
1390 NL_SET_ERR_MSG_MOD(extack, "HTB node not found"); in otx2_qos_leaf_to_inner()
1395 if (node->level == NIX_TXSCH_LVL_MDQ) { in otx2_qos_leaf_to_inner()
1401 static_cfg = !is_qos_node_dwrr(node, pfvf, prio); in otx2_qos_leaf_to_inner()
1403 ret = otx2_qos_validate_dwrr_cfg(node, extack, pfvf, prio, in otx2_qos_leaf_to_inner()
1410 node->child_static_cnt++; in otx2_qos_leaf_to_inner()
1412 node->child_dwrr_cnt++; in otx2_qos_leaf_to_inner()
1414 set_bit(prio, node->prio_bmap); in otx2_qos_leaf_to_inner()
1416 /* store the qid to assign to leaf node */ in otx2_qos_leaf_to_inner()
1417 qid = node->qid; in otx2_qos_leaf_to_inner()
1426 otx2_qos_read_txschq_cfg(pfvf, node, old_cfg); in otx2_qos_leaf_to_inner()
1428 /* delete the txschq nodes allocated for this node */ in otx2_qos_leaf_to_inner()
1430 otx2_qos_free_hw_node_schq(pfvf, node); in otx2_qos_leaf_to_inner()
1431 otx2_qos_free_sw_node_schq(pfvf, node); in otx2_qos_leaf_to_inner()
1434 /* mark this node as htb inner node */ in otx2_qos_leaf_to_inner()
1435 WRITE_ONCE(node->qid, OTX2_QOS_QID_INNER); in otx2_qos_leaf_to_inner()
1437 /* allocate and initialize a new child node */ in otx2_qos_leaf_to_inner()
1438 child = otx2_qos_sw_create_leaf_node(pfvf, node, child_classid, in otx2_qos_leaf_to_inner()
1442 NL_SET_ERR_MSG_MOD(extack, "Unable to allocate leaf node"); in otx2_qos_leaf_to_inner()
1460 WRITE_ONCE(node->qid, qid); in otx2_qos_leaf_to_inner()
1461 err = otx2_qos_alloc_txschq_node(pfvf, node); in otx2_qos_leaf_to_inner()
1464 "Failed to restore old leaf node"); in otx2_qos_leaf_to_inner()
1467 err = otx2_qos_txschq_update_config(pfvf, node, old_cfg); in otx2_qos_leaf_to_inner()
1473 otx2_qos_update_smq(pfvf, node, QOS_CFG_SQ); in otx2_qos_leaf_to_inner()
1492 node->child_static_cnt--; in otx2_qos_leaf_to_inner()
1494 node->child_dwrr_cnt--; in otx2_qos_leaf_to_inner()
1495 clear_bit(prio, node->prio_bmap); in otx2_qos_leaf_to_inner()
1520 static void otx2_cfg_smq(struct otx2_nic *pfvf, struct otx2_qos_node *node, in otx2_cfg_smq() argument
1525 list_for_each_entry(tmp, &node->child_schq_list, list) in otx2_cfg_smq()
1535 struct otx2_qos_node *node, *parent; in otx2_qos_leaf_del() local
1542 /* find node related to classid */ in otx2_qos_leaf_del()
1543 node = otx2_sw_node_find(pfvf, *classid); in otx2_qos_leaf_del()
1544 if (!node) { in otx2_qos_leaf_del()
1545 NL_SET_ERR_MSG_MOD(extack, "HTB node not found"); in otx2_qos_leaf_del()
1548 parent = node->parent; in otx2_qos_leaf_del()
1549 prio = node->prio; in otx2_qos_leaf_del()
1550 qid = node->qid; in otx2_qos_leaf_del()
1552 if (!node->is_static) in otx2_qos_leaf_del()
1555 otx2_qos_disable_sq(pfvf, node->qid); in otx2_qos_leaf_del()
1557 otx2_qos_destroy_node(pfvf, node); in otx2_qos_leaf_del()
1576 /* last node just deleted */ in otx2_qos_leaf_del()
1582 node = otx2_sw_node_find_by_qid(pfvf, moved_qid); in otx2_qos_leaf_del()
1583 if (!node) in otx2_qos_leaf_del()
1589 node->qid = OTX2_QOS_QID_INNER; in otx2_qos_leaf_del()
1596 * update the node in otx2_qos_leaf_del()
1598 otx2_cfg_smq(pfvf, node, qid); in otx2_qos_leaf_del()
1602 node->qid = qid; in otx2_qos_leaf_del()
1604 *classid = node->classid; in otx2_qos_leaf_del()
1611 struct otx2_qos_node *node, *parent; in otx2_qos_leaf_del_last() local
1621 /* find node related to classid */ in otx2_qos_leaf_del_last()
1622 node = otx2_sw_node_find(pfvf, classid); in otx2_qos_leaf_del_last()
1623 if (!node) { in otx2_qos_leaf_del_last()
1624 NL_SET_ERR_MSG_MOD(extack, "HTB node not found"); in otx2_qos_leaf_del_last()
1629 qid = node->qid; in otx2_qos_leaf_del_last()
1630 prio = node->prio; in otx2_qos_leaf_del_last()
1632 parent = otx2_sw_node_find(pfvf, node->parent->classid); in otx2_qos_leaf_del_last()
1634 NL_SET_ERR_MSG_MOD(extack, "parent node not found"); in otx2_qos_leaf_del_last()
1638 if (!node->is_static) in otx2_qos_leaf_del_last()
1641 /* destroy the leaf node */ in otx2_qos_leaf_del_last()
1643 otx2_qos_destroy_node(pfvf, node); in otx2_qos_leaf_del_last()