Skip to content

Commit

Permalink
mac80211: fix minstrel sample time check
Browse files Browse the repository at this point in the history
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

Signed-off-by: Felix Fietkau <[email protected]>
  • Loading branch information
nbd168 authored and coolsnowwolf committed Jun 17, 2021
1 parent f89a6ad commit a4e2bd5
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
From: Felix Fietkau <[email protected]>
Date: Thu, 17 Jun 2021 12:05:54 +0200
Subject: [PATCH] mac80211: minstrel_ht: fix sample time check

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")
Signed-off-by: Felix Fietkau <[email protected]>
---

--- a/net/mac80211/rc80211_minstrel_ht.c
+++ b/net/mac80211/rc80211_minstrel_ht.c
@@ -1498,7 +1498,7 @@ minstrel_ht_get_rate(void *priv, struct
(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;

0 comments on commit a4e2bd5

Please sign in to comment.