* [PATCH 0/1] sta_info: fix insane values in iw sta dump "inactive time"
@ 2019-10-30 21:31 Ahmed Zaki
2019-10-30 21:31 ` [PATCH 1/1] " Ahmed Zaki
0 siblings, 1 reply; 3+ messages in thread
From: Ahmed Zaki @ 2019-10-30 21:31 UTC (permalink / raw)
To: linux-wireless; +Cc: anzaki
While working on an IBSS network with ath10k-ct, the iw station dump
shows insanly high values in the "inactive time". The values are
clearly the initial jiifies of the system.
Debugging showed that this happens when the ieee80211_sta_last_active
is called while last_ack == 0. In this case, it returns zero and the
inactive time shows the system jiffies. This continues until the
jiffies wrap back to zero (about 5 minutes).
Ahmed Zaki (1):
sta_info: fix insane values in iw sta dump "inactive time"
net/mac80211/sta_info.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--
2.17.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/1] sta_info: fix insane values in iw sta dump "inactive time"
2019-10-30 21:31 [PATCH 0/1] sta_info: fix insane values in iw sta dump "inactive time" Ahmed Zaki
@ 2019-10-30 21:31 ` Ahmed Zaki
2019-10-31 8:11 ` Johannes Berg
0 siblings, 1 reply; 3+ messages in thread
From: Ahmed Zaki @ 2019-10-30 21:31 UTC (permalink / raw)
To: linux-wireless; +Cc: anzaki
In the first 5 mins after boot (initial jiffies),
ieee80211_sta_last_active() returns zero in case last_ack is zero. This
leads to insane values appearing in "inactive time".
Fix by returning last_rx if last_ack == 0.
---
net/mac80211/sta_info.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index bd11fef2139f..428866ff7c0a 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -2457,7 +2457,8 @@ unsigned long ieee80211_sta_last_active(struct sta_info *sta)
{
struct ieee80211_sta_rx_stats *stats = sta_get_last_rx_stats(sta);
- if (time_after(stats->last_rx, sta->status_stats.last_ack))
+ if (!sta->status_stats.last_ack ||
+ time_after(stats->last_rx, sta->status_stats.last_ack))
return stats->last_rx;
return sta->status_stats.last_ack;
}
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] sta_info: fix insane values in iw sta dump "inactive time"
2019-10-30 21:31 ` [PATCH 1/1] " Ahmed Zaki
@ 2019-10-31 8:11 ` Johannes Berg
0 siblings, 0 replies; 3+ messages in thread
From: Johannes Berg @ 2019-10-31 8:11 UTC (permalink / raw)
To: Ahmed Zaki, linux-wireless
On Wed, 2019-10-30 at 15:31 -0600, Ahmed Zaki wrote:
> In the first 5 mins after boot (initial jiffies),
> ieee80211_sta_last_active() returns zero in case last_ack is zero. This
> leads to insane values appearing in "inactive time".
>
> Fix by returning last_rx if last_ack == 0.
Please read
https://wireless.wiki.kernel.org/en/developers/Documentation/SubmittingPatches
johannes
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-10-31 8:11 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-30 21:31 [PATCH 0/1] sta_info: fix insane values in iw sta dump "inactive time" Ahmed Zaki
2019-10-30 21:31 ` [PATCH 1/1] " Ahmed Zaki
2019-10-31 8:11 ` Johannes Berg
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.