diff options
author | Felix Fietkau <nbd@nbd.name> | 2022-06-18 10:33:47 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2022-06-18 10:34:00 +0200 |
commit | 1c377a176ba13075a1b1cfba085c1f3538c7acc1 (patch) | |
tree | ad56ae08dd5d2fccf594bb1b001ac06380c354b6 /package/kernel/mac80211/patches/subsys/330-mac80211-fix-overflow-issues-in-airtime-fairness-cod.patch | |
parent | 7676808434233aeeeecce6a560ccd7846805b107 (diff) | |
download | upstream-1c377a176ba13075a1b1cfba085c1f3538c7acc1.tar.gz upstream-1c377a176ba13075a1b1cfba085c1f3538c7acc1.tar.bz2 upstream-1c377a176ba13075a1b1cfba085c1f3538c7acc1.zip |
Revert "mac80211: sync airtime fairness fixes with updated upstream submission"
This reverts commit 958785508cc802de75698607670f9a236883d24d.
Needs some more work until it is ready
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'package/kernel/mac80211/patches/subsys/330-mac80211-fix-overflow-issues-in-airtime-fairness-cod.patch')
-rw-r--r-- | package/kernel/mac80211/patches/subsys/330-mac80211-fix-overflow-issues-in-airtime-fairness-cod.patch | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/package/kernel/mac80211/patches/subsys/330-mac80211-fix-overflow-issues-in-airtime-fairness-cod.patch b/package/kernel/mac80211/patches/subsys/330-mac80211-fix-overflow-issues-in-airtime-fairness-cod.patch index b7c15076f9..037ab8e180 100644 --- a/package/kernel/mac80211/patches/subsys/330-mac80211-fix-overflow-issues-in-airtime-fairness-cod.patch +++ b/package/kernel/mac80211/patches/subsys/330-mac80211-fix-overflow-issues-in-airtime-fairness-cod.patch @@ -12,26 +12,14 @@ Fix this by reordering multiplications/shifts and by reducing unnecessary intermediate precision (which was lost in a later stage anyway). The new shift value limits the maximum weight to 4096, which should be more -than enough. Any values bigger than that will be rejected. +than enough. Any values bigger than that will be clamped to the upper limit. Signed-off-by: Felix Fietkau <nbd@nbd.name> --- ---- a/net/mac80211/cfg.c -+++ b/net/mac80211/cfg.c -@@ -1602,6 +1602,9 @@ static int sta_apply_parameters(struct i - mask = params->sta_flags_mask; - set = params->sta_flags_set; - -+ if (params->airtime_weight > BIT(IEEE80211_RECIPROCAL_SHIFT_STA)) -+ return -EINVAL; -+ - if (ieee80211_vif_is_mesh(&sdata->vif)) { - /* - * In mesh mode, ASSOCIATED isn't part of the nl80211 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h -@@ -1666,50 +1666,33 @@ static inline struct airtime_info *to_ai +@@ -1666,50 +1666,34 @@ static inline struct airtime_info *to_ai /* To avoid divisions in the fast path, we keep pre-computed reciprocals for * airtime weight calculations. There are two different weights to keep track * of: The per-station weight and the sum of weights per phy. @@ -59,6 +47,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> -static inline void airtime_weight_set(struct airtime_info *air_info, u16 weight) +static inline void airtime_weight_set(struct airtime_info *air_info, u32 weight) { ++ weight = min_t(u32, weight, BIT(IEEE80211_RECIPROCAL_SHIFT_STA)); if (air_info->weight == weight) return; |