src/dpdk/drivers/net/ice/base/ice_sched.c
enum ice_status
ice_cfg_vsi_bw_alloc(struct ice_port_info *pi, u16 vsi_handle, u8 ena_tcmap,
		     enum ice_rl_type rl_type, u8 *bw_alloc)
{
	enum ice_status status = ICE_SUCCESS;
	u8 tc;

	if (!ice_is_vsi_valid(pi->hw, vsi_handle))
		return ICE_ERR_PARAM;

	ice_acquire_lock(&pi->sched_lock);

	/* Return success if no nodes are present across TC */
	ice_for_each_traffic_class(tc) {
		struct ice_sched_node *tc_node, *vsi_node;

		if (!ice_is_tc_ena(ena_tcmap, tc))
			continue;

		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;

		status = ice_sched_cfg_node_bw_alloc(pi->hw, vsi_node, rl_type,
						     bw_alloc[tc]);
		if (status)
			break;
		status = ice_sched_save_vsi_bw_alloc(pi, vsi_handle, tc,
						     rl_type, bw_alloc[tc]);
		if (status)
			break;
	}

	ice_release_lock(&pi->sched_lock);
	return status;
}
/**
 * ice_cfg_vsi_bw_alloc - config VSI BW alloc per TC
 * @pi: port information structure
 * @vsi_handle: software VSI handle
 * @ena_tcmap: enabled TC map
 * @rl_type: Rate limit type CIR/EIR
 * @bw_alloc: Array of BW alloc
 *
 * This function configures the BW allocation of the passed in VSI's
 * node(s) for enabled traffic class.
 */


This function configures the BW allocation of the passed in VSI's
node(s) for enabled traffic class.
This function configures the BW allocation of the passed in VSI ' s node ( s ) for enabled traffic class .
enum ice_status
ice_cfg_vsi_bw_alloc(struct ice_port_info *pi, u16 vsi_handle, u8 ena_tcmap,
		     enum ice_rl_type rl_type, u8 *bw_alloc)
{
	enum ice_status status = ICE_SUCCESS;
	u8 tc;
	if (!ice_is_vsi_valid(pi->hw, vsi_handle))
		return ICE_ERR_PARAM;
	ice_acquire_lock(&pi->sched_lock);
	ice_for_each_traffic_class(tc) {
		struct ice_sched_node *tc_node, *vsi_node;
		if (!ice_is_tc_ena(ena_tcmap, tc))
			continue;
		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;
		status = ice_sched_cfg_node_bw_alloc(pi->hw, vsi_node, rl_type,
						     bw_alloc[tc]);
		if (status)
			break;
		status = ice_sched_save_vsi_bw_alloc(pi, vsi_handle, tc,
						     rl_type, bw_alloc[tc]);
		if (status)
			break;
	}
	ice_release_lock(&pi->sched_lock);
	return status;
}
enum ice_status ice_cfg_vsi_bw_alloc ( struct ice_port_info * pi , u16 vsi_handle , u8 ena_tcmap , enum ice_rl_type rl_type , u8 * bw_alloc ) { enum ice_status status = ICE_SUCCESS ; u8 tc ; if ( ! ice_is_vsi_valid ( pi -> hw , vsi_handle ) ) return ICE_ERR_PARAM ; ice_acquire_lock ( & pi -> sched_lock ) ; ice_for_each_traffic_class ( tc ) { struct ice_sched_node * tc_node , * vsi_node ; if ( ! ice_is_tc_ena ( ena_tcmap , tc ) ) continue ; 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 ; status = ice_sched_cfg_node_bw_alloc ( pi -> hw , vsi_node , rl_type , bw_alloc [ tc ] ) ; if ( status ) break ; status = ice_sched_save_vsi_bw_alloc ( pi , vsi_handle , tc , rl_type , bw_alloc [ tc ] ) ; if ( status ) break ; } ice_release_lock ( & pi -> sched_lock ) ; return status ; }
ice_cfg_vsi_bw_alloc - config VSI BW alloc per TC
 @pi: port information structure
 @vsi_handle: software VSI handle
 @ena_tcmap: enabled TC map
 @rl_type: Rate limit type CIR/EIR
 @bw_alloc: Array of BW alloc
ice_cfg_vsi_bw_alloc - config VSI BW alloc per TC @pi : port information structure @vsi_handle : software VSI handle @ena_tcmap : enabled TC map @rl_type : Rate limit type CIR / EIR @bw_alloc : Array of BW alloc
/* Return success if no nodes are present across TC */