src/dpdk/drivers/net/ice/base/ice_sched.c
static enum ice_status
ice_sched_set_vsi_node_srl_per_tc(struct ice_port_info *pi, u16 vsi_handle,
				  u8 tc, u32 min_bw, u32 max_bw, u32 shared_bw)
{
	struct ice_sched_node *tc_node, *vsi_node, *cfg_node;
	enum ice_status status;
	u8 layer_num;

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

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

	layer_num = ice_sched_get_rl_prof_layer(pi, ICE_SHARED_BW,
						vsi_node->tx_sched_layer);
	if (layer_num >= pi->hw->num_tx_sched_layers)
		return ICE_ERR_PARAM;

	/* SRL node may be different */
	cfg_node = ice_sched_get_srl_node(vsi_node, layer_num);
	if (!cfg_node)
		return ICE_ERR_CFG;

	status = ice_sched_set_save_vsi_srl_node_bw(pi, vsi_handle, tc,
						    cfg_node, ICE_MIN_BW,
						    min_bw);
	if (status)
		return status;

	status = ice_sched_set_save_vsi_srl_node_bw(pi, vsi_handle, tc,
						    cfg_node, ICE_MAX_BW,
						    max_bw);
	if (status)
		return status;

	return ice_sched_set_save_vsi_srl_node_bw(pi, vsi_handle, tc, cfg_node,
						  ICE_SHARED_BW, shared_bw);
}
/**
 * ice_sched_set_vsi_node_srl_per_tc - set VSI node BW shared limit for tc
 * @pi: port information structure
 * @vsi_handle: software VSI handle
 * @tc: traffic class
 * @min_bw: minimum bandwidth in Kbps
 * @max_bw: maximum bandwidth in Kbps
 * @shared_bw: shared bandwidth in Kbps
 *
 * Configure shared rate limiter(SRL) of  VSI type nodes across requested
 * traffic class for VSI matching handle. When BW value of ICE_SCHED_DFLT_BW
 * is passed, it removes the corresponding bw from the node. The caller
 * holds scheduler lock.
 */


Configure shared rate limiter(SRL) of  VSI type nodes across requested
traffic class for VSI matching handle. When BW value of ICE_SCHED_DFLT_BW
is passed, it removes the corresponding bw from the node. The caller
holds scheduler lock.
Configure shared rate limiter ( SRL ) of VSI type nodes across requested traffic class for VSI matching handle . When BW value of ICE_SCHED_DFLT_BW is passed it removes the corresponding bw from the node . The caller holds scheduler lock .
static enum ice_status
ice_sched_set_vsi_node_srl_per_tc(struct ice_port_info *pi, u16 vsi_handle,
				  u8 tc, u32 min_bw, u32 max_bw, u32 shared_bw)
{
	struct ice_sched_node *tc_node, *vsi_node, *cfg_node;
	enum ice_status status;
	u8 layer_num;
	tc_node = ice_sched_get_tc_node(pi, tc);
	if (!tc_node)
		return ICE_ERR_CFG;
	vsi_node = ice_sched_get_vsi_node(pi, tc_node, vsi_handle);
	if (!vsi_node)
		return ICE_ERR_CFG;
	layer_num = ice_sched_get_rl_prof_layer(pi, ICE_SHARED_BW,
						vsi_node->tx_sched_layer);
	if (layer_num >= pi->hw->num_tx_sched_layers)
		return ICE_ERR_PARAM;
	cfg_node = ice_sched_get_srl_node(vsi_node, layer_num);
	if (!cfg_node)
		return ICE_ERR_CFG;
	status = ice_sched_set_save_vsi_srl_node_bw(pi, vsi_handle, tc,
						    cfg_node, ICE_MIN_BW,
						    min_bw);
	if (status)
		return status;
	status = ice_sched_set_save_vsi_srl_node_bw(pi, vsi_handle, tc,
						    cfg_node, ICE_MAX_BW,
						    max_bw);
	if (status)
		return status;
	return ice_sched_set_save_vsi_srl_node_bw(pi, vsi_handle, tc, cfg_node,
						  ICE_SHARED_BW, shared_bw);
}
static enum ice_status ice_sched_set_vsi_node_srl_per_tc ( struct ice_port_info * pi , u16 vsi_handle , u8 tc , u32 min_bw , u32 max_bw , u32 shared_bw ) { struct ice_sched_node * tc_node , * vsi_node , * cfg_node ; enum ice_status status ; u8 layer_num ; tc_node = ice_sched_get_tc_node ( pi , tc ) ; if ( ! tc_node ) return ICE_ERR_CFG ; vsi_node = ice_sched_get_vsi_node ( pi , tc_node , vsi_handle ) ; if ( ! vsi_node ) return ICE_ERR_CFG ; layer_num = ice_sched_get_rl_prof_layer ( pi , ICE_SHARED_BW , vsi_node -> tx_sched_layer ) ; if ( layer_num >= pi -> hw -> num_tx_sched_layers ) return ICE_ERR_PARAM ; cfg_node = ice_sched_get_srl_node ( vsi_node , layer_num ) ; if ( ! cfg_node ) return ICE_ERR_CFG ; status = ice_sched_set_save_vsi_srl_node_bw ( pi , vsi_handle , tc , cfg_node , ICE_MIN_BW , min_bw ) ; if ( status ) return status ; status = ice_sched_set_save_vsi_srl_node_bw ( pi , vsi_handle , tc , cfg_node , ICE_MAX_BW , max_bw ) ; if ( status ) return status ; return ice_sched_set_save_vsi_srl_node_bw ( pi , vsi_handle , tc , cfg_node , ICE_SHARED_BW , shared_bw ) ; }
ice_sched_set_vsi_node_srl_per_tc - set VSI node BW shared limit for tc
 @pi: port information structure
 @vsi_handle: software VSI handle
 @tc: traffic class
 @min_bw: minimum bandwidth in Kbps
 @max_bw: maximum bandwidth in Kbps
 @shared_bw: shared bandwidth in Kbps
ice_sched_set_vsi_node_srl_per_tc - set VSI node BW shared limit for tc @pi : port information structure @vsi_handle : software VSI handle @tc : traffic class @min_bw : minimum bandwidth in Kbps @max_bw : maximum bandwidth in Kbps @shared_bw : shared bandwidth in Kbps
/* SRL node may be different */