src/dpdk/drivers/net/ice/base/ice_sched.c
static enum ice_status
ice_sched_set_agg_node_srl_per_tc(struct ice_port_info *pi, u32 agg_id,
				  u8 tc, u32 min_bw, u32 max_bw, u32 shared_bw)
{
	struct ice_sched_node *tc_node, *agg_node, *cfg_node;
	enum ice_rl_type rl_type = ICE_SHARED_BW;
	enum ice_status status = ICE_ERR_CFG;
	u8 layer_num;

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

	agg_node = ice_sched_get_agg_node(pi, tc_node, agg_id);
	if (!agg_node)
		return ICE_ERR_CFG;

	layer_num = ice_sched_get_rl_prof_layer(pi, rl_type,
						agg_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(agg_node, layer_num);
	if (!cfg_node)
		return ICE_ERR_CFG;

	status = ice_sched_set_save_agg_srl_node_bw(pi, agg_id, tc, cfg_node,
						    ICE_MIN_BW, min_bw);
	if (status)
		return status;

	status = ice_sched_set_save_agg_srl_node_bw(pi, agg_id, tc, cfg_node,
						    ICE_MAX_BW, max_bw);
	if (status)
		return status;

	status = ice_sched_set_save_agg_srl_node_bw(pi, agg_id, tc, cfg_node,
						    ICE_SHARED_BW, shared_bw);
	return status;
}
/**
 * ice_sched_set_agg_node_srl_per_tc - set aggregator SRL per tc
 * @pi: port information structure
 * @agg_id: aggregator ID
 * @tc: traffic class
 * @min_bw: minimum bandwidth in Kbps
 * @max_bw: maximum bandwidth in Kbps
 * @shared_bw: shared bandwidth in Kbps
 *
 * This function configures the shared rate limiter(SRL) of aggregator type
 * node for a given traffic class for aggregator matching agg_id. When BW
 * value of ICE_SCHED_DFLT_BW is passed, it removes SRL from the node. Caller
 * holds the scheduler lock.
 */


This function configures the shared rate limiter(SRL) of aggregator type
node for a given traffic class for aggregator matching agg_id. When BW
value of ICE_SCHED_DFLT_BW is passed, it removes SRL from the node. Caller
holds the scheduler lock.
This function configures the shared rate limiter ( SRL ) of aggregator type node for a given traffic class for aggregator matching agg_id . When BW value of ICE_SCHED_DFLT_BW is passed it removes SRL from the node . Caller holds the scheduler lock .
static enum ice_status
ice_sched_set_agg_node_srl_per_tc(struct ice_port_info *pi, u32 agg_id,
				  u8 tc, u32 min_bw, u32 max_bw, u32 shared_bw)
{
	struct ice_sched_node *tc_node, *agg_node, *cfg_node;
	enum ice_rl_type rl_type = ICE_SHARED_BW;
	enum ice_status status = ICE_ERR_CFG;
	u8 layer_num;
	tc_node = ice_sched_get_tc_node(pi, tc);
	if (!tc_node)
		return ICE_ERR_CFG;
	agg_node = ice_sched_get_agg_node(pi, tc_node, agg_id);
	if (!agg_node)
		return ICE_ERR_CFG;
	layer_num = ice_sched_get_rl_prof_layer(pi, rl_type,
						agg_node->tx_sched_layer);
	if (layer_num >= pi->hw->num_tx_sched_layers)
		return ICE_ERR_PARAM;
	cfg_node = ice_sched_get_srl_node(agg_node, layer_num);
	if (!cfg_node)
		return ICE_ERR_CFG;
	status = ice_sched_set_save_agg_srl_node_bw(pi, agg_id, tc, cfg_node,
						    ICE_MIN_BW, min_bw);
	if (status)
		return status;
	status = ice_sched_set_save_agg_srl_node_bw(pi, agg_id, tc, cfg_node,
						    ICE_MAX_BW, max_bw);
	if (status)
		return status;
	status = ice_sched_set_save_agg_srl_node_bw(pi, agg_id, tc, cfg_node,
						    ICE_SHARED_BW, shared_bw);
	return status;
}
static enum ice_status ice_sched_set_agg_node_srl_per_tc ( struct ice_port_info * pi , u32 agg_id , u8 tc , u32 min_bw , u32 max_bw , u32 shared_bw ) { struct ice_sched_node * tc_node , * agg_node , * cfg_node ; enum ice_rl_type rl_type = ICE_SHARED_BW ; enum ice_status status = ICE_ERR_CFG ; u8 layer_num ; tc_node = ice_sched_get_tc_node ( pi , tc ) ; if ( ! tc_node ) return ICE_ERR_CFG ; agg_node = ice_sched_get_agg_node ( pi , tc_node , agg_id ) ; if ( ! agg_node ) return ICE_ERR_CFG ; layer_num = ice_sched_get_rl_prof_layer ( pi , rl_type , agg_node -> tx_sched_layer ) ; if ( layer_num >= pi -> hw -> num_tx_sched_layers ) return ICE_ERR_PARAM ; cfg_node = ice_sched_get_srl_node ( agg_node , layer_num ) ; if ( ! cfg_node ) return ICE_ERR_CFG ; status = ice_sched_set_save_agg_srl_node_bw ( pi , agg_id , tc , cfg_node , ICE_MIN_BW , min_bw ) ; if ( status ) return status ; status = ice_sched_set_save_agg_srl_node_bw ( pi , agg_id , tc , cfg_node , ICE_MAX_BW , max_bw ) ; if ( status ) return status ; status = ice_sched_set_save_agg_srl_node_bw ( pi , agg_id , tc , cfg_node , ICE_SHARED_BW , shared_bw ) ; return status ; }
ice_sched_set_agg_node_srl_per_tc - set aggregator SRL per tc
 @pi: port information structure
 @agg_id: aggregator ID
 @tc: traffic class
 @min_bw: minimum bandwidth in Kbps
 @max_bw: maximum bandwidth in Kbps
 @shared_bw: shared bandwidth in Kbps
ice_sched_set_agg_node_srl_per_tc - set aggregator SRL per tc @pi : port information structure @agg_id : aggregator ID @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 */