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()
177 if (node->qid == OTX2_QOS_QID_INNER && !node->parent) { in __otx2_qos_txschq_cfg()
194 struct otx2_qos_node *parent) in otx2_qos_txschq_set_parent_topology() argument
200 if (parent->level == NIX_TXSCH_LVL_MDQ) in otx2_qos_txschq_set_parent_topology()
211 cfg->lvl = parent->level; in otx2_qos_txschq_set_parent_topology()
213 if (parent->level == NIX_TXSCH_LVL_TL4) in otx2_qos_txschq_set_parent_topology()
214 cfg->reg[0] = NIX_AF_TL4X_TOPOLOGY(parent->schq); in otx2_qos_txschq_set_parent_topology()
215 else if (parent->level == NIX_TXSCH_LVL_TL3) in otx2_qos_txschq_set_parent_topology()
216 cfg->reg[0] = NIX_AF_TL3X_TOPOLOGY(parent->schq); in otx2_qos_txschq_set_parent_topology()
217 else if (parent->level == NIX_TXSCH_LVL_TL2) in otx2_qos_txschq_set_parent_topology()
218 cfg->reg[0] = NIX_AF_TL2X_TOPOLOGY(parent->schq); in otx2_qos_txschq_set_parent_topology()
219 else if (parent->level == NIX_TXSCH_LVL_TL1) in otx2_qos_txschq_set_parent_topology()
220 cfg->reg[0] = NIX_AF_TL1X_TOPOLOGY(parent->schq); in otx2_qos_txschq_set_parent_topology()
222 cfg->regval[0] = (u64)parent->prio_anchor << 32; in otx2_qos_txschq_set_parent_topology()
223 cfg->regval[0] |= ((parent->child_dwrr_prio != OTX2_QOS_DEFAULT_PRIO) ? in otx2_qos_txschq_set_parent_topology()
224 parent->child_dwrr_prio : 0) << 1; in otx2_qos_txschq_set_parent_topology()
235 struct otx2_qos_node *parent) in otx2_qos_free_hw_node_schq() argument
239 list_for_each_entry_reverse(node, &parent->child_schq_list, list) in otx2_qos_free_hw_node_schq()
244 struct otx2_qos_node *parent) in otx2_qos_free_hw_node() argument
248 list_for_each_entry_safe(node, tmp, &parent->child_list, list) { in otx2_qos_free_hw_node()
285 struct otx2_qos_node *parent) in otx2_qos_free_sw_node_schq() argument
289 list_for_each_entry_safe(node, tmp, &parent->child_schq_list, list) { in otx2_qos_free_sw_node_schq()
296 struct otx2_qos_node *parent) in __otx2_qos_free_sw_node() argument
300 list_for_each_entry_safe(node, tmp, &parent->child_list, list) { in __otx2_qos_free_sw_node()
326 static void otx2_qos_fill_cfg_schq(struct otx2_qos_node *parent, in otx2_qos_fill_cfg_schq() argument
331 list_for_each_entry(node, &parent->child_schq_list, list) in otx2_qos_fill_cfg_schq()
335 static void otx2_qos_fill_cfg_tl(struct otx2_qos_node *parent, in otx2_qos_fill_cfg_tl() argument
340 list_for_each_entry(node, &parent->child_list, list) { in otx2_qos_fill_cfg_tl()
348 cfg->schq_contig[parent->level - 1] += parent->child_dwrr_cnt + in otx2_qos_fill_cfg_tl()
349 parent->max_static_prio + 1; in otx2_qos_fill_cfg_tl()
353 struct otx2_qos_node *parent, in otx2_qos_prepare_txschq_cfg() argument
357 otx2_qos_fill_cfg_tl(parent, cfg); in otx2_qos_prepare_txschq_cfg()
361 static void otx2_qos_read_txschq_cfg_schq(struct otx2_qos_node *parent, in otx2_qos_read_txschq_cfg_schq() argument
367 list_for_each_entry(node, &parent->child_schq_list, list) { in otx2_qos_read_txschq_cfg_schq()
375 static void otx2_qos_read_txschq_cfg_tl(struct otx2_qos_node *parent, in otx2_qos_read_txschq_cfg_tl() argument
381 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
1228 /* get parent node */ in otx2_qos_leaf_alloc_queue()
1229 parent = otx2_sw_node_find(pfvf, parent_classid); in otx2_qos_leaf_alloc_queue()
1230 if (!parent) { in otx2_qos_leaf_alloc_queue()
1231 NL_SET_ERR_MSG_MOD(extack, "parent node not found"); 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()
1480 struct otx2_qos_node *node, *parent; in otx2_qos_leaf_del() local
1493 parent = node->parent; in otx2_qos_leaf_del()
1506 parent->child_dwrr_cnt--; in otx2_qos_leaf_del()
1508 parent->child_static_cnt--; in otx2_qos_leaf_del()
1509 clear_bit(prio, parent->prio_bmap); in otx2_qos_leaf_del()
1513 if (!parent->child_dwrr_cnt) in otx2_qos_leaf_del()
1514 otx2_reset_dwrr_prio(parent, prio); in otx2_qos_leaf_del()
1516 if (!parent->child_static_cnt) in otx2_qos_leaf_del()
1517 parent->max_static_prio = 0; in otx2_qos_leaf_del()
1525 struct otx2_qos_node *node, *parent; in otx2_qos_leaf_del_last() local
1542 /* save qid for use by parent */ in otx2_qos_leaf_del_last()
1546 parent = otx2_sw_node_find(pfvf, node->parent->classid); in otx2_qos_leaf_del_last()
1547 if (!parent) { in otx2_qos_leaf_del_last()
1548 NL_SET_ERR_MSG_MOD(extack, "parent node not found"); in otx2_qos_leaf_del_last()
1560 parent->child_dwrr_cnt--; in otx2_qos_leaf_del_last()
1562 parent->child_static_cnt--; in otx2_qos_leaf_del_last()
1563 clear_bit(prio, parent->prio_bmap); in otx2_qos_leaf_del_last()
1567 if (!parent->child_dwrr_cnt) in otx2_qos_leaf_del_last()
1568 otx2_reset_dwrr_prio(parent, prio); in otx2_qos_leaf_del_last()
1570 if (!parent->child_static_cnt) in otx2_qos_leaf_del_last()
1571 parent->max_static_prio = 0; in otx2_qos_leaf_del_last()
1573 /* create downstream txschq entries to parent */ in otx2_qos_leaf_del_last()
1574 err = otx2_qos_alloc_txschq_node(pfvf, parent); in otx2_qos_leaf_del_last()
1579 WRITE_ONCE(parent->qid, qid); in otx2_qos_leaf_del_last()
1589 otx2_qos_fill_cfg_schq(parent, new_cfg); in otx2_qos_leaf_del_last()
1590 err = otx2_qos_push_txschq_cfg(pfvf, parent, new_cfg); in otx2_qos_leaf_del_last()