linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] ath10k: use cumulative survey statistics
@ 2020-05-04 15:41 Markus Theil
  2020-05-04 15:41 ` [PATCH 2/2] ath11k: " Markus Theil
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Markus Theil @ 2020-05-04 15:41 UTC (permalink / raw)
  To: linux-wireless; +Cc: kvalo, ath10k, ath11k, Markus Theil

ath10k currently reports survey results for the last interval between each
invocation of NL80211_CMD_GET_SURVEY. For concurrent invocations, this
can lead to unexpectedly small results, e.g. when hostapd uses survey
data and iw survey dump is invoked in parallel. Fix this by returning
cumulative results, that don't depend on the last invocation. Other
drivers, e.g. ath9k or mt76 also use this behavior.

Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
---
 drivers/net/wireless/ath/ath10k/wmi.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index a81a1ab2de19..451c8275d07b 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -5802,16 +5802,16 @@ static int ath10k_wmi_event_pdev_bss_chan_info(struct ath10k *ar,
 
 	survey = &ar->survey[idx];
 
-	survey->noise     = noise_floor;
-	survey->time      = div_u64(total, cc_freq_hz);
-	survey->time_busy = div_u64(busy, cc_freq_hz);
-	survey->time_rx   = div_u64(rx_bss, cc_freq_hz);
-	survey->time_tx   = div_u64(tx, cc_freq_hz);
-	survey->filled   |= (SURVEY_INFO_NOISE_DBM |
-			     SURVEY_INFO_TIME |
-			     SURVEY_INFO_TIME_BUSY |
-			     SURVEY_INFO_TIME_RX |
-			     SURVEY_INFO_TIME_TX);
+	survey->noise      = noise_floor;
+	survey->time      += div_u64(total, cc_freq_hz);
+	survey->time_busy += div_u64(busy, cc_freq_hz);
+	survey->time_rx   += div_u64(rx_bss, cc_freq_hz);
+	survey->time_tx   += div_u64(tx, cc_freq_hz);
+	survey->filled    |= (SURVEY_INFO_NOISE_DBM |
+			      SURVEY_INFO_TIME |
+			      SURVEY_INFO_TIME_BUSY |
+			      SURVEY_INFO_TIME_RX |
+			      SURVEY_INFO_TIME_TX);
 exit:
 	spin_unlock_bh(&ar->data_lock);
 	complete(&ar->bss_survey_done);
-- 
2.26.2


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

end of thread, other threads:[~2020-05-05 18:45 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-04 15:41 [PATCH 1/2] ath10k: use cumulative survey statistics Markus Theil
2020-05-04 15:41 ` [PATCH 2/2] ath11k: " Markus Theil
2020-05-04 16:36   ` Sven Eckelmann
2020-05-04 23:37   ` Rajkumar Manoharan
2020-05-05  6:53     ` Markus Theil
2020-05-05 17:31       ` Rajkumar Manoharan
2020-05-04 16:29 ` [PATCH 1/2] ath10k: " Sven Eckelmann
2020-05-04 16:33   ` Markus Theil
2020-05-04 23:46 ` Rajkumar Manoharan
2020-05-04 23:49   ` Ben Greear
2020-05-04 23:52     ` Rajkumar Manoharan
2020-05-05  0:02       ` Ben Greear
2020-05-05  7:01   ` Sven Eckelmann
2020-05-05  7:49     ` Sven Eckelmann
2020-05-05  7:55       ` Sven Eckelmann
2020-05-05 18:45         ` Rajkumar Manoharan
2020-05-05 15:37       ` Markus Theil
2020-05-05 18:32         ` Rajkumar Manoharan

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).