src/dpdk/drivers/net/ice/base/ice_sched.c
static enum ice_status
ice_sched_move_nodes(struct ice_port_info *pi, struct ice_sched_node *parent,
		     u16 num_items, u32 *list)
{
	enum ice_status status = ICE_SUCCESS;
	struct ice_aqc_move_elem *buf;
	struct ice_sched_node *node;
	u16 i, grps_movd = 0;
	struct ice_hw *hw;
	u16 buf_len;

	hw = pi->hw;

	if (!parent || !num_items)
		return ICE_ERR_PARAM;

	/* Does parent have enough space */
	if (parent->num_children + num_items >
	    hw->max_children[parent->tx_sched_layer])
		return ICE_ERR_AQ_FULL;

	buf_len = ice_struct_size(buf, teid, 1);
	buf = (struct ice_aqc_move_elem *)ice_malloc(hw, buf_len);
	if (!buf)
		return ICE_ERR_NO_MEMORY;

	for (i = 0; i < num_items; i++) {
		node = ice_sched_find_node_by_teid(pi->root, list[i]);
		if (!node) {
			status = ICE_ERR_PARAM;
			goto move_err_exit;
		}

		buf->hdr.src_parent_teid = node->info.parent_teid;
		buf->hdr.dest_parent_teid = parent->info.node_teid;
		buf->teid[0] = node->info.node_teid;
		buf->hdr.num_elems = CPU_TO_LE16(1);
		status = ice_aq_move_sched_elems(hw, 1, buf, buf_len,
						 &grps_movd, NULL);
		if (status && grps_movd != 1) {
			status = ICE_ERR_CFG;
			goto move_err_exit;
		}

		/* update the SW DB */
		ice_sched_update_parent(parent, node);
	}

move_err_exit:
	ice_free(hw, buf);
	return status;
}
/**
 * ice_sched_move_nodes - move child nodes to a given parent
 * @pi: port information structure
 * @parent: pointer to parent node
 * @num_items: number of child nodes to be moved
 * @list: pointer to child node teids
 *
 * This function move the child nodes to a given parent.
 */
move child nodes to a given parent
@pi: port information structure
@parent: pointer to parent node
@num_items: number of child nodes to be moved
@list: pointer to child node teids

This function move the child nodes to a given parent.
move child nodes to a given parent @pi : port information structure @parent : pointer to parent node @num_items : number of child nodes to be moved @list : pointer to child node teids This function move the child nodes to a given parent .
static enum ice_status
ice_sched_move_nodes(struct ice_port_info *pi, struct ice_sched_node *parent,
		     u16 num_items, u32 *list)
{
	enum ice_status status = ICE_SUCCESS;
	struct ice_aqc_move_elem *buf;
	struct ice_sched_node *node;
	u16 i, grps_movd = 0;
	struct ice_hw *hw;
	u16 buf_len;
	hw = pi->hw;
	if (!parent || !num_items)
		return ICE_ERR_PARAM;
	if (parent->num_children + num_items >
	    hw->max_children[parent->tx_sched_layer])
		return ICE_ERR_AQ_FULL;
	buf_len = ice_struct_size(buf, teid, 1);
	buf = (struct ice_aqc_move_elem *)ice_malloc(hw, buf_len);
	if (!buf)
		return ICE_ERR_NO_MEMORY;
	for (i = 0; i < num_items; i++) {
		node = ice_sched_find_node_by_teid(pi->root, list[i]);
		if (!node) {
			status = ICE_ERR_PARAM;
			goto move_err_exit;
		}
		buf->hdr.src_parent_teid = node->info.parent_teid;
		buf->hdr.dest_parent_teid = parent->info.node_teid;
		buf->teid[0] = node->info.node_teid;
		buf->hdr.num_elems = CPU_TO_LE16(1);
		status = ice_aq_move_sched_elems(hw, 1, buf, buf_len,
						 &grps_movd, NULL);
		if (status && grps_movd != 1) {
			status = ICE_ERR_CFG;
			goto move_err_exit;
		}
		ice_sched_update_parent(parent, node);
	}
move_err_exit:
	ice_free(hw, buf);
	return status;
}
static enum ice_status ice_sched_move_nodes ( struct ice_port_info * pi , struct ice_sched_node * parent , u16 num_items , u32 * list ) { enum ice_status status = ICE_SUCCESS ; struct ice_aqc_move_elem * buf ; struct ice_sched_node * node ; u16 i , grps_movd = 0 ; struct ice_hw * hw ; u16 buf_len ; hw = pi -> hw ; if ( ! parent || ! num_items ) return ICE_ERR_PARAM ; if ( parent -> num_children + num_items > hw -> max_children [ parent -> tx_sched_layer ] ) return ICE_ERR_AQ_FULL ; buf_len = ice_struct_size ( buf , teid , 1 ) ; buf = ( struct ice_aqc_move_elem * ) ice_malloc ( hw , buf_len ) ; if ( ! buf ) return ICE_ERR_NO_MEMORY ; for ( i = 0 ; i < num_items ; i ++ ) { node = ice_sched_find_node_by_teid ( pi -> root , list [ i ] ) ; if ( ! node ) { status = ICE_ERR_PARAM ; goto move_err_exit ; } buf -> hdr . src_parent_teid = node -> info . parent_teid ; buf -> hdr . dest_parent_teid = parent -> info . node_teid ; buf -> teid [ 0 ] = node -> info . node_teid ; buf -> hdr . num_elems = CPU_TO_LE16 ( 1 ) ; status = ice_aq_move_sched_elems ( hw , 1 , buf , buf_len , & grps_movd , NULL ) ; if ( status && grps_movd != 1 ) { status = ICE_ERR_CFG ; goto move_err_exit ; } ice_sched_update_parent ( parent , node ) ; } move_err_exit : ice_free ( hw , buf ) ; return status ; }
ice_sched_move_nodes - move child nodes to a given parent
 @pi: port information structure
 @parent: pointer to parent node
 @num_items: number of child nodes to be moved
 @list: pointer to child node teids
ice_sched_move_nodes - move child nodes to a given parent @pi : port information structure @parent : pointer to parent node @num_items : number of child nodes to be moved @list : pointer to child node teids
/* Does parent have enough space */ /* update the SW DB */