]> git.baikalelectronics.ru Git - kernel.git/commitdiff
mac80211: minstrel_ht: fix sample time check
authorFelix Fietkau <nbd@nbd.name>
Thu, 17 Jun 2021 10:38:54 +0000 (12:38 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 18 Jun 2021 09:35:29 +0000 (11:35 +0200)
We need to skip sampling if the next sample time is after jiffies, not before.
This patch fixes an issue where in some cases only very little sampling (or none
at all) is performed, leading to really bad data rates

Fixes: 80d55154b2f8 ("mac80211: minstrel_ht: significantly redesign the rate probing strategy")
Cc: stable@vger.kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Link: https://lore.kernel.org/r/20210617103854.61875-1-nbd@nbd.name
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/rc80211_minstrel_ht.c

index 6487b05da6fa6ddd4c39a335635c8d5592620952..a6f3fb4a919726651c67dd931df50349f241a2dc 100644 (file)
@@ -1514,7 +1514,7 @@ minstrel_ht_get_rate(void *priv, struct ieee80211_sta *sta, void *priv_sta,
            (info->control.flags & IEEE80211_TX_CTRL_PORT_CTRL_PROTO))
                return;
 
-       if (time_is_before_jiffies(mi->sample_time))
+       if (time_is_after_jiffies(mi->sample_time))
                return;
 
        mi->sample_time = jiffies + MINSTREL_SAMPLE_INTERVAL;