Lines Matching refs:parent

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()
823 ret = otx2_qos_txschq_set_parent_topology(pfvf, tmp->parent); in otx2_qos_txschq_push_cfg_schq()
1006 otx2_qos_prepare_txschq_cfg(pfvf, node->parent, cfg); in otx2_qos_update_tree()
1007 return otx2_qos_push_txschq_cfg(pfvf, node->parent, cfg); in otx2_qos_update_tree()
1111 static int otx2_qos_validate_dwrr_cfg(struct otx2_qos_node *parent, in otx2_qos_validate_dwrr_cfg() argument
1124 if (parent->child_dwrr_prio == OTX2_QOS_DEFAULT_PRIO) { in otx2_qos_validate_dwrr_cfg()
1125 parent->child_dwrr_prio = prio; in otx2_qos_validate_dwrr_cfg()
1126 } else if (prio != parent->child_dwrr_prio) { in otx2_qos_validate_dwrr_cfg()
1134 static int otx2_qos_validate_configuration(struct otx2_qos_node *parent, in otx2_qos_validate_configuration() argument
1139 if (prio == parent->child_dwrr_prio && static_cfg) { in otx2_qos_validate_configuration()
1144 if (static_cfg && test_bit(prio, parent->prio_bmap)) { in otx2_qos_validate_configuration()
1153 static void otx2_reset_dwrr_prio(struct otx2_qos_node *parent, u64 prio) in otx2_reset_dwrr_prio() argument
1156 if (parent->level == NIX_TXSCH_LVL_TL1) in otx2_reset_dwrr_prio()
1159 if (parent->child_dwrr_prio != OTX2_QOS_DEFAULT_PRIO) { in otx2_reset_dwrr_prio()
1160 parent->child_dwrr_prio = OTX2_QOS_DEFAULT_PRIO; in otx2_reset_dwrr_prio()
1161 clear_bit(prio, parent->prio_bmap); in otx2_reset_dwrr_prio()
1165 static bool is_qos_node_dwrr(struct otx2_qos_node *parent, in is_qos_node_dwrr() argument
1172 if (parent->child_dwrr_prio == prio) in is_qos_node_dwrr()
1176 list_for_each_entry(node, &parent->child_list, list) { in is_qos_node_dwrr()
1178 if (parent->child_dwrr_prio != OTX2_QOS_DEFAULT_PRIO && in is_qos_node_dwrr()
1179 parent->child_dwrr_prio != prio) in is_qos_node_dwrr()
1191 parent->child_dwrr_cnt++; in is_qos_node_dwrr()
1192 parent->child_static_cnt--; in is_qos_node_dwrr()
1208 struct otx2_qos_node *node, *parent; in otx2_qos_leaf_alloc_queue() local
1229 parent = otx2_sw_node_find(pfvf, parent_classid); in otx2_qos_leaf_alloc_queue()
1230 if (!parent) { in otx2_qos_leaf_alloc_queue()
1235 if (parent->level == NIX_TXSCH_LVL_MDQ) { in otx2_qos_leaf_alloc_queue()
1241 static_cfg = !is_qos_node_dwrr(parent, pfvf, prio); in otx2_qos_leaf_alloc_queue()
1242 ret = otx2_qos_validate_configuration(parent, extack, pfvf, prio, in otx2_qos_leaf_alloc_queue()
1248 ret = otx2_qos_validate_dwrr_cfg(parent, extack, pfvf, prio, in otx2_qos_leaf_alloc_queue()
1255 parent->child_static_cnt++; in otx2_qos_leaf_alloc_queue()
1257 parent->child_dwrr_cnt++; in otx2_qos_leaf_alloc_queue()
1259 set_bit(prio, parent->prio_bmap); in otx2_qos_leaf_alloc_queue()
1268 otx2_qos_read_txschq_cfg(pfvf, parent, old_cfg); in otx2_qos_leaf_alloc_queue()
1282 node = otx2_qos_sw_create_leaf_node(pfvf, parent, classid, prio, rate, in otx2_qos_leaf_alloc_queue()
1303 err = otx2_qos_txschq_update_config(pfvf, parent, old_cfg); in otx2_qos_leaf_alloc_queue()
1310 otx2_qos_update_smq(pfvf, parent, QOS_CFG_SQ); in otx2_qos_leaf_alloc_queue()
1332 parent->child_static_cnt--; in otx2_qos_leaf_alloc_queue()
1334 parent->child_dwrr_cnt--; in otx2_qos_leaf_alloc_queue()
1336 clear_bit(prio, parent->prio_bmap); in otx2_qos_leaf_alloc_queue()
1483 struct otx2_qos_node *node, *parent; in otx2_qos_leaf_del() local
1496 parent = node->parent; in otx2_qos_leaf_del()
1509 parent->child_dwrr_cnt--; in otx2_qos_leaf_del()
1511 parent->child_static_cnt--; in otx2_qos_leaf_del()
1512 clear_bit(prio, parent->prio_bmap); in otx2_qos_leaf_del()
1516 if (!parent->child_dwrr_cnt) in otx2_qos_leaf_del()
1517 otx2_reset_dwrr_prio(parent, prio); in otx2_qos_leaf_del()
1519 if (!parent->child_static_cnt) in otx2_qos_leaf_del()
1520 parent->max_static_prio = 0; in otx2_qos_leaf_del()
1528 struct otx2_qos_node *node, *parent; in otx2_qos_leaf_del_last() local
1549 parent = otx2_sw_node_find(pfvf, node->parent->classid); in otx2_qos_leaf_del_last()
1550 if (!parent) { in otx2_qos_leaf_del_last()
1564 parent->child_dwrr_cnt--; in otx2_qos_leaf_del_last()
1566 parent->child_static_cnt--; in otx2_qos_leaf_del_last()
1567 clear_bit(prio, parent->prio_bmap); in otx2_qos_leaf_del_last()
1571 if (!parent->child_dwrr_cnt) in otx2_qos_leaf_del_last()
1572 otx2_reset_dwrr_prio(parent, prio); in otx2_qos_leaf_del_last()
1574 if (!parent->child_static_cnt) in otx2_qos_leaf_del_last()
1575 parent->max_static_prio = 0; in otx2_qos_leaf_del_last()
1578 err = otx2_qos_alloc_txschq_node(pfvf, parent); in otx2_qos_leaf_del_last()
1583 WRITE_ONCE(parent->qid, qid); in otx2_qos_leaf_del_last()
1593 otx2_qos_fill_cfg_schq(parent, new_cfg); in otx2_qos_leaf_del_last()
1594 err = otx2_qos_push_txschq_cfg(pfvf, parent, new_cfg); in otx2_qos_leaf_del_last()