src/dpdk/drivers/net/ice/base/ice_sched.c
enum ice_status
ice_sched_set_vsi_bw_shared_lmt(struct ice_port_info *pi, u16 vsi_handle,
				u32 min_bw, u32 max_bw, u32 shared_bw)
{
	enum ice_status status = ICE_SUCCESS;
	u8 tc;

	if (!pi)
		return ICE_ERR_PARAM;

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

	ice_acquire_lock(&pi->sched_lock);
	status = ice_sched_validate_vsi_srl_node(pi, vsi_handle);
	if (status)
		goto exit_set_vsi_bw_shared_lmt;
	/* Return success if no nodes are present across TC */
	ice_for_each_traffic_class(tc) {
		struct ice_sched_node *tc_node, *vsi_node;

		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_set_vsi_node_srl_per_tc(pi, vsi_handle, tc,
							   min_bw, max_bw,
							   shared_bw);
		if (status)
			break;
	}

exit_set_vsi_bw_shared_lmt:
	ice_release_lock(&pi->sched_lock);
	return status;
}
/**
 * ice_sched_set_vsi_bw_shared_lmt - set VSI BW shared limit
 * @pi: port information structure
 * @vsi_handle: software VSI handle
 * @min_bw: minimum bandwidth in Kbps
 * @max_bw: maximum bandwidth in Kbps
 * @shared_bw: shared bandwidth in Kbps
 *
 * Configure shared rate limiter(SRL) of all VSI type nodes across all traffic
 * classes for VSI matching handle. When BW value of ICE_SCHED_DFLT_BW is
 * passed, it removes those value(s) from the node.
 */


Configure shared rate limiter(SRL) of all VSI type nodes across all traffic
classes for VSI matching handle. When BW value of ICE_SCHED_DFLT_BW is
passed, it removes those value(s) from the node.
Configure shared rate limiter ( SRL ) of all VSI type nodes across all traffic classes for VSI matching handle . When BW value of ICE_SCHED_DFLT_BW is passed it removes those value ( s ) from the node .
enum ice_status
ice_sched_set_vsi_bw_shared_lmt(struct ice_port_info *pi, u16 vsi_handle,
				u32 min_bw, u32 max_bw, u32 shared_bw)
{
	enum ice_status status = ICE_SUCCESS;
	u8 tc;
	if (!pi)
		return ICE_ERR_PARAM;
	if (!ice_is_vsi_valid(pi->hw, vsi_handle))
		return ICE_ERR_PARAM;
	ice_acquire_lock(&pi->sched_lock);
	status = ice_sched_validate_vsi_srl_node(pi, vsi_handle);
	if (status)
		goto exit_set_vsi_bw_shared_lmt;
	ice_for_each_traffic_class(tc) {
		struct ice_sched_node *tc_node, *vsi_node;
		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_set_vsi_node_srl_per_tc(pi, vsi_handle, tc,
							   min_bw, max_bw,
							   shared_bw);
		if (status)
			break;
	}
exit_set_vsi_bw_shared_lmt:
	ice_release_lock(&pi->sched_lock);
	return status;
}
enum ice_status ice_sched_set_vsi_bw_shared_lmt ( struct ice_port_info * pi , u16 vsi_handle , u32 min_bw , u32 max_bw , u32 shared_bw ) { enum ice_status status = ICE_SUCCESS ; u8 tc ; if ( ! pi ) return ICE_ERR_PARAM ; if ( ! ice_is_vsi_valid ( pi -> hw , vsi_handle ) ) return ICE_ERR_PARAM ; ice_acquire_lock ( & pi -> sched_lock ) ; status = ice_sched_validate_vsi_srl_node ( pi , vsi_handle ) ; if ( status ) goto exit_set_vsi_bw_shared_lmt ; ice_for_each_traffic_class ( tc ) { struct ice_sched_node * tc_node , * vsi_node ; 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_set_vsi_node_srl_per_tc ( pi , vsi_handle , tc , min_bw , max_bw , shared_bw ) ; if ( status ) break ; } exit_set_vsi_bw_shared_lmt : ice_release_lock ( & pi -> sched_lock ) ; return status ; }
ice_sched_set_vsi_bw_shared_lmt - set VSI BW shared limit
 @pi: port information structure
 @vsi_handle: software VSI handle
 @min_bw: minimum bandwidth in Kbps
 @max_bw: maximum bandwidth in Kbps
 @shared_bw: shared bandwidth in Kbps
ice_sched_set_vsi_bw_shared_lmt - set VSI BW shared limit @pi : port information structure @vsi_handle : software VSI handle @min_bw : minimum bandwidth in Kbps @max_bw : maximum bandwidth in Kbps @shared_bw : shared bandwidth in Kbps
/* Return success if no nodes are present across TC */