linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rakesh Pillai <pillair@codeaurora.org>
To: ath10k@lists.infradead.org
Cc: linux-wireless@vger.kernel.org, Rakesh Pillai <pillair@codeaurora.org>
Subject: [PATCH 1/2] ath10k: Fix rate table updation in tx stats
Date: Mon, 11 Mar 2019 21:23:21 +0530	[thread overview]
Message-ID: <1552319602-17795-2-git-send-email-pillair@codeaurora.org> (raw)
In-Reply-To: <1552319602-17795-1-git-send-email-pillair@codeaurora.org>

The index for updating rate table, which is displayed
in the tx stats via debugfs, is calculated using the
bandwidth value. The bandwidth values do not map
correctly with the bandwidth values shown in the rate table.

Correct the bandwidth value calculation which is used
to calculate the index for rate table updation for tx stats.

Tested HW: WCN3990
Tested FW: WLAN.HL.3.1-00784-QCAHLSWMTPLZ-1

Fixes: e88975ca37d1 ("ath10k: dump tx stats in rate table format")
Signed-off-by: Rakesh Pillai <pillair@codeaurora.org>
---
 drivers/net/wireless/ath/ath10k/htt_rx.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c b/drivers/net/wireless/ath/ath10k/htt_rx.c
index a20ea27..8c3c940 100644
--- a/drivers/net/wireless/ath/ath10k/htt_rx.c
+++ b/drivers/net/wireless/ath/ath10k/htt_rx.c
@@ -2922,6 +2922,7 @@ ath10k_accumulate_per_peer_tx_stats(struct ath10k *ar,
 	struct ath10k_htt_tx_stats *tx_stats;
 	int idx, ht_idx, gi, mcs, bw, nss;
 	unsigned long flags;
+	int rtable_bw;
 
 	if (!arsta->tx_stats)
 		return;
@@ -2930,11 +2931,12 @@ ath10k_accumulate_per_peer_tx_stats(struct ath10k *ar,
 	flags = txrate->flags;
 	gi = test_bit(ATH10K_RATE_INFO_FLAGS_SGI_BIT, &flags);
 	mcs = ATH10K_HW_MCS_RATE(pstats->ratecode);
+	rtable_bw = ath10k_get_bw(&ar->hw_params, pstats->flags);
 	bw = txrate->bw;
 	nss = txrate->nss;
 	ht_idx = mcs + (nss - 1) * 8;
 	idx = mcs * 8 + 8 * 10 * (nss - 1);
-	idx += bw * 2 + gi;
+	idx += rtable_bw * 2 + gi;
 
 #define STATS_OP_FMT(name) tx_stats->stats[ATH10K_STATS_TYPE_##name]
 
-- 
2.7.4


  reply	other threads:[~2019-03-11 15:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-11 15:53 [PATCH 0/2] Fix tx stats inconsistencies Rakesh Pillai
2019-03-11 15:53 ` Rakesh Pillai [this message]
2019-03-11 22:58   ` [PATCH 1/2] ath10k: Fix rate table updation in tx stats kbuild test robot
2019-03-11 23:01   ` kbuild test robot
2019-05-03  6:00   ` Kalle Valo
     [not found]   ` <20190503060032.23F1C61195@smtp.codeaurora.org>
2019-05-03  6:56     ` Rakesh Pillai
2019-05-03  7:04       ` Kalle Valo
2019-09-23  8:22   ` Kalle Valo
2019-03-11 15:53 ` [PATCH 2/2] ath10k: Fix NSS tx stats for legacy rates Rakesh Pillai

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=1552319602-17795-2-git-send-email-pillair@codeaurora.org \
    --to=pillair@codeaurora.org \
    --cc=ath10k@lists.infradead.org \
    --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 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).