src/dpdk/drivers/net/ice/base/ice_sched.c
static enum ice_status
ice_sched_cfg_agg(struct ice_port_info *pi, u32 agg_id,
		  enum ice_agg_type agg_type, ice_bitmap_t *tc_bitmap)
{
	struct ice_sched_agg_info *agg_info;
	enum ice_status status = ICE_SUCCESS;
	struct ice_hw *hw = pi->hw;
	u8 tc;

	agg_info = ice_get_agg_info(hw, agg_id);
	if (!agg_info) {
		/* Create new entry for new aggregator ID */
		agg_info = (struct ice_sched_agg_info *)
			ice_malloc(hw, sizeof(*agg_info));
		if (!agg_info)
			return ICE_ERR_NO_MEMORY;

		agg_info->agg_id = agg_id;
		agg_info->agg_type = agg_type;
		agg_info->tc_bitmap[0] = 0;

		/* Initialize the aggregator VSI list head */
		INIT_LIST_HEAD(&agg_info->agg_vsi_list);

		/* Add new entry in aggregator list */
		LIST_ADD(&agg_info->list_entry, &hw->agg_list);
	}
	/* Create aggregator node(s) for requested TC(s) */
	ice_for_each_traffic_class(tc) {
		if (!ice_is_tc_ena(*tc_bitmap, tc)) {
			/* Delete aggregator cfg TC if it exists previously */
			status = ice_rm_agg_cfg_tc(pi, agg_info, tc, false);
			if (status)
				break;
			continue;
		}

		/* Check if aggregator node for TC already exists */
		if (ice_is_tc_ena(agg_info->tc_bitmap[0], tc))
			continue;

		/* Create new aggregator node for TC */
		status = ice_sched_add_agg_cfg(pi, agg_id, tc);
		if (status)
			break;

		/* Save aggregator node's TC information */
		ice_set_bit(tc, agg_info->tc_bitmap);
	}

	return status;
}
/**
 * ice_sched_cfg_agg - configure aggregator node
 * @pi: port information structure
 * @agg_id: aggregator ID
 * @agg_type: aggregator type queue, VSI, or aggregator group
 * @tc_bitmap: bits TC bitmap
 *
 * It registers a unique aggregator node into scheduler services. It
 * allows a user to register with a unique ID to track it's resources.
 * The aggregator type determines if this is a queue group, VSI group
 * or aggregator group. It then creates the aggregator node(s) for requested
 * TC(s) or removes an existing aggregator node including its configuration
 * if indicated via tc_bitmap. Call ice_rm_agg_cfg to release aggregator
 * resources and remove aggregator ID.
 * This function needs to be called with scheduler lock held.
 */
configure aggregator node
@pi: port information structure
@agg_id: aggregator ID
@agg_type: aggregator type queue, VSI, or aggregator group
@tc_bitmap: bits TC bitmap

It registers a unique aggregator node into scheduler services. It
allows a user to register with a unique ID to track it's resources.
The aggregator type determines if this is a queue group, VSI group
or aggregator group. It then creates the aggregator node(s) for requested
TC(s) or removes an existing aggregator node including its configuration
if indicated via tc_bitmap. Call ice_rm_agg_cfg to release aggregator
resources and remove aggregator ID.
This function needs to be called with scheduler lock held.
configure aggregator node @pi : port information structure @agg_id : aggregator ID @agg_type : aggregator type queue VSI or aggregator group @tc_bitmap : bits TC bitmap It registers a unique aggregator node into scheduler services . It allows a user to register with a unique ID to track it ' s resources . The aggregator type determines if this is a queue group VSI group or aggregator group . It then creates the aggregator node ( s ) for requested TC ( s ) or removes an existing aggregator node including its configuration if indicated via tc_bitmap . Call ice_rm_agg_cfg to release aggregator resources and remove aggregator ID . This function needs to be called with scheduler lock held .
static enum ice_status
ice_sched_cfg_agg(struct ice_port_info *pi, u32 agg_id,
		  enum ice_agg_type agg_type, ice_bitmap_t *tc_bitmap)
{
	struct ice_sched_agg_info *agg_info;
	enum ice_status status = ICE_SUCCESS;
	struct ice_hw *hw = pi->hw;
	u8 tc;
	agg_info = ice_get_agg_info(hw, agg_id);
	if (!agg_info) {
		agg_info = (struct ice_sched_agg_info *)
			ice_malloc(hw, sizeof(*agg_info));
		if (!agg_info)
			return ICE_ERR_NO_MEMORY;
		agg_info->agg_id = agg_id;
		agg_info->agg_type = agg_type;
		agg_info->tc_bitmap[0] = 0;
		INIT_LIST_HEAD(&agg_info->agg_vsi_list);
		LIST_ADD(&agg_info->list_entry, &hw->agg_list);
	}
	ice_for_each_traffic_class(tc) {
		if (!ice_is_tc_ena(*tc_bitmap, tc)) {
			status = ice_rm_agg_cfg_tc(pi, agg_info, tc, false);
			if (status)
				break;
			continue;
		}
		if (ice_is_tc_ena(agg_info->tc_bitmap[0], tc))
			continue;
		status = ice_sched_add_agg_cfg(pi, agg_id, tc);
		if (status)
			break;
		ice_set_bit(tc, agg_info->tc_bitmap);
	}
	return status;
}
static enum ice_status ice_sched_cfg_agg ( struct ice_port_info * pi , u32 agg_id , enum ice_agg_type agg_type , ice_bitmap_t * tc_bitmap ) { struct ice_sched_agg_info * agg_info ; enum ice_status status = ICE_SUCCESS ; struct ice_hw * hw = pi -> hw ; u8 tc ; agg_info = ice_get_agg_info ( hw , agg_id ) ; if ( ! agg_info ) { agg_info = ( struct ice_sched_agg_info * ) ice_malloc ( hw , sizeof ( * agg_info ) ) ; if ( ! agg_info ) return ICE_ERR_NO_MEMORY ; agg_info -> agg_id = agg_id ; agg_info -> agg_type = agg_type ; agg_info -> tc_bitmap [ 0 ] = 0 ; INIT_LIST_HEAD ( & agg_info -> agg_vsi_list ) ; LIST_ADD ( & agg_info -> list_entry , & hw -> agg_list ) ; } ice_for_each_traffic_class ( tc ) { if ( ! ice_is_tc_ena ( * tc_bitmap , tc ) ) { status = ice_rm_agg_cfg_tc ( pi , agg_info , tc , false ) ; if ( status ) break ; continue ; } if ( ice_is_tc_ena ( agg_info -> tc_bitmap [ 0 ] , tc ) ) continue ; status = ice_sched_add_agg_cfg ( pi , agg_id , tc ) ; if ( status ) break ; ice_set_bit ( tc , agg_info -> tc_bitmap ) ; } return status ; }
ice_sched_cfg_agg - configure aggregator node
 @pi: port information structure
 @agg_id: aggregator ID
 @agg_type: aggregator type queue, VSI, or aggregator group
 @tc_bitmap: bits TC bitmap
ice_sched_cfg_agg - configure aggregator node @pi : port information structure @agg_id : aggregator ID @agg_type : aggregator type queue VSI or aggregator group @tc_bitmap : bits TC bitmap
/* Create new entry for new aggregator ID */ /* Initialize the aggregator VSI list head */ /* Add new entry in aggregator list */ /* Create aggregator node(s) for requested TC(s) */ /* Delete aggregator cfg TC if it exists previously */ /* Check if aggregator node for TC already exists */ /* Create new aggregator node for TC */ /* Save aggregator node's TC information */