src/dpdk/drivers/net/ice/base/ice_sched.c
static enum ice_status
ice_sched_validate_agg_srl_node(struct ice_port_info *pi, u32 agg_id)
{
	u8 sel_layer = ICE_SCHED_INVAL_LAYER_NUM;
	struct ice_sched_agg_info *agg_info;
	bool agg_id_present = false;
	enum ice_status status = ICE_SUCCESS;
	u8 tc;

	LIST_FOR_EACH_ENTRY(agg_info, &pi->hw->agg_list, ice_sched_agg_info,
			    list_entry)
		if (agg_info->agg_id == agg_id) {
			agg_id_present = true;
			break;
		}
	if (!agg_id_present)
		return ICE_ERR_PARAM;
	/* Return success if no nodes are present across TC */
	ice_for_each_traffic_class(tc) {
		struct ice_sched_node *tc_node, *agg_node;
		enum ice_rl_type rl_type = ICE_SHARED_BW;

		tc_node = ice_sched_get_tc_node(pi, tc);
		if (!tc_node)
			continue;

		agg_node = ice_sched_get_agg_node(pi, tc_node, agg_id);
		if (!agg_node)
			continue;
		/* SRL bandwidth layer selection */
		if (sel_layer == ICE_SCHED_INVAL_LAYER_NUM) {
			u8 node_layer = agg_node->tx_sched_layer;
			u8 layer_num;

			layer_num = ice_sched_get_rl_prof_layer(pi, rl_type,
								node_layer);
			if (layer_num >= pi->hw->num_tx_sched_layers)
				return ICE_ERR_PARAM;
			sel_layer = layer_num;
		}

		status = ice_sched_validate_srl_node(agg_node, sel_layer);
		if (status)
			break;
	}
	return status;
}
/**
 * ice_sched_validate_agg_srl_node - validate AGG SRL node
 * @pi: port information structure
 * @agg_id: aggregator ID
 *
 * This function validates SRL node of the AGG node if available SRL layer is
 * different than the AGG node layer on all TC(s).This function needs to be
 * called with scheduler lock held.
 */
validate AGG SRL node
@pi: port information structure
@agg_id: aggregator ID

This function validates SRL node of the AGG node if available SRL layer is
different than the AGG node layer on all TC(s).This function needs to be
called with scheduler lock held.
validate AGG SRL node @pi : port information structure @agg_id : aggregator ID This function validates SRL node of the AGG node if available SRL layer is different than the AGG node layer on all TC ( s ) . This function needs to be called with scheduler lock held .
static enum ice_status
ice_sched_validate_agg_srl_node(struct ice_port_info *pi, u32 agg_id)
{
	u8 sel_layer = ICE_SCHED_INVAL_LAYER_NUM;
	struct ice_sched_agg_info *agg_info;
	bool agg_id_present = false;
	enum ice_status status = ICE_SUCCESS;
	u8 tc;
	LIST_FOR_EACH_ENTRY(agg_info, &pi->hw->agg_list, ice_sched_agg_info,
			    list_entry)
		if (agg_info->agg_id == agg_id) {
			agg_id_present = true;
			break;
		}
	if (!agg_id_present)
		return ICE_ERR_PARAM;
	ice_for_each_traffic_class(tc) {
		struct ice_sched_node *tc_node, *agg_node;
		enum ice_rl_type rl_type = ICE_SHARED_BW;
		tc_node = ice_sched_get_tc_node(pi, tc);
		if (!tc_node)
			continue;
		agg_node = ice_sched_get_agg_node(pi, tc_node, agg_id);
		if (!agg_node)
			continue;
		if (sel_layer == ICE_SCHED_INVAL_LAYER_NUM) {
			u8 node_layer = agg_node->tx_sched_layer;
			u8 layer_num;
			layer_num = ice_sched_get_rl_prof_layer(pi, rl_type,
								node_layer);
			if (layer_num >= pi->hw->num_tx_sched_layers)
				return ICE_ERR_PARAM;
			sel_layer = layer_num;
		}
		status = ice_sched_validate_srl_node(agg_node, sel_layer);
		if (status)
			break;
	}
	return status;
}
static enum ice_status ice_sched_validate_agg_srl_node ( struct ice_port_info * pi , u32 agg_id ) { u8 sel_layer = ICE_SCHED_INVAL_LAYER_NUM ; struct ice_sched_agg_info * agg_info ; bool agg_id_present = false ; enum ice_status status = ICE_SUCCESS ; u8 tc ; LIST_FOR_EACH_ENTRY ( agg_info , & pi -> hw -> agg_list , ice_sched_agg_info , list_entry ) if ( agg_info -> agg_id == agg_id ) { agg_id_present = true ; break ; } if ( ! agg_id_present ) return ICE_ERR_PARAM ; ice_for_each_traffic_class ( tc ) { struct ice_sched_node * tc_node , * agg_node ; enum ice_rl_type rl_type = ICE_SHARED_BW ; tc_node = ice_sched_get_tc_node ( pi , tc ) ; if ( ! tc_node ) continue ; agg_node = ice_sched_get_agg_node ( pi , tc_node , agg_id ) ; if ( ! agg_node ) continue ; if ( sel_layer == ICE_SCHED_INVAL_LAYER_NUM ) { u8 node_layer = agg_node -> tx_sched_layer ; u8 layer_num ; layer_num = ice_sched_get_rl_prof_layer ( pi , rl_type , node_layer ) ; if ( layer_num >= pi -> hw -> num_tx_sched_layers ) return ICE_ERR_PARAM ; sel_layer = layer_num ; } status = ice_sched_validate_srl_node ( agg_node , sel_layer ) ; if ( status ) break ; } return status ; }
ice_sched_validate_agg_srl_node - validate AGG SRL node
 @pi: port information structure
 @agg_id: aggregator ID
ice_sched_validate_agg_srl_node - validate AGG SRL node @pi : port information structure @agg_id : aggregator ID
/* Return success if no nodes are present across TC */ /* SRL bandwidth layer selection */