linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mac80211: Fix station dump inactive time after sta connection
@ 2020-05-05 18:08 Seevalamuthu Mariappan
  2020-05-25  8:35 ` Johannes Berg
  0 siblings, 1 reply; 2+ messages in thread
From: Seevalamuthu Mariappan @ 2020-05-05 18:08 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, Seevalamuthu Mariappan

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 seconds

Fix this by avoid overwriting last_rx with percpu_stat's last_rx
if it is zero.

Signed-off-by: Seevalamuthu Mariappan <seevalam@codeaurora.org>
---
 net/mac80211/sta_info.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index f8d5c25..df40c0a 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -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;
 	}
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mac80211: Fix station dump inactive time after sta connection
  2020-05-05 18:08 [PATCH] mac80211: Fix station dump inactive time after sta connection Seevalamuthu Mariappan
@ 2020-05-25  8:35 ` Johannes Berg
  0 siblings, 0 replies; 2+ messages in thread
From: Johannes Berg @ 2020-05-25  8:35 UTC (permalink / raw)
  To: Seevalamuthu Mariappan; +Cc: linux-wireless

On Tue, 2020-05-05 at 23:38 +0530, Seevalamuthu Mariappan wrote:
> When USES_RSS is enabled, last_rx becomes 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?

>  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 seconds
> 
> Fix this by avoid overwriting last_rx with percpu_stat's last_rx
> if 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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-05-25  8:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-05 18:08 [PATCH] mac80211: Fix station dump inactive time after sta connection Seevalamuthu Mariappan
2020-05-25  8:35 ` Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).