src/dpdk/drivers/net/ice/base/ice_sched.c
static void
ice_sched_calc_vsi_support_nodes(struct ice_port_info *pi,
				 struct ice_sched_node *tc_node, u16 *num_nodes)
{
	struct ice_sched_node *node;
	u8 vsil;
	int i;

	vsil = ice_sched_get_vsi_layer(pi->hw);
	for (i = vsil; i >= pi->hw->sw_entry_point_layer; i--)
		/* Add intermediate nodes if TC has no children and
		 * need at least one node for VSI
		 */
		if (!tc_node->num_children || i == vsil) {
			num_nodes[i]++;
		} else {
			/* If intermediate nodes are reached max children
			 * then add a new one.
			 */
			node = ice_sched_get_first_node(pi, tc_node, (u8)i);
			/* scan all the siblings */
			while (node) {
				if (node->num_children <
				    pi->hw->max_children[i])
					break;
				node = node->sibling;
			}

			/* tree has one intermediate node to add this new VSI.
			 * So no need to calculate supported nodes for below
			 * layers.
			 */
			if (node)
				break;
			/* all the nodes are full, allocate a new one */
			num_nodes[i]++;
		}
}
/**
 * ice_sched_calc_vsi_support_nodes - calculate number of VSI support nodes
 * @pi: pointer to the port info structure
 * @tc_node: pointer to TC node
 * @num_nodes: pointer to num nodes array
 *
 * This function calculates the number of supported nodes needed to add this
 * VSI into Tx tree including the VSI, parent and intermediate nodes in below
 * layers
 */
calculate number of VSI support nodes
@pi: pointer to the port info structure
@tc_node: pointer to TC node
@num_nodes: pointer to num nodes array

This function calculates the number of supported nodes needed to add this
VSI into Tx tree including the VSI, parent and intermediate nodes in below
layers
calculate number of VSI support nodes @pi : pointer to the port info structure @tc_node : pointer to TC node @num_nodes : pointer to num nodes array This function calculates the number of supported nodes needed to add this VSI into Tx tree including the VSI parent and intermediate nodes in below layers
static void
ice_sched_calc_vsi_support_nodes(struct ice_port_info *pi,
				 struct ice_sched_node *tc_node, u16 *num_nodes)
{
	struct ice_sched_node *node;
	u8 vsil;
	int i;
	vsil = ice_sched_get_vsi_layer(pi->hw);
	for (i = vsil; i >= pi->hw->sw_entry_point_layer; i--)
		if (!tc_node->num_children || i == vsil) {
			num_nodes[i]++;
		} else {
			node = ice_sched_get_first_node(pi, tc_node, (u8)i);
			while (node) {
				if (node->num_children <
				    pi->hw->max_children[i])
					break;
				node = node->sibling;
			}
			if (node)
				break;
			num_nodes[i]++;
		}
}
static void ice_sched_calc_vsi_support_nodes ( struct ice_port_info * pi , struct ice_sched_node * tc_node , u16 * num_nodes ) { struct ice_sched_node * node ; u8 vsil ; int i ; vsil = ice_sched_get_vsi_layer ( pi -> hw ) ; for ( i = vsil ; i >= pi -> hw -> sw_entry_point_layer ; i -- ) if ( ! tc_node -> num_children || i == vsil ) { num_nodes [ i ] ++ ; } else { node = ice_sched_get_first_node ( pi , tc_node , ( u8 ) i ) ; while ( node ) { if ( node -> num_children < pi -> hw -> max_children [ i ] ) break ; node = node -> sibling ; } if ( node ) break ; num_nodes [ i ] ++ ; } }
ice_sched_calc_vsi_support_nodes - calculate number of VSI support nodes
 @pi: pointer to the port info structure
 @tc_node: pointer to TC node
 @num_nodes: pointer to num nodes array
ice_sched_calc_vsi_support_nodes - calculate number of VSI support nodes @pi : pointer to the port info structure @tc_node : pointer to TC node @num_nodes : pointer to num nodes array
/* Add intermediate nodes if TC has no children and
		 * need at least one node for VSI
		 */ /* If intermediate nodes are reached max children
			 * then add a new one.
			 */ /* scan all the siblings */ /* tree has one intermediate node to add this new VSI.
			 * So no need to calculate supported nodes for below
			 * layers.
			 */ /* all the nodes are full, allocate a new one */