Message ID | 1366199002-10177-1-git-send-email-karl.beldan@gmail.com (mailing list archive) |
---|---|
State | Not Applicable, archived |
Headers | show |
On 2013-04-17 1:43 PM, Karl Beldan wrote: > From: Karl Beldan <karl.beldan@rivierawaves.com> > > Use powers of two in ewma of minstrel. > This changes : > - EWMA_DIV from 100 to 2^7 > - EWMA_LEVEL from 75 (/EWMA_DIV=100) to 2^6 + 2^5 (/EWMA_DIV=128) > > Note that this changes EWMA_DIV - EWMA_LEVEL from 25 to 2^5 and keeps > EWMA_LEVEL / EWMA_DIV == 0.75. > > Signed-off-by: Karl Beldan <karl.beldan@rivierawaves.com> Acked-by: Felix Fietkau <nbd@openwrt.org> -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/net/mac80211/rc80211_minstrel.h b/net/mac80211/rc80211_minstrel.h index 8e5a222..f4301f4 100644 --- a/net/mac80211/rc80211_minstrel.h +++ b/net/mac80211/rc80211_minstrel.h @@ -9,7 +9,8 @@ #ifndef __RC_MINSTREL_H #define __RC_MINSTREL_H -#define EWMA_LEVEL 75 /* ewma weighting factor [%] */ +#define EWMA_LEVEL 96 /* ewma weighting factor [/EWMA_DIV] */ +#define EWMA_DIV 128 #define SAMPLE_COLUMNS 10 /* number of columns in sample table */ @@ -27,7 +28,7 @@ static inline int minstrel_ewma(int old, int new, int weight) { - return (new * (100 - weight) + old * weight) / 100; + return (new * (EWMA_DIV - weight) + old * weight) / EWMA_DIV; }