src/dpdk/drivers/net/ice/base/ice_common.c
enum ice_status
ice_aq_alloc_free_res(struct ice_hw *hw, u16 num_entries,
		      struct ice_aqc_alloc_free_res_elem *buf, u16 buf_size,
		      enum ice_adminq_opc opc, struct ice_sq_cd *cd)
{
	struct ice_aqc_alloc_free_res_cmd *cmd;
	struct ice_aq_desc desc;

	ice_debug(hw, ICE_DBG_TRACE, "%s\n", __func__);

	cmd = &desc.params.sw_res_ctrl;

	if (!buf)
		return ICE_ERR_PARAM;

	if (buf_size < FLEX_ARRAY_SIZE(buf, elem, num_entries))
		return ICE_ERR_PARAM;

	ice_fill_dflt_direct_cmd_desc(&desc, opc);

	desc.flags |= CPU_TO_LE16(ICE_AQ_FLAG_RD);

	cmd->num_entries = CPU_TO_LE16(num_entries);

	return ice_aq_send_cmd(hw, &desc, buf, buf_size, cd);
}
/**
 * ice_aq_alloc_free_res - command to allocate/free resources
 * @hw: pointer to the HW struct
 * @num_entries: number of resource entries in buffer
 * @buf: Indirect buffer to hold data parameters and response
 * @buf_size: size of buffer for indirect commands
 * @opc: pass in the command opcode
 * @cd: pointer to command details structure or NULL
 *
 * Helper function to allocate/free resources using the admin queue commands
 */


Helper function to allocate/free resources using the admin queue commands
Helper function to allocate / free resources using the admin queue commands
enum ice_status
ice_aq_alloc_free_res(struct ice_hw *hw, u16 num_entries,
		      struct ice_aqc_alloc_free_res_elem *buf, u16 buf_size,
		      enum ice_adminq_opc opc, struct ice_sq_cd *cd)
{
	struct ice_aqc_alloc_free_res_cmd *cmd;
	struct ice_aq_desc desc;
	ice_debug(hw, ICE_DBG_TRACE, "%s\n", __func__);
	cmd = &desc.params.sw_res_ctrl;
	if (!buf)
		return ICE_ERR_PARAM;
	if (buf_size < FLEX_ARRAY_SIZE(buf, elem, num_entries))
		return ICE_ERR_PARAM;
	ice_fill_dflt_direct_cmd_desc(&desc, opc);
	desc.flags |= CPU_TO_LE16(ICE_AQ_FLAG_RD);
	cmd->num_entries = CPU_TO_LE16(num_entries);
	return ice_aq_send_cmd(hw, &desc, buf, buf_size, cd);
}
enum ice_status ice_aq_alloc_free_res ( struct ice_hw * hw , u16 num_entries , struct ice_aqc_alloc_free_res_elem * buf , u16 buf_size , enum ice_adminq_opc opc , struct ice_sq_cd * cd ) { struct ice_aqc_alloc_free_res_cmd * cmd ; struct ice_aq_desc desc ; ice_debug ( hw , ICE_DBG_TRACE , " \n " , __func__ ) ; cmd = & desc . params . sw_res_ctrl ; if ( ! buf ) return ICE_ERR_PARAM ; if ( buf_size < FLEX_ARRAY_SIZE ( buf , elem , num_entries ) ) return ICE_ERR_PARAM ; ice_fill_dflt_direct_cmd_desc ( & desc , opc ) ; desc . flags |= CPU_TO_LE16 ( ICE_AQ_FLAG_RD ) ; cmd -> num_entries = CPU_TO_LE16 ( num_entries ) ; return ice_aq_send_cmd ( hw , & desc , buf , buf_size , cd ) ; }
ice_aq_alloc_free_res - command to allocate/free resources
 @hw: pointer to the HW struct
 @num_entries: number of resource entries in buffer
 @buf: Indirect buffer to hold data parameters and response
 @buf_size: size of buffer for indirect commands
 @opc: pass in the command opcode
 @cd: pointer to command details structure or NULL
ice_aq_alloc_free_res - command to allocate / free resources @hw : pointer to the HW struct @num_entries : number of resource entries in buffer @buf : Indirect buffer to hold data parameters and response @buf_size : size of buffer for indirect commands @opc : pass in the command opcode @cd : pointer to command details structure or NULL