| b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame] | 1 | From: Felix Fietkau <nbd@nbd.name> |
| 2 | Date: Thu, 17 Jun 2021 12:05:54 +0200 |
| 3 | Subject: [PATCH] mac80211: minstrel_ht: fix sample time check |
| 4 | |
| 5 | We need to skip sampling if the next sample time is after jiffies, not before. |
| 6 | This patch fixes an issue where in some cases only very little sampling (or none |
| 7 | at all) is performed, leading to really bad data rates |
| 8 | |
| 9 | Fixes: 80d55154b2f8 ("mac80211: minstrel_ht: significantly redesign the rate probing strategy") |
| 10 | Signed-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; |