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 2/2] ath10k: Fix NSS tx stats for legacy rates
Date: Mon, 11 Mar 2019 21:23:22 +0530	[thread overview]
Message-ID: <1552319602-17795-3-git-send-email-pillair@codeaurora.org> (raw)
In-Reply-To: <1552319602-17795-1-git-send-email-pillair@codeaurora.org>

The ratecode field given by firmware in the tx stats
gives the details of NSS and MCS, if the preamble
specifies that it is HT/VHT. In case of OFDM/CCK, as
specified by the preamble, the ratecode indicates the
legacy rate instead of NSS/MCS data. For OFDM/CCK cases,
the NSS should always be 1, i.e. 1x1 mode for 11g and 11b.

Currently the legacy rate is misinterpreted as NSS & MCS, leading
to incorrect updation of tx stats corresponding to NSS, which is
displayed in the tx stats via debugfs.

Fix the nss value to 1 for 11b and 11g modes by checking
the preamble indication in the ratecode provided by the firmware.

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 | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c b/drivers/net/wireless/ath/ath10k/htt_rx.c
index 8c3c940..c1308a6 100644
--- a/drivers/net/wireless/ath/ath10k/htt_rx.c
+++ b/drivers/net/wireless/ath/ath10k/htt_rx.c
@@ -2955,6 +2955,8 @@ ath10k_accumulate_per_peer_tx_stats(struct ath10k *ar,
 		STATS_OP_FMT(RETRY).ht[0][ht_idx] += pstats->retry_bytes;
 		STATS_OP_FMT(RETRY).ht[1][ht_idx] += pstats->retry_pkts;
 	} else {
+		/* For 11g and 11b, NSS is 1x1 */
+		nss = 1;
 		mcs = legacy_rate_idx;
 
 		STATS_OP_FMT(SUCC).legacy[0][mcs] += pstats->succ_bytes;
-- 
2.7.4


      parent 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 ` [PATCH 1/2] ath10k: Fix rate table updation in tx stats Rakesh Pillai
2019-03-11 22:58   ` 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 ` Rakesh Pillai [this message]

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