blob: 054662f3ef0df3bda2a409a3eda26593d25963bb [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001From: Felix Fietkau <nbd@nbd.name>
2Date: Thu, 17 Jun 2021 12:05:54 +0200
3Subject: [PATCH] mac80211: minstrel_ht: fix sample time check
4
5We need to skip sampling if the next sample time is after jiffies, not before.
6This patch fixes an issue where in some cases only very little sampling (or none
7at all) is performed, leading to really bad data rates
8
9Fixes: 80d55154b2f8 ("mac80211: minstrel_ht: significantly redesign the rate probing strategy")
10Signed-off-by: Felix Fietkau <nbd@nbd.name>
11---
12
13--- a/net/mac80211/rc80211_minstrel_ht.c
14+++ b/net/mac80211/rc80211_minstrel_ht.c
15@@ -1450,7 +1450,7 @@ minstrel_ht_get_rate(void *priv, struct
16 (info->control.flags & IEEE80211_TX_CTRL_PORT_CTRL_PROTO))
17 return;
18
19- if (time_is_before_jiffies(mi->sample_time))
20+ if (time_is_after_jiffies(mi->sample_time))
21 return;
22
23 mi->sample_time = jiffies + MINSTREL_SAMPLE_INTERVAL;