src/dpdk/drivers/net/ice/base/ice_sched.c
enum ice_status
ice_sched_set_node_bw_lmt_per_tc(struct ice_port_info *pi, u32 id,
				 enum ice_agg_type agg_type, u8 tc,
				 enum ice_rl_type rl_type, u32 bw)
{
	enum ice_status status = ICE_ERR_PARAM;
	struct ice_sched_node *node;

	if (!pi)
		return status;

	if (rl_type == ICE_UNKNOWN_BW)
		return status;

	ice_acquire_lock(&pi->sched_lock);
	node = ice_sched_get_node_by_id_type(pi, id, agg_type, tc);
	if (!node) {
		ice_debug(pi->hw, ICE_DBG_SCHED, "Wrong id, agg type, or tc\n");
		goto exit_set_node_bw_lmt_per_tc;
	}
	if (bw == ICE_SCHED_DFLT_BW)
		status = ice_sched_set_node_bw_dflt_lmt(pi, node, rl_type);
	else
		status = ice_sched_set_node_bw_lmt(pi, node, rl_type, bw);

exit_set_node_bw_lmt_per_tc:
	ice_release_lock(&pi->sched_lock);
	return status;
}
/**
 * ice_sched_set_node_bw_lmt_per_tc - set node BW limit per TC
 * @pi: port information structure
 * @id: ID (software VSI handle or AGG ID)
 * @agg_type: aggregator type (VSI or AGG type node)
 * @tc: traffic class
 * @rl_type: min or max
 * @bw: bandwidth in Kbps
 *
 * This function sets BW limit of VSI or Aggregator scheduling node
 * based on TC information from passed in argument BW.
 */


This function sets BW limit of VSI or Aggregator scheduling node
based on TC information from passed in argument BW.
This function sets BW limit of VSI or Aggregator scheduling node based on TC information from passed in argument BW .
enum ice_status
ice_sched_set_node_bw_lmt_per_tc(struct ice_port_info *pi, u32 id,
				 enum ice_agg_type agg_type, u8 tc,
				 enum ice_rl_type rl_type, u32 bw)
{
	enum ice_status status = ICE_ERR_PARAM;
	struct ice_sched_node *node;
	if (!pi)
		return status;
	if (rl_type == ICE_UNKNOWN_BW)
		return status;
	ice_acquire_lock(&pi->sched_lock);
	node = ice_sched_get_node_by_id_type(pi, id, agg_type, tc);
	if (!node) {
		ice_debug(pi->hw, ICE_DBG_SCHED, "Wrong id, agg type, or tc\n");
		goto exit_set_node_bw_lmt_per_tc;
	}
	if (bw == ICE_SCHED_DFLT_BW)
		status = ice_sched_set_node_bw_dflt_lmt(pi, node, rl_type);
	else
		status = ice_sched_set_node_bw_lmt(pi, node, rl_type, bw);
exit_set_node_bw_lmt_per_tc:
	ice_release_lock(&pi->sched_lock);
	return status;
}
enum ice_status ice_sched_set_node_bw_lmt_per_tc ( struct ice_port_info * pi , u32 id , enum ice_agg_type agg_type , u8 tc , enum ice_rl_type rl_type , u32 bw ) { enum ice_status status = ICE_ERR_PARAM ; struct ice_sched_node * node ; if ( ! pi ) return status ; if ( rl_type == ICE_UNKNOWN_BW ) return status ; ice_acquire_lock ( & pi -> sched_lock ) ; node = ice_sched_get_node_by_id_type ( pi , id , agg_type , tc ) ; if ( ! node ) { ice_debug ( pi -> hw , ICE_DBG_SCHED , " \n " ) ; goto exit_set_node_bw_lmt_per_tc ; } if ( bw == ICE_SCHED_DFLT_BW ) status = ice_sched_set_node_bw_dflt_lmt ( pi , node , rl_type ) ; else status = ice_sched_set_node_bw_lmt ( pi , node , rl_type , bw ) ; exit_set_node_bw_lmt_per_tc : ice_release_lock ( & pi -> sched_lock ) ; return status ; }
ice_sched_set_node_bw_lmt_per_tc - set node BW limit per TC
 @pi: port information structure
 @id: ID (software VSI handle or AGG ID)
 @agg_type: aggregator type (VSI or AGG type node)
 @tc: traffic class
 @rl_type: min or max
 @bw: bandwidth in Kbps
ice_sched_set_node_bw_lmt_per_tc - set node BW limit per TC @pi : port information structure @id : ID ( software VSI handle or AGG ID ) @agg_type : aggregator type ( VSI or AGG type node ) @tc : traffic class @rl_type : min or max @bw : bandwidth in Kbps