374-mac80211-fix-time-is-after-bug-in-mlme.patch 1.2 KB

12345678910111213141516171819202122232425262728293031
  1. From: Ben Greear <[email protected]>
  2. Date: Tue, 30 Mar 2021 16:07:49 -0700
  3. Subject: [PATCH] mac80211: fix time-is-after bug in mlme
  4. The incorrect timeout check caused probing to happen when it did
  5. not need to happen. This in turn caused tx performance drop
  6. for around 5 seconds in ath10k-ct driver. Possibly that tx drop
  7. is due to a secondary issue, but fixing the probe to not happen
  8. when traffic is running fixes the symptom.
  9. Signed-off-by: Ben Greear <[email protected]>
  10. Fixes: 9abf4e49830d ("mac80211: optimize station connection monitor")
  11. Acked-by: Felix Fietkau <[email protected]>
  12. Link: https://lore.kernel.org/r/[email protected]
  13. Signed-off-by: Johannes Berg <[email protected]>
  14. ---
  15. --- a/net/mac80211/mlme.c
  16. +++ b/net/mac80211/mlme.c
  17. @@ -4691,7 +4691,10 @@ static void ieee80211_sta_conn_mon_timer
  18. timeout = sta->rx_stats.last_rx;
  19. timeout += IEEE80211_CONNECTION_IDLE_TIME;
  20. - if (time_is_before_jiffies(timeout)) {
  21. + /* If timeout is after now, then update timer to fire at
  22. + * the later date, but do not actually probe at this time.
  23. + */
  24. + if (time_is_after_jiffies(timeout)) {
  25. mod_timer(&ifmgd->conn_mon_timer, round_jiffies_up(timeout));
  26. return;
  27. }