Lines Matching full:leaves
873 /* Eventually delete the parent, if it is left over with no leaves. */ in __net_shaper_delete()
876 if (shaper && !--shaper->leaves) { in __net_shaper_delete()
894 const struct net_shaper *leaves, in net_shaper_parent_from_leaves() argument
898 struct net_shaper_handle parent = leaves[0].parent; in net_shaper_parent_from_leaves()
902 if (net_shaper_handle_cmp(&leaves[i].parent, &parent)) { in net_shaper_parent_from_leaves()
903 NL_SET_ERR_MSG_FMT(extack, "All the leaves shapers must have the same old parent"); in net_shaper_parent_from_leaves()
914 struct net_shaper *leaves, in __net_shaper_group() argument
937 * the leaves. in __net_shaper_group()
941 leaves, node, in __net_shaper_group()
974 leaf_handle = leaves[i].handle; in __net_shaper_group()
980 if (!net_shaper_handle_cmp(&leaves[i].parent, &node->handle)) in __net_shaper_group()
983 /* The leaves shapers will be nested to the node, update the in __net_shaper_group()
986 leaves[i].parent = node->handle; in __net_shaper_group()
987 node->leaves++; in __net_shaper_group()
990 ret = ops->group(binding, leaves_count, leaves, node, extack); in __net_shaper_group()
998 parent->leaves++; in __net_shaper_group()
1001 net_shaper_commit(binding, leaves_count, leaves); in __net_shaper_group()
1014 struct net_shaper *cur, *leaves, node = {}; in net_shaper_pre_del_node() local
1019 if (!shaper->leaves) in net_shaper_pre_del_node()
1036 leaves = kcalloc(shaper->leaves, sizeof(struct net_shaper), in net_shaper_pre_del_node()
1038 if (!leaves) in net_shaper_pre_del_node()
1041 /* Build the leaves arrays. */ in net_shaper_pre_del_node()
1046 if (WARN_ON_ONCE(leaves_count == shaper->leaves)) { in net_shaper_pre_del_node()
1051 leaves[leaves_count++] = *cur; in net_shaper_pre_del_node()
1060 leaves, &node, extack); in net_shaper_pre_del_node()
1063 kfree(leaves); in net_shaper_pre_del_node()
1140 struct net_shaper **old_nodes, *leaves, node = {}; in net_shaper_nl_group_doit() local
1166 leaves = kcalloc(leaves_count, sizeof(struct net_shaper) + in net_shaper_nl_group_doit()
1168 if (!leaves) { in net_shaper_nl_group_doit()
1172 old_nodes = (void *)&leaves[leaves_count]; in net_shaper_nl_group_doit()
1186 &node, &leaves[i]); in net_shaper_nl_group_doit()
1209 if (leaves[i].parent.scope == NET_SHAPER_SCOPE_NODE && in net_shaper_nl_group_doit()
1210 net_shaper_handle_cmp(&leaves[i].parent, &node.handle)) { in net_shaper_nl_group_doit()
1213 tmp = net_shaper_lookup(binding, &leaves[i].parent); in net_shaper_nl_group_doit()
1221 ret = __net_shaper_group(binding, true, leaves_count, leaves, &node, in net_shaper_nl_group_doit()
1226 /* Check if we need to delete any node left alone by the new leaves in net_shaper_nl_group_doit()
1232 if (--tmp->leaves > 0) in net_shaper_nl_group_doit()
1247 kfree(leaves); in net_shaper_nl_group_doit()
1428 if (shaper && !--shaper->leaves) in net_shaper_set_real_num_tx_queues()