All of lore.kernel.org
 help / color / mirror / Atom feed
From: Seevalamuthu Mariappan <seevalam@codeaurora.org>
To: johannes@sipsolutions.net
Cc: linux-wireless@vger.kernel.org,
	Seevalamuthu Mariappan <seevalam@codeaurora.org>
Subject: [PATCH] mac80211: Fix station dump inactive time after sta connection
Date: Tue,  5 May 2020 23:38:46 +0530	[thread overview]
Message-ID: <1588702126-11364-1-git-send-email-seevalam@codeaurora.org> (raw)

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

             reply	other threads:[~2020-05-05 18:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-05 18:08 Seevalamuthu Mariappan [this message]
2020-05-25  8:35 ` [PATCH] mac80211: Fix station dump inactive time after sta connection Johannes Berg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1588702126-11364-1-git-send-email-seevalam@codeaurora.org \
    --to=seevalam@codeaurora.org \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.