src/dpdk/drivers/net/ice/base/ice_sched.c
static enum ice_status
ice_sched_suspend_resume_elems(struct ice_hw *hw, u8 num_nodes, u32 *node_teids,
			       bool suspend)
{
	u16 i, buf_size, num_elem_ret = 0;
	enum ice_status status;
	__le32 *buf;

	buf_size = sizeof(*buf) * num_nodes;
	buf = (__le32 *)ice_malloc(hw, buf_size);
	if (!buf)
		return ICE_ERR_NO_MEMORY;

	for (i = 0; i < num_nodes; i++)
		buf[i] = CPU_TO_LE32(node_teids[i]);

	if (suspend)
		status = ice_aq_suspend_sched_elems(hw, num_nodes, buf,
						    buf_size, &num_elem_ret,
						    NULL);
	else
		status = ice_aq_resume_sched_elems(hw, num_nodes, buf,
						   buf_size, &num_elem_ret,
						   NULL);
	if (status != ICE_SUCCESS || num_elem_ret != num_nodes)
		ice_debug(hw, ICE_DBG_SCHED, "suspend/resume failed\n");

	ice_free(hw, buf);
	return status;
}
/**
 * ice_sched_suspend_resume_elems - suspend or resume HW nodes
 * @hw: pointer to the HW struct
 * @num_nodes: number of nodes
 * @node_teids: array of node teids to be suspended or resumed
 * @suspend: true means suspend / false means resume
 *
 * This function suspends or resumes HW nodes
 */
suspend or resume HW nodes
@hw: pointer to the HW struct
@num_nodes: number of nodes
@node_teids: array of node teids to be suspended or resumed
@suspend: true means suspend / false means resume

This function suspends or resumes HW nodes
suspend or resume HW nodes @hw : pointer to the HW struct @num_nodes : number of nodes @node_teids : array of node teids to be suspended or resumed @suspend : true means suspend / false means resume This function suspends or resumes HW nodes
static enum ice_status
ice_sched_suspend_resume_elems(struct ice_hw *hw, u8 num_nodes, u32 *node_teids,
			       bool suspend)
{
	u16 i, buf_size, num_elem_ret = 0;
	enum ice_status status;
	__le32 *buf;
	buf_size = sizeof(*buf) * num_nodes;
	buf = (__le32 *)ice_malloc(hw, buf_size);
	if (!buf)
		return ICE_ERR_NO_MEMORY;
	for (i = 0; i < num_nodes; i++)
		buf[i] = CPU_TO_LE32(node_teids[i]);
	if (suspend)
		status = ice_aq_suspend_sched_elems(hw, num_nodes, buf,
						    buf_size, &num_elem_ret,
						    NULL);
	else
		status = ice_aq_resume_sched_elems(hw, num_nodes, buf,
						   buf_size, &num_elem_ret,
						   NULL);
	if (status != ICE_SUCCESS || num_elem_ret != num_nodes)
		ice_debug(hw, ICE_DBG_SCHED, "suspend/resume failed\n");
	ice_free(hw, buf);
	return status;
}
static enum ice_status ice_sched_suspend_resume_elems ( struct ice_hw * hw , u8 num_nodes , u32 * node_teids , bool suspend ) { u16 i , buf_size , num_elem_ret = 0 ; enum ice_status status ; __le32 * buf ; buf_size = sizeof ( * buf ) * num_nodes ; buf = ( __le32 * ) ice_malloc ( hw , buf_size ) ; if ( ! buf ) return ICE_ERR_NO_MEMORY ; for ( i = 0 ; i < num_nodes ; i ++ ) buf [ i ] = CPU_TO_LE32 ( node_teids [ i ] ) ; if ( suspend ) status = ice_aq_suspend_sched_elems ( hw , num_nodes , buf , buf_size , & num_elem_ret , NULL ) ; else status = ice_aq_resume_sched_elems ( hw , num_nodes , buf , buf_size , & num_elem_ret , NULL ) ; if ( status != ICE_SUCCESS || num_elem_ret != num_nodes ) ice_debug ( hw , ICE_DBG_SCHED , " \n " ) ; ice_free ( hw , buf ) ; return status ; }
ice_sched_suspend_resume_elems - suspend or resume HW nodes
 @hw: pointer to the HW struct
 @num_nodes: number of nodes
 @node_teids: array of node teids to be suspended or resumed
 @suspend: true means suspend / false means resume
ice_sched_suspend_resume_elems - suspend or resume HW nodes @hw : pointer to the HW struct @num_nodes : number of nodes @node_teids : array of node teids to be suspended or resumed @suspend : true means suspend / false means resume