src/dpdk/drivers/net/ice/base/ice_sched.c
static u16 ice_sched_calc_wakeup(struct ice_hw *hw, s32 bw)
{
	s64 bytes_per_sec, wakeup_int, wakeup_a, wakeup_b, wakeup_f;
	s32 wakeup_f_int;
	u16 wakeup = 0;

	/* Get the wakeup integer value */
	bytes_per_sec = DIV_64BIT(((s64)bw * 1000), BITS_PER_BYTE);
	wakeup_int = DIV_64BIT(hw->psm_clk_freq, bytes_per_sec);
	if (wakeup_int > 63) {
		wakeup = (u16)((1 << 15) | wakeup_int);
	} else {
		/* Calculate fraction value up to 4 decimals
		 * Convert Integer value to a constant multiplier
		 */
		wakeup_b = (s64)ICE_RL_PROF_MULTIPLIER * wakeup_int;
		wakeup_a = DIV_64BIT((s64)ICE_RL_PROF_MULTIPLIER *
				     hw->psm_clk_freq, bytes_per_sec);

		/* Get Fraction value */
		wakeup_f = wakeup_a - wakeup_b;

		/* Round up the Fractional value via Ceil(Fractional value) */
		if (wakeup_f > DIV_64BIT(ICE_RL_PROF_MULTIPLIER, 2))
			wakeup_f += 1;

		wakeup_f_int = (s32)DIV_64BIT(wakeup_f * ICE_RL_PROF_FRACTION,
					      ICE_RL_PROF_MULTIPLIER);
		wakeup |= (u16)(wakeup_int << 9);
		wakeup |= (u16)(0x1ff & wakeup_f_int);
	}

	return wakeup;
}
/**
 * ice_sched_calc_wakeup - calculate RL profile wakeup parameter
 * @hw: pointer to the HW struct
 * @bw: bandwidth in Kbps
 *
 * This function calculates the wakeup parameter of RL profile.
 */
calculate RL profile wakeup parameter
@hw: pointer to the HW struct
@bw: bandwidth in Kbps

This function calculates the wakeup parameter of RL profile.
calculate RL profile wakeup parameter @hw : pointer to the HW struct @bw : bandwidth in Kbps This function calculates the wakeup parameter of RL profile .
static u16 ice_sched_calc_wakeup(struct ice_hw *hw, s32 bw)
{
	s64 bytes_per_sec, wakeup_int, wakeup_a, wakeup_b, wakeup_f;
	s32 wakeup_f_int;
	u16 wakeup = 0;
	bytes_per_sec = DIV_64BIT(((s64)bw * 1000), BITS_PER_BYTE);
	wakeup_int = DIV_64BIT(hw->psm_clk_freq, bytes_per_sec);
	if (wakeup_int > 63) {
		wakeup = (u16)((1 << 15) | wakeup_int);
	} else {
		wakeup_b = (s64)ICE_RL_PROF_MULTIPLIER * wakeup_int;
		wakeup_a = DIV_64BIT((s64)ICE_RL_PROF_MULTIPLIER *
				     hw->psm_clk_freq, bytes_per_sec);
		wakeup_f = wakeup_a - wakeup_b;
		if (wakeup_f > DIV_64BIT(ICE_RL_PROF_MULTIPLIER, 2))
			wakeup_f += 1;
		wakeup_f_int = (s32)DIV_64BIT(wakeup_f * ICE_RL_PROF_FRACTION,
					      ICE_RL_PROF_MULTIPLIER);
		wakeup |= (u16)(wakeup_int << 9);
		wakeup |= (u16)(0x1ff & wakeup_f_int);
	}
	return wakeup;
}
static u16 ice_sched_calc_wakeup ( struct ice_hw * hw , s32 bw ) { s64 bytes_per_sec , wakeup_int , wakeup_a , wakeup_b , wakeup_f ; s32 wakeup_f_int ; u16 wakeup = 0 ; bytes_per_sec = DIV_64BIT ( ( ( s64 ) bw * 1000 ) , BITS_PER_BYTE ) ; wakeup_int = DIV_64BIT ( hw -> psm_clk_freq , bytes_per_sec ) ; if ( wakeup_int > 63 ) { wakeup = ( u16 ) ( ( 1 << 15 ) | wakeup_int ) ; } else { wakeup_b = ( s64 ) ICE_RL_PROF_MULTIPLIER * wakeup_int ; wakeup_a = DIV_64BIT ( ( s64 ) ICE_RL_PROF_MULTIPLIER * hw -> psm_clk_freq , bytes_per_sec ) ; wakeup_f = wakeup_a - wakeup_b ; if ( wakeup_f > DIV_64BIT ( ICE_RL_PROF_MULTIPLIER , 2 ) ) wakeup_f += 1 ; wakeup_f_int = ( s32 ) DIV_64BIT ( wakeup_f * ICE_RL_PROF_FRACTION , ICE_RL_PROF_MULTIPLIER ) ; wakeup |= ( u16 ) ( wakeup_int << 9 ) ; wakeup |= ( u16 ) ( 0x1ff & wakeup_f_int ) ; } return wakeup ; }
ice_sched_calc_wakeup - calculate RL profile wakeup parameter
 @hw: pointer to the HW struct
 @bw: bandwidth in Kbps
ice_sched_calc_wakeup - calculate RL profile wakeup parameter @hw : pointer to the HW struct @bw : bandwidth in Kbps
/* Get the wakeup integer value */ /* Calculate fraction value up to 4 decimals
		 * Convert Integer value to a constant multiplier
		 */ /* Get Fraction value */ /* Round up the Fractional value via Ceil(Fractional value) */