src/dpdk/drivers/net/ice/base/ice_sched.c
static enum ice_status
ice_sched_validate_vsi_srl_node(struct ice_port_info *pi, u16 vsi_handle)
{
	u8 sel_layer = ICE_SCHED_INVAL_LAYER_NUM;
	u8 tc;

	if (!ice_is_vsi_valid(pi->hw, vsi_handle))
		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, *vsi_node;
		enum ice_rl_type rl_type = ICE_SHARED_BW;
		enum ice_status status;

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

		vsi_node = ice_sched_get_vsi_node(pi, tc_node, vsi_handle);
		if (!vsi_node)
			continue;

		/* SRL bandwidth layer selection */
		if (sel_layer == ICE_SCHED_INVAL_LAYER_NUM) {
			u8 node_layer = vsi_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(vsi_node, sel_layer);
		if (status)
			return status;
	}
	return ICE_SUCCESS;
}
/**
 * ice_sched_validate_vsi_srl_node - validate VSI SRL node
 * @pi: port information structure
 * @vsi_handle: software VSI handle
 *
 * This function validates SRL node of the VSI node if available SRL layer is
 * different than the VSI node layer on all TC(s).This function needs to be
 * called with scheduler lock held.
 */
validate VSI SRL node
@pi: port information structure
@vsi_handle: software VSI handle

This function validates SRL node of the VSI node if available SRL layer is
different than the VSI node layer on all TC(s).This function needs to be
called with scheduler lock held.
validate VSI SRL node @pi : port information structure @vsi_handle : software VSI handle This function validates SRL node of the VSI node if available SRL layer is different than the VSI node layer on all TC ( s ) . This function needs to be called with scheduler lock held .
static enum ice_status
ice_sched_validate_vsi_srl_node(struct ice_port_info *pi, u16 vsi_handle)
{
	u8 sel_layer = ICE_SCHED_INVAL_LAYER_NUM;
	u8 tc;
	if (!ice_is_vsi_valid(pi->hw, vsi_handle))
		return ICE_ERR_PARAM;
	ice_for_each_traffic_class(tc) {
		struct ice_sched_node *tc_node, *vsi_node;
		enum ice_rl_type rl_type = ICE_SHARED_BW;
		enum ice_status status;
		tc_node = ice_sched_get_tc_node(pi, tc);
		if (!tc_node)
			continue;
		vsi_node = ice_sched_get_vsi_node(pi, tc_node, vsi_handle);
		if (!vsi_node)
			continue;
		if (sel_layer == ICE_SCHED_INVAL_LAYER_NUM) {
			u8 node_layer = vsi_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(vsi_node, sel_layer);
		if (status)
			return status;
	}
	return ICE_SUCCESS;
}
static enum ice_status ice_sched_validate_vsi_srl_node ( struct ice_port_info * pi , u16 vsi_handle ) { u8 sel_layer = ICE_SCHED_INVAL_LAYER_NUM ; u8 tc ; if ( ! ice_is_vsi_valid ( pi -> hw , vsi_handle ) ) return ICE_ERR_PARAM ; ice_for_each_traffic_class ( tc ) { struct ice_sched_node * tc_node , * vsi_node ; enum ice_rl_type rl_type = ICE_SHARED_BW ; enum ice_status status ; tc_node = ice_sched_get_tc_node ( pi , tc ) ; if ( ! tc_node ) continue ; vsi_node = ice_sched_get_vsi_node ( pi , tc_node , vsi_handle ) ; if ( ! vsi_node ) continue ; if ( sel_layer == ICE_SCHED_INVAL_LAYER_NUM ) { u8 node_layer = vsi_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 ( vsi_node , sel_layer ) ; if ( status ) return status ; } return ICE_SUCCESS ; }
ice_sched_validate_vsi_srl_node - validate VSI SRL node
 @pi: port information structure
 @vsi_handle: software VSI handle
ice_sched_validate_vsi_srl_node - validate VSI SRL node @pi : port information structure @vsi_handle : software VSI handle
/* Return success if no nodes are present across TC */ /* SRL bandwidth layer selection */