src/dpdk/drivers/net/ice/base/ice_sched.c
static enum ice_status
ice_sched_remove_elems(struct ice_hw *hw, struct ice_sched_node *parent,
		       u16 num_nodes, u32 *node_teids)
{
	struct ice_aqc_delete_elem *buf;
	u16 i, num_groups_removed = 0;
	enum ice_status status;
	u16 buf_size;

	buf_size = ice_struct_size(buf, teid, num_nodes);
	buf = (struct ice_aqc_delete_elem *)ice_malloc(hw, buf_size);
	if (!buf)
		return ICE_ERR_NO_MEMORY;

	buf->hdr.parent_teid = parent->info.node_teid;
	buf->hdr.num_elems = CPU_TO_LE16(num_nodes);
	for (i = 0; i < num_nodes; i++)
		buf->teid[i] = CPU_TO_LE32(node_teids[i]);

	status = ice_aq_delete_sched_elems(hw, 1, buf, buf_size,
					   &num_groups_removed, NULL);
	if (status != ICE_SUCCESS || num_groups_removed != 1)
		ice_debug(hw, ICE_DBG_SCHED, "remove node failed FW error %d\n",
			  hw->adminq.sq_last_status);

	ice_free(hw, buf);
	return status;
}
/**
 * ice_sched_remove_elems - remove nodes from HW
 * @hw: pointer to the HW struct
 * @parent: pointer to the parent node
 * @num_nodes: number of nodes
 * @node_teids: array of node teids to be deleted
 *
 * This function remove nodes from HW
 */
remove nodes from HW
@hw: pointer to the HW struct
@parent: pointer to the parent node
@num_nodes: number of nodes
@node_teids: array of node teids to be deleted

This function remove nodes from HW
remove nodes from HW @hw : pointer to the HW struct @parent : pointer to the parent node @num_nodes : number of nodes @node_teids : array of node teids to be deleted This function remove nodes from HW
static enum ice_status
ice_sched_remove_elems(struct ice_hw *hw, struct ice_sched_node *parent,
		       u16 num_nodes, u32 *node_teids)
{
	struct ice_aqc_delete_elem *buf;
	u16 i, num_groups_removed = 0;
	enum ice_status status;
	u16 buf_size;
	buf_size = ice_struct_size(buf, teid, num_nodes);
	buf = (struct ice_aqc_delete_elem *)ice_malloc(hw, buf_size);
	if (!buf)
		return ICE_ERR_NO_MEMORY;
	buf->hdr.parent_teid = parent->info.node_teid;
	buf->hdr.num_elems = CPU_TO_LE16(num_nodes);
	for (i = 0; i < num_nodes; i++)
		buf->teid[i] = CPU_TO_LE32(node_teids[i]);
	status = ice_aq_delete_sched_elems(hw, 1, buf, buf_size,
					   &num_groups_removed, NULL);
	if (status != ICE_SUCCESS || num_groups_removed != 1)
		ice_debug(hw, ICE_DBG_SCHED, "remove node failed FW error %d\n",
			  hw->adminq.sq_last_status);
	ice_free(hw, buf);
	return status;
}
static enum ice_status ice_sched_remove_elems ( struct ice_hw * hw , struct ice_sched_node * parent , u16 num_nodes , u32 * node_teids ) { struct ice_aqc_delete_elem * buf ; u16 i , num_groups_removed = 0 ; enum ice_status status ; u16 buf_size ; buf_size = ice_struct_size ( buf , teid , num_nodes ) ; buf = ( struct ice_aqc_delete_elem * ) ice_malloc ( hw , buf_size ) ; if ( ! buf ) return ICE_ERR_NO_MEMORY ; buf -> hdr . parent_teid = parent -> info . node_teid ; buf -> hdr . num_elems = CPU_TO_LE16 ( num_nodes ) ; for ( i = 0 ; i < num_nodes ; i ++ ) buf -> teid [ i ] = CPU_TO_LE32 ( node_teids [ i ] ) ; status = ice_aq_delete_sched_elems ( hw , 1 , buf , buf_size , & num_groups_removed , NULL ) ; if ( status != ICE_SUCCESS || num_groups_removed != 1 ) ice_debug ( hw , ICE_DBG_SCHED , " \n " , hw -> adminq . sq_last_status ) ; ice_free ( hw , buf ) ; return status ; }
ice_sched_remove_elems - remove nodes from HW
 @hw: pointer to the HW struct
 @parent: pointer to the parent node
 @num_nodes: number of nodes
 @node_teids: array of node teids to be deleted
ice_sched_remove_elems - remove nodes from HW @hw : pointer to the HW struct @parent : pointer to the parent node @num_nodes : number of nodes @node_teids : array of node teids to be deleted