src/dpdk/drivers/net/ice/base/ice_sched.c
static enum ice_status
ice_sched_set_node_bw_dflt(struct ice_port_info *pi,
			   struct ice_sched_node *node,
			   enum ice_rl_type rl_type, u8 layer_num)
{
	enum ice_status status;
	struct ice_hw *hw;
	u8 profile_type;
	u16 rl_prof_id;
	u16 old_id;

	hw = pi->hw;
	switch (rl_type) {
	case ICE_MIN_BW:
		profile_type = ICE_AQC_RL_PROFILE_TYPE_CIR;
		rl_prof_id = ICE_SCHED_DFLT_RL_PROF_ID;
		break;
	case ICE_MAX_BW:
		profile_type = ICE_AQC_RL_PROFILE_TYPE_EIR;
		rl_prof_id = ICE_SCHED_DFLT_RL_PROF_ID;
		break;
	case ICE_SHARED_BW:
		profile_type = ICE_AQC_RL_PROFILE_TYPE_SRL;
		/* No SRL is configured for default case */
		rl_prof_id = ICE_SCHED_NO_SHARED_RL_PROF_ID;
		break;
	default:
		return ICE_ERR_PARAM;
	}
	/* Save existing RL prof ID for later clean up */
	old_id = ice_sched_get_node_rl_prof_id(node, rl_type);
	/* Configure BW scheduling parameters */
	status = ice_sched_cfg_node_bw_lmt(hw, node, rl_type, rl_prof_id);
	if (status)
		return status;

	/* Remove stale RL profile ID */
	if (old_id == ICE_SCHED_DFLT_RL_PROF_ID ||
	    old_id == ICE_SCHED_INVAL_PROF_ID)
		return ICE_SUCCESS;

	return ice_sched_rm_rl_profile(hw, layer_num, profile_type, old_id);
}
/**
 * ice_sched_set_node_bw_dflt - set node's bandwidth limit to default
 * @pi: port information structure
 * @node: pointer to node structure
 * @rl_type: rate limit type min, max, or shared
 * @layer_num: layer number where RL profiles are saved
 *
 * This function configures node element's BW rate limit profile ID of
 * type CIR, EIR, or SRL to default. This function needs to be called
 * with the scheduler lock held.
 */
set node's bandwidth limit to default
@pi: port information structure
@node: pointer to node structure
@rl_type: rate limit type min, max, or shared
@layer_num: layer number where RL profiles are saved

This function configures node element's BW rate limit profile ID of
type CIR, EIR, or SRL to default. This function needs to be called
with the scheduler lock held.
set node ' s bandwidth limit to default @pi : port information structure @node : pointer to node structure @rl_type : rate limit type min max or shared @layer_num : layer number where RL profiles are saved This function configures node element ' s BW rate limit profile ID of type CIR EIR or SRL to default . This function needs to be called with the scheduler lock held .
static enum ice_status
ice_sched_set_node_bw_dflt(struct ice_port_info *pi,
			   struct ice_sched_node *node,
			   enum ice_rl_type rl_type, u8 layer_num)
{
	enum ice_status status;
	struct ice_hw *hw;
	u8 profile_type;
	u16 rl_prof_id;
	u16 old_id;
	hw = pi->hw;
	switch (rl_type) {
	case ICE_MIN_BW:
		profile_type = ICE_AQC_RL_PROFILE_TYPE_CIR;
		rl_prof_id = ICE_SCHED_DFLT_RL_PROF_ID;
		break;
	case ICE_MAX_BW:
		profile_type = ICE_AQC_RL_PROFILE_TYPE_EIR;
		rl_prof_id = ICE_SCHED_DFLT_RL_PROF_ID;
		break;
	case ICE_SHARED_BW:
		profile_type = ICE_AQC_RL_PROFILE_TYPE_SRL;
		rl_prof_id = ICE_SCHED_NO_SHARED_RL_PROF_ID;
		break;
	default:
		return ICE_ERR_PARAM;
	}
	old_id = ice_sched_get_node_rl_prof_id(node, rl_type);
	status = ice_sched_cfg_node_bw_lmt(hw, node, rl_type, rl_prof_id);
	if (status)
		return status;
	if (old_id == ICE_SCHED_DFLT_RL_PROF_ID ||
	    old_id == ICE_SCHED_INVAL_PROF_ID)
		return ICE_SUCCESS;
	return ice_sched_rm_rl_profile(hw, layer_num, profile_type, old_id);
}
static enum ice_status ice_sched_set_node_bw_dflt ( struct ice_port_info * pi , struct ice_sched_node * node , enum ice_rl_type rl_type , u8 layer_num ) { enum ice_status status ; struct ice_hw * hw ; u8 profile_type ; u16 rl_prof_id ; u16 old_id ; hw = pi -> hw ; switch ( rl_type ) { case ICE_MIN_BW : profile_type = ICE_AQC_RL_PROFILE_TYPE_CIR ; rl_prof_id = ICE_SCHED_DFLT_RL_PROF_ID ; break ; case ICE_MAX_BW : profile_type = ICE_AQC_RL_PROFILE_TYPE_EIR ; rl_prof_id = ICE_SCHED_DFLT_RL_PROF_ID ; break ; case ICE_SHARED_BW : profile_type = ICE_AQC_RL_PROFILE_TYPE_SRL ; rl_prof_id = ICE_SCHED_NO_SHARED_RL_PROF_ID ; break ; default : return ICE_ERR_PARAM ; } old_id = ice_sched_get_node_rl_prof_id ( node , rl_type ) ; status = ice_sched_cfg_node_bw_lmt ( hw , node , rl_type , rl_prof_id ) ; if ( status ) return status ; if ( old_id == ICE_SCHED_DFLT_RL_PROF_ID || old_id == ICE_SCHED_INVAL_PROF_ID ) return ICE_SUCCESS ; return ice_sched_rm_rl_profile ( hw , layer_num , profile_type , old_id ) ; }
ice_sched_set_node_bw_dflt - set node's bandwidth limit to default
 @pi: port information structure
 @node: pointer to node structure
 @rl_type: rate limit type min, max, or shared
 @layer_num: layer number where RL profiles are saved
ice_sched_set_node_bw_dflt - set node ' s bandwidth limit to default @pi : port information structure @node : pointer to node structure @rl_type : rate limit type min max or shared @layer_num : layer number where RL profiles are saved
/* No SRL is configured for default case */ /* Save existing RL prof ID for later clean up */ /* Configure BW scheduling parameters */ /* Remove stale RL profile ID */