src/dpdk/drivers/net/ice/base/ice_common.c
enum ice_status ice_free_hw_res(struct ice_hw *hw, u16 type, u16 num, u16 *res)
{
	struct ice_aqc_alloc_free_res_elem *buf;
	enum ice_status status;
	u16 buf_len;

	buf_len = ice_struct_size(buf, elem, num);
	buf = (struct ice_aqc_alloc_free_res_elem *)ice_malloc(hw, buf_len);
	if (!buf)
		return ICE_ERR_NO_MEMORY;

	/* Prepare buffer to free resource. */
	buf->num_elems = CPU_TO_LE16(num);
	buf->res_type = CPU_TO_LE16(type);
	ice_memcpy(buf->elem, res, sizeof(*buf->elem) * num,
		   ICE_NONDMA_TO_NONDMA);

	status = ice_aq_alloc_free_res(hw, num, buf, buf_len,
				       ice_aqc_opc_free_res, NULL);
	if (status)
		ice_debug(hw, ICE_DBG_SW, "CQ CMD Buffer:\n");

	ice_free(hw, buf);
	return status;
}
/**
 * ice_free_hw_res - free allocated HW resource
 * @hw: pointer to the HW struct
 * @type: type of resource to free
 * @num: number of resources
 * @res: pointer to array that contains the resources to free
 */
free allocated HW resource
@hw: pointer to the HW struct
@type: type of resource to free
@num: number of resources
@res: pointer to array that contains the resources to free
free allocated HW resource @hw : pointer to the HW struct @type : type of resource to free @num : number of resources @res : pointer to array that contains the resources to free
enum ice_status ice_free_hw_res(struct ice_hw *hw, u16 type, u16 num, u16 *res)
{
	struct ice_aqc_alloc_free_res_elem *buf;
	enum ice_status status;
	u16 buf_len;
	buf_len = ice_struct_size(buf, elem, num);
	buf = (struct ice_aqc_alloc_free_res_elem *)ice_malloc(hw, buf_len);
	if (!buf)
		return ICE_ERR_NO_MEMORY;
	buf->num_elems = CPU_TO_LE16(num);
	buf->res_type = CPU_TO_LE16(type);
	ice_memcpy(buf->elem, res, sizeof(*buf->elem) * num,
		   ICE_NONDMA_TO_NONDMA);
	status = ice_aq_alloc_free_res(hw, num, buf, buf_len,
				       ice_aqc_opc_free_res, NULL);
	if (status)
		ice_debug(hw, ICE_DBG_SW, "CQ CMD Buffer:\n");
	ice_free(hw, buf);
	return status;
}
enum ice_status ice_free_hw_res ( struct ice_hw * hw , u16 type , u16 num , u16 * res ) { struct ice_aqc_alloc_free_res_elem * buf ; enum ice_status status ; u16 buf_len ; buf_len = ice_struct_size ( buf , elem , num ) ; buf = ( struct ice_aqc_alloc_free_res_elem * ) ice_malloc ( hw , buf_len ) ; if ( ! buf ) return ICE_ERR_NO_MEMORY ; buf -> num_elems = CPU_TO_LE16 ( num ) ; buf -> res_type = CPU_TO_LE16 ( type ) ; ice_memcpy ( buf -> elem , res , sizeof ( * buf -> elem ) * num , ICE_NONDMA_TO_NONDMA ) ; status = ice_aq_alloc_free_res ( hw , num , buf , buf_len , ice_aqc_opc_free_res , NULL ) ; if ( status ) ice_debug ( hw , ICE_DBG_SW , " \n " ) ; ice_free ( hw , buf ) ; return status ; }
ice_free_hw_res - free allocated HW resource
 @hw: pointer to the HW struct
 @type: type of resource to free
 @num: number of resources
 @res: pointer to array that contains the resources to free
ice_free_hw_res - free allocated HW resource @hw : pointer to the HW struct @type : type of resource to free @num : number of resources @res : pointer to array that contains the resources to free
/* Prepare buffer to free resource. */