src/dpdk/drivers/net/ice/base/ice_sched.c
static struct ice_sched_node *
ice_sched_get_node_by_id_type(struct ice_port_info *pi, u32 id,
			      enum ice_agg_type agg_type, u8 tc)
{
	struct ice_sched_node *node = NULL;
	struct ice_sched_node *child_node;

	switch (agg_type) {
	case ICE_AGG_TYPE_VSI: {
		struct ice_vsi_ctx *vsi_ctx;
		u16 vsi_handle = (u16)id;

		if (!ice_is_vsi_valid(pi->hw, vsi_handle))
			break;
		/* Get sched_vsi_info */
		vsi_ctx = ice_get_vsi_ctx(pi->hw, vsi_handle);
		if (!vsi_ctx)
			break;
		node = vsi_ctx->sched.vsi_node[tc];
		break;
	}

	case ICE_AGG_TYPE_AGG: {
		struct ice_sched_node *tc_node;

		tc_node = ice_sched_get_tc_node(pi, tc);
		if (tc_node)
			node = ice_sched_get_agg_node(pi, tc_node, id);
		break;
	}

	case ICE_AGG_TYPE_Q:
		/* The current implementation allows single queue to modify */
		node = ice_sched_get_node(pi, id);
		break;

	case ICE_AGG_TYPE_QG:
		/* The current implementation allows single qg to modify */
		child_node = ice_sched_get_node(pi, id);
		if (!child_node)
			break;
		node = child_node->parent;
		break;

	default:
		break;
	}

	return node;
}
/**
 * ice_sched_get_node_by_id_type - get node from ID type
 * @pi: port information structure
 * @id: identifier
 * @agg_type: type of aggregator
 * @tc: traffic class
 *
 * This function returns node identified by ID of type aggregator, and
 * based on traffic class (TC). This function needs to be called with
 * the scheduler lock held.
 */
get node from ID type
@pi: port information structure
@id: identifier
@agg_type: type of aggregator
@tc: traffic class

This function returns node identified by ID of type aggregator, and
based on traffic class (TC). This function needs to be called with
the scheduler lock held.
get node from ID type @pi : port information structure @id : identifier @agg_type : type of aggregator @tc : traffic class This function returns node identified by ID of type aggregator and based on traffic class ( TC ) . This function needs to be called with the scheduler lock held .
static struct ice_sched_node *
ice_sched_get_node_by_id_type(struct ice_port_info *pi, u32 id,
			      enum ice_agg_type agg_type, u8 tc)
{
	struct ice_sched_node *node = NULL;
	struct ice_sched_node *child_node;
	switch (agg_type) {
	case ICE_AGG_TYPE_VSI: {
		struct ice_vsi_ctx *vsi_ctx;
		u16 vsi_handle = (u16)id;
		if (!ice_is_vsi_valid(pi->hw, vsi_handle))
			break;
		vsi_ctx = ice_get_vsi_ctx(pi->hw, vsi_handle);
		if (!vsi_ctx)
			break;
		node = vsi_ctx->sched.vsi_node[tc];
		break;
	}
	case ICE_AGG_TYPE_AGG: {
		struct ice_sched_node *tc_node;
		tc_node = ice_sched_get_tc_node(pi, tc);
		if (tc_node)
			node = ice_sched_get_agg_node(pi, tc_node, id);
		break;
	}
	case ICE_AGG_TYPE_Q:
		node = ice_sched_get_node(pi, id);
		break;
	case ICE_AGG_TYPE_QG:
		child_node = ice_sched_get_node(pi, id);
		if (!child_node)
			break;
		node = child_node->parent;
		break;
	default:
		break;
	}
	return node;
}
static struct ice_sched_node * ice_sched_get_node_by_id_type ( struct ice_port_info * pi , u32 id , enum ice_agg_type agg_type , u8 tc ) { struct ice_sched_node * node = NULL ; struct ice_sched_node * child_node ; switch ( agg_type ) { case ICE_AGG_TYPE_VSI : { struct ice_vsi_ctx * vsi_ctx ; u16 vsi_handle = ( u16 ) id ; if ( ! ice_is_vsi_valid ( pi -> hw , vsi_handle ) ) break ; vsi_ctx = ice_get_vsi_ctx ( pi -> hw , vsi_handle ) ; if ( ! vsi_ctx ) break ; node = vsi_ctx -> sched . vsi_node [ tc ] ; break ; } case ICE_AGG_TYPE_AGG : { struct ice_sched_node * tc_node ; tc_node = ice_sched_get_tc_node ( pi , tc ) ; if ( tc_node ) node = ice_sched_get_agg_node ( pi , tc_node , id ) ; break ; } case ICE_AGG_TYPE_Q : node = ice_sched_get_node ( pi , id ) ; break ; case ICE_AGG_TYPE_QG : child_node = ice_sched_get_node ( pi , id ) ; if ( ! child_node ) break ; node = child_node -> parent ; break ; default : break ; } return node ; }
ice_sched_get_node_by_id_type - get node from ID type
 @pi: port information structure
 @id: identifier
 @agg_type: type of aggregator
 @tc: traffic class
ice_sched_get_node_by_id_type - get node from ID type @pi : port information structure @id : identifier @agg_type : type of aggregator @tc : traffic class
/* Get sched_vsi_info */ /* The current implementation allows single queue to modify */ /* The current implementation allows single qg to modify */