src/dpdk/drivers/net/ice/base/ice_sched.c
static enum ice_status
ice_sched_update_vsi_child_nodes(struct ice_port_info *pi, u16 vsi_handle,
				 u8 tc, u16 new_numqs, u8 owner)
{
	u16 new_num_nodes[ICE_AQC_TOPO_MAX_LEVEL_NUM] = { 0 };
	struct ice_sched_node *vsi_node;
	struct ice_sched_node *tc_node;
	struct ice_vsi_ctx *vsi_ctx;
	enum ice_status status = ICE_SUCCESS;
	struct ice_hw *hw = pi->hw;
	u16 prev_numqs;

	tc_node = ice_sched_get_tc_node(pi, tc);
	if (!tc_node)
		return ICE_ERR_CFG;

	vsi_node = ice_sched_get_vsi_node(pi, tc_node, vsi_handle);
	if (!vsi_node)
		return ICE_ERR_CFG;

	vsi_ctx = ice_get_vsi_ctx(hw, vsi_handle);
	if (!vsi_ctx)
		return ICE_ERR_PARAM;

	prev_numqs = vsi_ctx->sched.max_lanq[tc];
	/* num queues are not changed or less than the previous number */
	if (new_numqs <= prev_numqs)
		return status;
	status = ice_alloc_lan_q_ctx(hw, vsi_handle, tc, new_numqs);
	if (status)
		return status;

	if (new_numqs)
		ice_sched_calc_vsi_child_nodes(hw, new_numqs, new_num_nodes);
	/* Keep the max number of queue configuration all the time. Update the
	 * tree only if number of queues > previous number of queues. This may
	 * leave some extra nodes in the tree if number of queues < previous
	 * number but that wouldn't harm anything. Removing those extra nodes
	 * may complicate the code if those nodes are part of SRL or
	 * individually rate limited.
	 */
	status = ice_sched_add_vsi_child_nodes(pi, vsi_handle, tc_node,
					       new_num_nodes, owner);
	if (status)
		return status;
	vsi_ctx->sched.max_lanq[tc] = new_numqs;

	return ICE_SUCCESS;
}
/**
 * ice_sched_update_vsi_child_nodes - update VSI child nodes
 * @pi: port information structure
 * @vsi_handle: software VSI handle
 * @tc: TC number
 * @new_numqs: new number of max queues
 * @owner: owner of this subtree
 *
 * This function updates the VSI child nodes based on the number of queues
 */


This function updates the VSI child nodes based on the number of queues
This function updates the VSI child nodes based on the number of queues
static enum ice_status
ice_sched_update_vsi_child_nodes(struct ice_port_info *pi, u16 vsi_handle,
				 u8 tc, u16 new_numqs, u8 owner)
{
	u16 new_num_nodes[ICE_AQC_TOPO_MAX_LEVEL_NUM] = { 0 };
	struct ice_sched_node *vsi_node;
	struct ice_sched_node *tc_node;
	struct ice_vsi_ctx *vsi_ctx;
	enum ice_status status = ICE_SUCCESS;
	struct ice_hw *hw = pi->hw;
	u16 prev_numqs;
	tc_node = ice_sched_get_tc_node(pi, tc);
	if (!tc_node)
		return ICE_ERR_CFG;
	vsi_node = ice_sched_get_vsi_node(pi, tc_node, vsi_handle);
	if (!vsi_node)
		return ICE_ERR_CFG;
	vsi_ctx = ice_get_vsi_ctx(hw, vsi_handle);
	if (!vsi_ctx)
		return ICE_ERR_PARAM;
	prev_numqs = vsi_ctx->sched.max_lanq[tc];
	if (new_numqs <= prev_numqs)
		return status;
	status = ice_alloc_lan_q_ctx(hw, vsi_handle, tc, new_numqs);
	if (status)
		return status;
	if (new_numqs)
		ice_sched_calc_vsi_child_nodes(hw, new_numqs, new_num_nodes);
	status = ice_sched_add_vsi_child_nodes(pi, vsi_handle, tc_node,
					       new_num_nodes, owner);
	if (status)
		return status;
	vsi_ctx->sched.max_lanq[tc] = new_numqs;
	return ICE_SUCCESS;
}
static enum ice_status ice_sched_update_vsi_child_nodes ( struct ice_port_info * pi , u16 vsi_handle , u8 tc , u16 new_numqs , u8 owner ) { u16 new_num_nodes [ ICE_AQC_TOPO_MAX_LEVEL_NUM ] = { 0 } ; struct ice_sched_node * vsi_node ; struct ice_sched_node * tc_node ; struct ice_vsi_ctx * vsi_ctx ; enum ice_status status = ICE_SUCCESS ; struct ice_hw * hw = pi -> hw ; u16 prev_numqs ; tc_node = ice_sched_get_tc_node ( pi , tc ) ; if ( ! tc_node ) return ICE_ERR_CFG ; vsi_node = ice_sched_get_vsi_node ( pi , tc_node , vsi_handle ) ; if ( ! vsi_node ) return ICE_ERR_CFG ; vsi_ctx = ice_get_vsi_ctx ( hw , vsi_handle ) ; if ( ! vsi_ctx ) return ICE_ERR_PARAM ; prev_numqs = vsi_ctx -> sched . max_lanq [ tc ] ; if ( new_numqs <= prev_numqs ) return status ; status = ice_alloc_lan_q_ctx ( hw , vsi_handle , tc , new_numqs ) ; if ( status ) return status ; if ( new_numqs ) ice_sched_calc_vsi_child_nodes ( hw , new_numqs , new_num_nodes ) ; status = ice_sched_add_vsi_child_nodes ( pi , vsi_handle , tc_node , new_num_nodes , owner ) ; if ( status ) return status ; vsi_ctx -> sched . max_lanq [ tc ] = new_numqs ; return ICE_SUCCESS ; }
ice_sched_update_vsi_child_nodes - update VSI child nodes
 @pi: port information structure
 @vsi_handle: software VSI handle
 @tc: TC number
 @new_numqs: new number of max queues
 @owner: owner of this subtree
ice_sched_update_vsi_child_nodes - update VSI child nodes @pi : port information structure @vsi_handle : software VSI handle @tc : TC number @new_numqs : new number of max queues @owner : owner of this subtree
/* num queues are not changed or less than the previous number */ /* Keep the max number of queue configuration all the time. Update the
	 * tree only if number of queues > previous number of queues. This may
	 * leave some extra nodes in the tree if number of queues < previous
	 * number but that wouldn't harm anything. Removing those extra nodes
	 * may complicate the code if those nodes are part of SRL or
	 * individually rate limited.
	 */