src/dpdk/drivers/net/ice/base/ice_sched.c
static enum ice_status
ice_sched_set_node_bw(struct ice_port_info *pi, struct ice_sched_node *node,
		      enum ice_rl_type rl_type, u32 bw, u8 layer_num)
{
	struct ice_aqc_rl_profile_info *rl_prof_info;
	enum ice_status status = ICE_ERR_PARAM;
	struct ice_hw *hw = pi->hw;
	u16 old_id, rl_prof_id;

	rl_prof_info = ice_sched_add_rl_profile(hw, rl_type, bw, layer_num);
	if (!rl_prof_info)
		return status;

	rl_prof_id = LE16_TO_CPU(rl_prof_info->profile.profile_id);

	/* 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;

	/* New changes has been applied */
	/* Increment the profile ID reference count */
	rl_prof_info->prof_id_ref++;

	/* Check for old ID removal */
	if ((old_id == ICE_SCHED_DFLT_RL_PROF_ID && rl_type != ICE_SHARED_BW) ||
	    old_id == ICE_SCHED_INVAL_PROF_ID || old_id == rl_prof_id)
		return ICE_SUCCESS;

	return ice_sched_rm_rl_profile(hw, layer_num,
				       rl_prof_info->profile.flags &
				       ICE_AQC_RL_PROFILE_TYPE_M, old_id);
}
/**
 * ice_sched_set_node_bw - set node's bandwidth
 * @pi: port information structure
 * @node: tree node
 * @rl_type: rate limit type min, max, or shared
 * @bw: bandwidth in Kbps - Kilo bits per sec
 * @layer_num: layer number
 *
 * This function adds new profile corresponding to requested BW, configures
 * node's RL profile ID of type CIR, EIR, or SRL, and removes old profile
 * ID from local database. The caller needs to hold scheduler lock.
 */


This function adds new profile corresponding to requested BW, configures
node's RL profile ID of type CIR, EIR, or SRL, and removes old profile
ID from local database. The caller needs to hold scheduler lock.
This function adds new profile corresponding to requested BW configures node ' s RL profile ID of type CIR EIR or SRL and removes old profile ID from local database . The caller needs to hold scheduler lock .
static enum ice_status
ice_sched_set_node_bw(struct ice_port_info *pi, struct ice_sched_node *node,
		      enum ice_rl_type rl_type, u32 bw, u8 layer_num)
{
	struct ice_aqc_rl_profile_info *rl_prof_info;
	enum ice_status status = ICE_ERR_PARAM;
	struct ice_hw *hw = pi->hw;
	u16 old_id, rl_prof_id;
	rl_prof_info = ice_sched_add_rl_profile(hw, rl_type, bw, layer_num);
	if (!rl_prof_info)
		return status;
	rl_prof_id = LE16_TO_CPU(rl_prof_info->profile.profile_id);
	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;
	rl_prof_info->prof_id_ref++;
	if ((old_id == ICE_SCHED_DFLT_RL_PROF_ID && rl_type != ICE_SHARED_BW) ||
	    old_id == ICE_SCHED_INVAL_PROF_ID || old_id == rl_prof_id)
		return ICE_SUCCESS;
	return ice_sched_rm_rl_profile(hw, layer_num,
				       rl_prof_info->profile.flags &
				       ICE_AQC_RL_PROFILE_TYPE_M, old_id);
}
static enum ice_status ice_sched_set_node_bw ( struct ice_port_info * pi , struct ice_sched_node * node , enum ice_rl_type rl_type , u32 bw , u8 layer_num ) { struct ice_aqc_rl_profile_info * rl_prof_info ; enum ice_status status = ICE_ERR_PARAM ; struct ice_hw * hw = pi -> hw ; u16 old_id , rl_prof_id ; rl_prof_info = ice_sched_add_rl_profile ( hw , rl_type , bw , layer_num ) ; if ( ! rl_prof_info ) return status ; rl_prof_id = LE16_TO_CPU ( rl_prof_info -> profile . profile_id ) ; 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 ; rl_prof_info -> prof_id_ref ++ ; if ( ( old_id == ICE_SCHED_DFLT_RL_PROF_ID && rl_type != ICE_SHARED_BW ) || old_id == ICE_SCHED_INVAL_PROF_ID || old_id == rl_prof_id ) return ICE_SUCCESS ; return ice_sched_rm_rl_profile ( hw , layer_num , rl_prof_info -> profile . flags & ICE_AQC_RL_PROFILE_TYPE_M , old_id ) ; }
ice_sched_set_node_bw - set node's bandwidth
 @pi: port information structure
 @node: tree node
 @rl_type: rate limit type min, max, or shared
 @bw: bandwidth in Kbps - Kilo bits per sec
 @layer_num: layer number
ice_sched_set_node_bw - set node ' s bandwidth @pi : port information structure @node : tree node @rl_type : rate limit type min max or shared @bw : bandwidth in Kbps - Kilo bits per sec @layer_num : layer number
/* Save existing RL prof ID for later clean up */ /* Configure BW scheduling parameters */ /* New changes has been applied */ /* Increment the profile ID reference count */ /* Check for old ID removal */