mac80211: Fix station dump inactive time after sta connection
PATCH 1/1 mac80211: Fix station dump inactive time after sta connection
When USES_RSS is enabled, last_rx becomes zero in first few minutes after sta connection in sta_get_last_rx_stats. This leads to inactive time showing current jiffies in msecs.
Station 8c:fd:f0:02:10:dd (on wlan0)
inactive time: 4294701656 ms
.
.
connected time: 2 secondsFix this by avoid overwriting last_rx with percpu_stat's last_rx if it is zero.
--- net/mac80211/sta_info.c | 3 +++ 1 file changed, 3 insertions(+)
net/mac80211/sta_info.c +3 -0
@@ -2089,6 +2089,9 @@ u8 sta_info_tx_streams(struct sta_info *sta) cpustats =per_cpu_ptr (sta->pcpu_rx_stats, cpu); +if (!cpustats->last_rx) +continue ; +if (time_after (cpustats->last_rx, stats->last_rx)) stats = cpustats; }
Signature · 1 line
1.9.1
Johannes Berg
maintainerQuoted 2 lines · Seevalamuthu Mariappan
When
USES_RSSis enabled,last_rxbecomes zero in first few minutes after sta connection
This is wrong - it's something like "in the first few minutes after system boot" or something?
Quoted 11 lines
in
sta_get_last_rx_stats. This
leads to inactive time showing current jiffies in msecs.Station 8c:fd:f0:02:10:dd (on wlan0)
inactive time: 4294701656 ms . . connected time: 2 secondsFix this by avoid overwriting
last_rxwith percpu_stat'slast_rxif it is zero.
This doesn't seem like the right fix - shouldn't we just initialize last_rx better so the wrap won't cause any trouble?
johannes