Re: [PATCH 2/2] Interpolate rate calculation functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Mar 16, 2020 at 02:11:06PM -0700, Matthew Wang wrote:
> Make max_*_rate functions and rate calculation at the beginning of
> wpas_get_est_tpt more continuous. In wpa_supplicant_need_to_roam, we
> compare these values to make a roaming decision. However, at certain
> SNRs, we see unrealistically large jumps in estimated throughput
> according to these functions, leading us to make incorrect roaming
> decisions. Perform linear interpolation where applicable to more
> accurately reflect actual throughput.

Thanks, both patches applied.

> diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c
> @@ -2187,76 +2187,86 @@ void scan_snr(struct wpa_scan_res *res)
>  static unsigned int max_ht20_rate(int snr, int vht)
>  {
> -	if (snr < 2)
> +	if (snr < 0)
>  		return 0;
> +	if (snr < 2)
> +		return 0 + (snr - 0.0) / (2 - 0) * (6500 - 0); /* HT20 MCS0 */
>  	if (snr < 5)
> -		return 6500; /* HT20 MCS0 */
> +		return 6500 + (snr - 2.0) / (5 - 2) * (13000 - 6500); /* HT20 MCS1 */

I changed these to use a macro to make it clearer that the operations
were identical and to avoid having to specify the same values multiple
times. In addition, I replaced floating point arithmetic with integers
since that seemed to provide same results in practice.
 
-- 
Jouni Malinen                                            PGP id EFC895FA

_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux