src/dpdk/drivers/net/ice/base/ice_sched.c
static enum ice_status
ice_sched_add_vsi_child_nodes(struct ice_port_info *pi, u16 vsi_handle,
			      struct ice_sched_node *tc_node, u16 *num_nodes,
			      u8 owner)
{
	struct ice_sched_node *parent, *node;
	struct ice_hw *hw = pi->hw;
	enum ice_status status;
	u32 first_node_teid;
	u16 num_added = 0;
	u8 i, qgl, vsil;

	qgl = ice_sched_get_qgrp_layer(hw);
	vsil = ice_sched_get_vsi_layer(hw);
	parent = ice_sched_get_vsi_node(pi, tc_node, vsi_handle);
	for (i = vsil + 1; i <= qgl; i++) {
		if (!parent)
			return ICE_ERR_CFG;

		status = ice_sched_add_nodes_to_layer(pi, tc_node, parent, i,
						      num_nodes[i],
						      &first_node_teid,
						      &num_added);
		if (status != ICE_SUCCESS || num_nodes[i] != num_added)
			return ICE_ERR_CFG;

		/* The newly added node can be a new parent for the next
		 * layer nodes
		 */
		if (num_added) {
			parent = ice_sched_find_node_by_teid(tc_node,
							     first_node_teid);
			node = parent;
			while (node) {
				node->owner = owner;
				node = node->sibling;
			}
		} else {
			parent = parent->children[0];
		}
	}

	return ICE_SUCCESS;
}
/**
 * ice_sched_add_vsi_child_nodes - add VSI child nodes to tree
 * @pi: port information structure
 * @vsi_handle: software VSI handle
 * @tc_node: pointer to the TC node
 * @num_nodes: pointer to the num nodes that needs to be added per layer
 * @owner: node owner (LAN or RDMA)
 *
 * This function adds the VSI child nodes to tree. It gets called for
 * LAN and RDMA separately.
 */


This function adds the VSI child nodes to tree. It gets called for
LAN and RDMA separately.
This function adds the VSI child nodes to tree . It gets called for LAN and RDMA separately .
static enum ice_status
ice_sched_add_vsi_child_nodes(struct ice_port_info *pi, u16 vsi_handle,
			      struct ice_sched_node *tc_node, u16 *num_nodes,
			      u8 owner)
{
	struct ice_sched_node *parent, *node;
	struct ice_hw *hw = pi->hw;
	enum ice_status status;
	u32 first_node_teid;
	u16 num_added = 0;
	u8 i, qgl, vsil;
	qgl = ice_sched_get_qgrp_layer(hw);
	vsil = ice_sched_get_vsi_layer(hw);
	parent = ice_sched_get_vsi_node(pi, tc_node, vsi_handle);
	for (i = vsil + 1; i <= qgl; i++) {
		if (!parent)
			return ICE_ERR_CFG;
		status = ice_sched_add_nodes_to_layer(pi, tc_node, parent, i,
						      num_nodes[i],
						      &first_node_teid,
						      &num_added);
		if (status != ICE_SUCCESS || num_nodes[i] != num_added)
			return ICE_ERR_CFG;
		if (num_added) {
			parent = ice_sched_find_node_by_teid(tc_node,
							     first_node_teid);
			node = parent;
			while (node) {
				node->owner = owner;
				node = node->sibling;
			}
		} else {
			parent = parent->children[0];
		}
	}
	return ICE_SUCCESS;
}
static enum ice_status ice_sched_add_vsi_child_nodes ( struct ice_port_info * pi , u16 vsi_handle , struct ice_sched_node * tc_node , u16 * num_nodes , u8 owner ) { struct ice_sched_node * parent , * node ; struct ice_hw * hw = pi -> hw ; enum ice_status status ; u32 first_node_teid ; u16 num_added = 0 ; u8 i , qgl , vsil ; qgl = ice_sched_get_qgrp_layer ( hw ) ; vsil = ice_sched_get_vsi_layer ( hw ) ; parent = ice_sched_get_vsi_node ( pi , tc_node , vsi_handle ) ; for ( i = vsil + 1 ; i <= qgl ; i ++ ) { if ( ! parent ) return ICE_ERR_CFG ; status = ice_sched_add_nodes_to_layer ( pi , tc_node , parent , i , num_nodes [ i ] , & first_node_teid , & num_added ) ; if ( status != ICE_SUCCESS || num_nodes [ i ] != num_added ) return ICE_ERR_CFG ; if ( num_added ) { parent = ice_sched_find_node_by_teid ( tc_node , first_node_teid ) ; node = parent ; while ( node ) { node -> owner = owner ; node = node -> sibling ; } } else { parent = parent -> children [ 0 ] ; } } return ICE_SUCCESS ; }
ice_sched_add_vsi_child_nodes - add VSI child nodes to tree
 @pi: port information structure
 @vsi_handle: software VSI handle
 @tc_node: pointer to the TC node
 @num_nodes: pointer to the num nodes that needs to be added per layer
 @owner: node owner (LAN or RDMA)
ice_sched_add_vsi_child_nodes - add VSI child nodes to tree @pi : port information structure @vsi_handle : software VSI handle @tc_node : pointer to the TC node @num_nodes : pointer to the num nodes that needs to be added per layer @owner : node owner ( LAN or RDMA )
/* The newly added node can be a new parent for the next
		 * layer nodes
		 */