Lines Matching full:parent
93 /* configure parent txschq */ in otx2_config_sched_shaping()
94 cfg->regval[*num_regs] = node->parent->schq << 16; in otx2_config_sched_shaping()
108 (node->schq - node->parent->prio_anchor) << 24; in otx2_config_sched_shaping()
113 cfg->regval[*num_regs] = node->parent->child_dwrr_prio << 24 | in otx2_config_sched_shaping()
176 if (node->qid == OTX2_QOS_QID_INNER && !node->parent) { in __otx2_qos_txschq_cfg()
193 struct otx2_qos_node *parent) in otx2_qos_txschq_set_parent_topology() argument
199 if (parent->level == NIX_TXSCH_LVL_MDQ) in otx2_qos_txschq_set_parent_topology()
210 cfg->lvl = parent->level; in otx2_qos_txschq_set_parent_topology()
212 if (parent->level == NIX_TXSCH_LVL_TL4) in otx2_qos_txschq_set_parent_topology()
213 cfg->reg[0] = NIX_AF_TL4X_TOPOLOGY(parent->schq); in otx2_qos_txschq_set_parent_topology()
214 else if (parent->level == NIX_TXSCH_LVL_TL3) in otx2_qos_txschq_set_parent_topology()
215 cfg->reg[0] = NIX_AF_TL3X_TOPOLOGY(parent->schq); in otx2_qos_txschq_set_parent_topology()
216 else if (parent->level == NIX_TXSCH_LVL_TL2) in otx2_qos_txschq_set_parent_topology()
217 cfg->reg[0] = NIX_AF_TL2X_TOPOLOGY(parent->schq); in otx2_qos_txschq_set_parent_topology()
218 else if (parent->level == NIX_TXSCH_LVL_TL1) in otx2_qos_txschq_set_parent_topology()
219 cfg->reg[0] = NIX_AF_TL1X_TOPOLOGY(parent->schq); in otx2_qos_txschq_set_parent_topology()
221 cfg->regval[0] = (u64)parent->prio_anchor << 32; in otx2_qos_txschq_set_parent_topology()
222 cfg->regval[0] |= ((parent->child_dwrr_prio != OTX2_QOS_DEFAULT_PRIO) ? in otx2_qos_txschq_set_parent_topology()
223 parent->child_dwrr_prio : 0) << 1; in otx2_qos_txschq_set_parent_topology()
234 struct otx2_qos_node *parent) in otx2_qos_free_hw_node_schq() argument
238 list_for_each_entry_reverse(node, &parent->child_schq_list, list) in otx2_qos_free_hw_node_schq()
243 struct otx2_qos_node *parent) in otx2_qos_free_hw_node() argument
247 list_for_each_entry_safe(node, tmp, &parent->child_list, list) { in otx2_qos_free_hw_node()
284 struct otx2_qos_node *parent) in otx2_qos_free_sw_node_schq() argument
288 list_for_each_entry_safe(node, tmp, &parent->child_schq_list, list) { in otx2_qos_free_sw_node_schq()
295 struct otx2_qos_node *parent) in __otx2_qos_free_sw_node() argument
299 list_for_each_entry_safe(node, tmp, &parent->child_list, list) { in __otx2_qos_free_sw_node()
325 static void otx2_qos_fill_cfg_schq(struct otx2_qos_node *parent, in otx2_qos_fill_cfg_schq() argument
330 list_for_each_entry(node, &parent->child_schq_list, list) in otx2_qos_fill_cfg_schq()
334 static void otx2_qos_fill_cfg_tl(struct otx2_qos_node *parent, in otx2_qos_fill_cfg_tl() argument
339 list_for_each_entry(node, &parent->child_list, list) { in otx2_qos_fill_cfg_tl()
347 cfg->schq_contig[parent->level - 1] += parent->child_dwrr_cnt + in otx2_qos_fill_cfg_tl()
348 parent->max_static_prio + 1; in otx2_qos_fill_cfg_tl()
352 struct otx2_qos_node *parent, in otx2_qos_prepare_txschq_cfg() argument
356 otx2_qos_fill_cfg_tl(parent, cfg); in otx2_qos_prepare_txschq_cfg()
360 static void otx2_qos_read_txschq_cfg_schq(struct otx2_qos_node *parent, in otx2_qos_read_txschq_cfg_schq() argument
366 list_for_each_entry(node, &parent->child_schq_list, list) { in otx2_qos_read_txschq_cfg_schq()
374 static void otx2_qos_read_txschq_cfg_tl(struct otx2_qos_node *parent, in otx2_qos_read_txschq_cfg_tl() argument
380 list_for_each_entry(node, &parent->child_list, list) { in otx2_qos_read_txschq_cfg_tl()
409 node->parent = NULL; in otx2_qos_alloc_root()
428 static int otx2_qos_add_child_node(struct otx2_qos_node *parent, in otx2_qos_add_child_node() argument
431 struct list_head *head = &parent->child_list; in otx2_qos_add_child_node()
435 if (node->prio > parent->max_static_prio) in otx2_qos_add_child_node()
436 parent->max_static_prio = node->prio; in otx2_qos_add_child_node()
456 struct otx2_qos_node *txschq_node, *parent, *tmp; in otx2_qos_alloc_txschq_node() local
459 parent = node; in otx2_qos_alloc_txschq_node()
465 txschq_node->parent = parent; in otx2_qos_alloc_txschq_node()
483 parent = txschq_node; in otx2_qos_alloc_txschq_node()
499 struct otx2_qos_node *parent, in otx2_qos_sw_create_leaf_node() argument
510 node->parent = parent; in otx2_qos_sw_create_leaf_node()
511 node->level = parent->level - 1; in otx2_qos_sw_create_leaf_node()
528 err = otx2_qos_add_child_node(parent, node); in otx2_qos_sw_create_leaf_node()
837 ret = otx2_qos_txschq_set_parent_topology(pfvf, tmp->parent); in otx2_qos_txschq_push_cfg_schq()
1021 otx2_qos_prepare_txschq_cfg(pfvf, node->parent, cfg); in otx2_qos_update_tree()
1022 return otx2_qos_push_txschq_cfg(pfvf, node->parent, cfg); in otx2_qos_update_tree()
1126 static int otx2_qos_validate_dwrr_cfg(struct otx2_qos_node *parent, in otx2_qos_validate_dwrr_cfg() argument
1139 if (parent->child_dwrr_prio == OTX2_QOS_DEFAULT_PRIO) { in otx2_qos_validate_dwrr_cfg()
1140 parent->child_dwrr_prio = prio; in otx2_qos_validate_dwrr_cfg()
1141 } else if (prio != parent->child_dwrr_prio) { in otx2_qos_validate_dwrr_cfg()
1149 static int otx2_qos_validate_configuration(struct otx2_qos_node *parent, in otx2_qos_validate_configuration() argument
1154 if (prio == parent->child_dwrr_prio && static_cfg) { in otx2_qos_validate_configuration()
1159 if (static_cfg && test_bit(prio, parent->prio_bmap)) { in otx2_qos_validate_configuration()
1168 static void otx2_reset_dwrr_prio(struct otx2_qos_node *parent, u64 prio) in otx2_reset_dwrr_prio() argument
1171 if (parent->level == NIX_TXSCH_LVL_TL1) in otx2_reset_dwrr_prio()
1174 if (parent->child_dwrr_prio != OTX2_QOS_DEFAULT_PRIO) { in otx2_reset_dwrr_prio()
1175 parent->child_dwrr_prio = OTX2_QOS_DEFAULT_PRIO; in otx2_reset_dwrr_prio()
1176 clear_bit(prio, parent->prio_bmap); in otx2_reset_dwrr_prio()
1180 static bool is_qos_node_dwrr(struct otx2_qos_node *parent, in is_qos_node_dwrr() argument
1187 if (parent->child_dwrr_prio == prio) in is_qos_node_dwrr()
1191 list_for_each_entry(node, &parent->child_list, list) { in is_qos_node_dwrr()
1193 if (parent->child_dwrr_prio != OTX2_QOS_DEFAULT_PRIO && in is_qos_node_dwrr()
1194 parent->child_dwrr_prio != prio) in is_qos_node_dwrr()
1206 parent->child_dwrr_cnt++; in is_qos_node_dwrr()
1207 parent->child_static_cnt--; in is_qos_node_dwrr()
1223 struct otx2_qos_node *node, *parent; in otx2_qos_leaf_alloc_queue() local
1243 /* get parent node */ in otx2_qos_leaf_alloc_queue()
1244 parent = otx2_sw_node_find(pfvf, parent_classid); in otx2_qos_leaf_alloc_queue()
1245 if (!parent) { in otx2_qos_leaf_alloc_queue()
1246 NL_SET_ERR_MSG_MOD(extack, "parent node not found"); in otx2_qos_leaf_alloc_queue()
1250 if (parent->level == NIX_TXSCH_LVL_MDQ) { in otx2_qos_leaf_alloc_queue()
1256 static_cfg = !is_qos_node_dwrr(parent, pfvf, prio); in otx2_qos_leaf_alloc_queue()
1257 ret = otx2_qos_validate_configuration(parent, extack, pfvf, prio, in otx2_qos_leaf_alloc_queue()
1263 ret = otx2_qos_validate_dwrr_cfg(parent, extack, pfvf, prio, in otx2_qos_leaf_alloc_queue()
1270 parent->child_static_cnt++; in otx2_qos_leaf_alloc_queue()
1272 parent->child_dwrr_cnt++; in otx2_qos_leaf_alloc_queue()
1274 set_bit(prio, parent->prio_bmap); in otx2_qos_leaf_alloc_queue()
1283 otx2_qos_read_txschq_cfg(pfvf, parent, old_cfg); in otx2_qos_leaf_alloc_queue()
1297 node = otx2_qos_sw_create_leaf_node(pfvf, parent, classid, prio, rate, in otx2_qos_leaf_alloc_queue()
1318 err = otx2_qos_txschq_update_config(pfvf, parent, old_cfg); in otx2_qos_leaf_alloc_queue()
1325 otx2_qos_update_smq(pfvf, parent, QOS_CFG_SQ); in otx2_qos_leaf_alloc_queue()
1347 parent->child_static_cnt--; in otx2_qos_leaf_alloc_queue()
1349 parent->child_dwrr_cnt--; in otx2_qos_leaf_alloc_queue()
1351 clear_bit(prio, parent->prio_bmap); in otx2_qos_leaf_alloc_queue()
1530 struct otx2_qos_node *node, *parent; in otx2_qos_leaf_del() local
1543 parent = node->parent; in otx2_qos_leaf_del()
1556 parent->child_dwrr_cnt--; in otx2_qos_leaf_del()
1558 parent->child_static_cnt--; in otx2_qos_leaf_del()
1559 clear_bit(prio, parent->prio_bmap); in otx2_qos_leaf_del()
1563 if (!parent->child_dwrr_cnt) in otx2_qos_leaf_del()
1564 otx2_reset_dwrr_prio(parent, prio); in otx2_qos_leaf_del()
1566 if (!parent->child_static_cnt) in otx2_qos_leaf_del()
1567 parent->max_static_prio = 0; in otx2_qos_leaf_del()
1606 struct otx2_qos_node *node, *parent; in otx2_qos_leaf_del_last() local
1623 /* save qid for use by parent */ in otx2_qos_leaf_del_last()
1627 parent = otx2_sw_node_find(pfvf, node->parent->classid); in otx2_qos_leaf_del_last()
1628 if (!parent) { in otx2_qos_leaf_del_last()
1629 NL_SET_ERR_MSG_MOD(extack, "parent node not found"); in otx2_qos_leaf_del_last()
1642 parent->child_dwrr_cnt--; in otx2_qos_leaf_del_last()
1644 parent->child_static_cnt--; in otx2_qos_leaf_del_last()
1645 clear_bit(prio, parent->prio_bmap); in otx2_qos_leaf_del_last()
1649 if (!parent->child_dwrr_cnt) in otx2_qos_leaf_del_last()
1650 otx2_reset_dwrr_prio(parent, prio); in otx2_qos_leaf_del_last()
1652 if (!parent->child_static_cnt) in otx2_qos_leaf_del_last()
1653 parent->max_static_prio = 0; in otx2_qos_leaf_del_last()
1655 /* create downstream txschq entries to parent */ in otx2_qos_leaf_del_last()
1656 err = otx2_qos_alloc_txschq_node(pfvf, parent); in otx2_qos_leaf_del_last()
1661 WRITE_ONCE(parent->qid, qid); in otx2_qos_leaf_del_last()
1671 otx2_qos_fill_cfg_schq(parent, new_cfg); in otx2_qos_leaf_del_last()
1672 err = otx2_qos_push_txschq_cfg(pfvf, parent, new_cfg); in otx2_qos_leaf_del_last()