src/dpdk/drivers/net/ice/base/ice_sched.c
static enum ice_status
ice_sched_rm_agg_cfg(struct ice_port_info *pi, u32 agg_id, u8 tc)
{
	struct ice_sched_node *tc_node, *agg_node;
	struct ice_hw *hw = pi->hw;

	tc_node = ice_sched_get_tc_node(pi, tc);
	if (!tc_node)
		return ICE_ERR_CFG;

	agg_node = ice_sched_get_agg_node(pi, tc_node, agg_id);
	if (!agg_node)
		return ICE_ERR_DOES_NOT_EXIST;

	/* Can't remove the aggregator node if it has children */
	if (ice_sched_is_agg_inuse(pi, agg_node))
		return ICE_ERR_IN_USE;

	/* need to remove the whole subtree if aggregator node is the
	 * only child.
	 */
	while (agg_node->tx_sched_layer > hw->sw_entry_point_layer) {
		struct ice_sched_node *parent = agg_node->parent;

		if (!parent)
			return ICE_ERR_CFG;

		if (parent->num_children > 1)
			break;

		agg_node = parent;
	}

	ice_free_sched_node(pi, agg_node);
	return ICE_SUCCESS;
}
/**
 * ice_sched_rm_agg_cfg - remove the aggregator node
 * @pi: port information structure
 * @agg_id: aggregator ID
 * @tc: TC number
 *
 * This function removes the aggregator node and intermediate nodes if any
 * from the given TC
 */
remove the aggregator node
@pi: port information structure
@agg_id: aggregator ID
@tc: TC number

This function removes the aggregator node and intermediate nodes if any
from the given TC
remove the aggregator node @pi : port information structure @agg_id : aggregator ID @tc : TC number This function removes the aggregator node and intermediate nodes if any from the given TC
static enum ice_status
ice_sched_rm_agg_cfg(struct ice_port_info *pi, u32 agg_id, u8 tc)
{
	struct ice_sched_node *tc_node, *agg_node;
	struct ice_hw *hw = pi->hw;
	tc_node = ice_sched_get_tc_node(pi, tc);
	if (!tc_node)
		return ICE_ERR_CFG;
	agg_node = ice_sched_get_agg_node(pi, tc_node, agg_id);
	if (!agg_node)
		return ICE_ERR_DOES_NOT_EXIST;
	if (ice_sched_is_agg_inuse(pi, agg_node))
		return ICE_ERR_IN_USE;
	while (agg_node->tx_sched_layer > hw->sw_entry_point_layer) {
		struct ice_sched_node *parent = agg_node->parent;
		if (!parent)
			return ICE_ERR_CFG;
		if (parent->num_children > 1)
			break;
		agg_node = parent;
	}
	ice_free_sched_node(pi, agg_node);
	return ICE_SUCCESS;
}
static enum ice_status ice_sched_rm_agg_cfg ( struct ice_port_info * pi , u32 agg_id , u8 tc ) { struct ice_sched_node * tc_node , * agg_node ; struct ice_hw * hw = pi -> hw ; tc_node = ice_sched_get_tc_node ( pi , tc ) ; if ( ! tc_node ) return ICE_ERR_CFG ; agg_node = ice_sched_get_agg_node ( pi , tc_node , agg_id ) ; if ( ! agg_node ) return ICE_ERR_DOES_NOT_EXIST ; if ( ice_sched_is_agg_inuse ( pi , agg_node ) ) return ICE_ERR_IN_USE ; while ( agg_node -> tx_sched_layer > hw -> sw_entry_point_layer ) { struct ice_sched_node * parent = agg_node -> parent ; if ( ! parent ) return ICE_ERR_CFG ; if ( parent -> num_children > 1 ) break ; agg_node = parent ; } ice_free_sched_node ( pi , agg_node ) ; return ICE_SUCCESS ; }
ice_sched_rm_agg_cfg - remove the aggregator node
 @pi: port information structure
 @agg_id: aggregator ID
 @tc: TC number
ice_sched_rm_agg_cfg - remove the aggregator node @pi : port information structure @agg_id : aggregator ID @tc : TC number
/* Can't remove the aggregator node if it has children */ /* need to remove the whole subtree if aggregator node is the
	 * only child.
	 */