Skip to contentSkip to conversation

Fix tx stats inconsistencies

PATCH In review Rakesh Pillai 3 participants 11 messages Mar 11, 2019 – Sep 23, 2019 1 message not in the archive Qualcomm Atheros ATH10K wireless driver

lore
Share & tools
lore
#0 lore raw

cover Fix tx stats inconsistencies

The rate table indexes and the NSS values are
incorrect, causing the tx stats to be displayed
incorrectly.

This patchset fix these issues in the tx stats
displayed via debugfs.

Rakesh Pillai (2):
ath10k: Fix rate table updation in tx stats
ath10k: Fix NSS tx stats for legacy rates

 drivers/net/wireless/ath/ath10k/htt_rx.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
Signature · 7 lines
2.7.4


_______________________________________________
ath10k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath10k
#1 lore raw

PATCH 1/2 ath10k: Fix rate table updation in tx stats

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")
---
 drivers/net/wireless/ath/ath10k/htt_rx.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath10k/htt_rx.c +3 -1
index a20ea27..8c3c940 100644
@@ -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]
 
Signature · 7 lines
2.7.4


_______________________________________________
ath10k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath10k
#11 lore raw

PATCH 2/2 ath10k: Fix NSS tx stats for legacy rates

In reply to Rakesh Pillai

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")
---
 drivers/net/wireless/ath/ath10k/htt_rx.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/wireless/ath/ath10k/htt_rx.c +2 -0
index 8c3c940..c1308a6 100644
@@ -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;
Signature · 1 line
2.7.4
#2 lore raw

Re: [PATCH 1/2] ath10k: Fix rate table updation in tx stats

In reply to Rakesh Pillai
Thank you for the patch! Yet something to improve:

Hi Rakesh,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on ath6kl/ath-next]
[also build test ERROR on next-20190306]
[cannot apply to v5.0]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Rakesh-Pillai/Fix-tx-stats-inconsistencies/20190312-061743
base:   https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git ath-next
config: nds32-allyesconfig (attached as .config)
compiler: nds32le-linux-gcc (GCC) 6.4.0

reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
GCC_VERSION=6.4.0 make.cross ARCH=nds32

All errors (new ones prefixed by >>):

drivers/net/wireless/ath/ath10k/htt_rx.c: In function 'ath10k_accumulate_per_peer_tx_stats':

>> drivers/net/wireless/ath/ath10k/htt_rx.c:2934:14: error: implicit declaration of function 'ath10k_get_bw' [-Werror=implicit-function-declaration]
     rtable_bw = ath10k_get_bw(&ar->hw_params, pstats->flags);
                 ^~~~~~~~~~~~~

cc1: some warnings being treated as errors

vim +/ath10k_get_bw +2934 drivers/net/wireless/ath/ath10k/htt_rx.c

2914
2915 static void
2916 ath10k_accumulate_per_peer_tx_stats(struct ath10k *ar,

  2917					    struct ath10k_sta *arsta,
  2918					    struct ath10k_per_peer_tx_stats *pstats,
  2919					    s8 legacy_rate_idx)
  2920	{
  2921		struct rate_info *txrate = &arsta->txrate;
  2922		struct ath10k_htt_tx_stats *tx_stats;
  2923		int idx, ht_idx, gi, mcs, bw, nss;
  2924		unsigned long flags;
  2925		int rtable_bw;
  2926	
  2927		if (!arsta->tx_stats)
  2928			return;
  2929	
  2930		tx_stats = arsta->tx_stats;
  2931		flags = txrate->flags;
  2932		gi = test_bit(ATH10K_RATE_INFO_FLAGS_SGI_BIT, &flags);
  2933		mcs = ATH10K_HW_MCS_RATE(pstats->ratecode);
> 2934		rtable_bw = ath10k_get_bw(&ar->hw_params, pstats->flags);

2935 bw = txrate->bw;
2936 nss = txrate->nss;
2937 ht_idx = mcs + (nss - 1) * 8;
2938 idx = mcs * 8 + 8 * 10 * (nss - 1);
2939 idx += rtable_bw * 2 + gi;
2940

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

_______________________________________________
ath10k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath10k

#3 lore raw

Re: [PATCH 1/2] ath10k: Fix rate table updation in tx stats

In reply to Rakesh Pillai
Thank you for the patch! Yet something to improve:

Hi Rakesh,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on ath6kl/ath-next]
[also build test ERROR on next-20190306]
[cannot apply to v5.0]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Rakesh-Pillai/Fix-tx-stats-inconsistencies/20190312-061743
base:   https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git ath-next
config: xtensa-allyesconfig (attached as .config)
compiler: xtensa-linux-gcc (GCC) 8.2.0

reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
GCC_VERSION=8.2.0 make.cross ARCH=xtensa

All errors (new ones prefixed by >>):

drivers/net//wireless/ath/ath10k/htt_rx.c: In function 'ath10k_accumulate_per_peer_tx_stats':

>> drivers/net//wireless/ath/ath10k/htt_rx.c:2934:14: error: implicit declaration of function 'ath10k_get_bw'; did you mean 'ath10k_get_tid'? [-Werror=implicit-function-declaration]
     rtable_bw = ath10k_get_bw(&ar->hw_params, pstats->flags);
                 ^~~~~~~~~~~~~
                 ath10k_get_tid

cc1: some warnings being treated as errors

vim +2934 drivers/net//wireless/ath/ath10k/htt_rx.c

2914
2915 static void
2916 ath10k_accumulate_per_peer_tx_stats(struct ath10k *ar,

  2917					    struct ath10k_sta *arsta,
  2918					    struct ath10k_per_peer_tx_stats *pstats,
  2919					    s8 legacy_rate_idx)
  2920	{
  2921		struct rate_info *txrate = &arsta->txrate;
  2922		struct ath10k_htt_tx_stats *tx_stats;
  2923		int idx, ht_idx, gi, mcs, bw, nss;
  2924		unsigned long flags;
  2925		int rtable_bw;
  2926	
  2927		if (!arsta->tx_stats)
  2928			return;
  2929	
  2930		tx_stats = arsta->tx_stats;
  2931		flags = txrate->flags;
  2932		gi = test_bit(ATH10K_RATE_INFO_FLAGS_SGI_BIT, &flags);
  2933		mcs = ATH10K_HW_MCS_RATE(pstats->ratecode);
> 2934		rtable_bw = ath10k_get_bw(&ar->hw_params, pstats->flags);

2935 bw = txrate->bw;
2936 nss = txrate->nss;
2937 ht_idx = mcs + (nss - 1) * 8;
2938 idx = mcs * 8 + 8 * 10 * (nss - 1);
2939 idx += rtable_bw * 2 + gi;
2940

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

_______________________________________________
ath10k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath10k

#4 lore raw

Re: [PATCH 1/2] ath10k: Fix rate table updation in tx stats

In reply to Rakesh Pillai
Quoted 5 lines · Rakesh Pillai

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.

Quoted 8 lines

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

Fails to compile:

drivers/net/wireless/ath/ath10k/htt_rx.c: In function 'ath10k_accumulate_per_peer_tx_stats':
drivers/net/wireless/ath/ath10k/htt_rx.c:3252:14: error: implicit declaration of function 'ath10k_get_bw'; did you mean 'ath10k_get_tid'? [-Werror=implicit-function-declaration]

  rtable_bw = ath10k_get_bw(&ar->hw_params, pstats->flags);
              ^~~~~~~~~~~~~
              ath10k_get_tid

cc1: some warnings being treated as errors
make[5]: *** [drivers/net/wireless/ath/ath10k/htt_rx.o] Error 1 make[4]: *** [drivers/net/wireless/ath/ath10k] Error 2 make[3]: *** [drivers/net/wireless/ath] Error 2 make[2]: *** [drivers/net/wireless] Error 2
make[1]: *** [drivers/net] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [drivers] Error 2

2 patches set to Changes Requested.

10847733 [1/2] ath10k: Fix rate table updation in tx stats 10847737 [2/2] ath10k: Fix NSS tx stats for legacy rates

Signature · 9 lines
https://patchwork.kernel.org/patch/10847733/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


_______________________________________________
ath10k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath10k
#5 lore raw

Re: [PATCH 1/2] ath10k: Fix rate table updation in tx stats

In reply to Rakesh Pillai
Quoted 5 lines · Rakesh Pillai

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.

Quoted 8 lines

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

Fails to compile:

drivers/net/wireless/ath/ath10k/htt_rx.c: In function 'ath10k_accumulate_per_peer_tx_stats':
drivers/net/wireless/ath/ath10k/htt_rx.c:3252:14: error: implicit declaration of function 'ath10k_get_bw'; did you mean 'ath10k_get_tid'? [-Werror=implicit-function-declaration]

  rtable_bw = ath10k_get_bw(&ar->hw_params, pstats->flags);
              ^~~~~~~~~~~~~
              ath10k_get_tid

cc1: some warnings being treated as errors
make[5]: *** [drivers/net/wireless/ath/ath10k/htt_rx.o] Error 1 make[4]: *** [drivers/net/wireless/ath/ath10k] Error 2 make[3]: *** [drivers/net/wireless/ath] Error 2 make[2]: *** [drivers/net/wireless] Error 2
make[1]: *** [drivers/net] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [drivers] Error 2

2 patches set to Changes Requested.

10847733 [1/2] ath10k: Fix rate table updation in tx stats 10847737 [2/2] ath10k: Fix NSS tx stats for legacy rates

Signature · 3 lines
https://patchwork.kernel.org/patch/10847733/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
#7 lore raw

Re: [PATCH 1/2] ath10k: Fix rate table updation in tx stats

In reply to a message not in the archive

Hi Kalle,

This set of patches is dependent on https://patchwork.kernel.org/patch/10831319/
I can send out v2 for this patchset, marking the dependency, if needed.

Thanks,
Rakesh Pillai.

Quoted 39 lines · Kalle Valo
Quoted 5 lines · Rakesh Pillai

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.

Quoted 8 lines

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

Fails to compile:

drivers/net/wireless/ath/ath10k/htt_rx.c: In function 'ath10k_accumulate_per_peer_tx_stats':
drivers/net/wireless/ath/ath10k/htt_rx.c:3252:14: error: implicit declaration of function 'ath10k_get_bw'; did you mean 'ath10k_get_tid'? [-Werror=implicit-function-declaration]

  rtable_bw = ath10k_get_bw(&ar->hw_params, pstats->flags);
              ^~~~~~~~~~~~~
              ath10k_get_tid

cc1: some warnings being treated as errors
make[5]: *** [drivers/net/wireless/ath/ath10k/htt_rx.o] Error 1 make[4]: *** [drivers/net/wireless/ath/ath10k] Error 2 make[3]: *** [drivers/net/wireless/ath] Error 2 make[2]: *** [drivers/net/wireless] Error 2
make[1]: *** [drivers/net] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [drivers] Error 2

2 patches set to Changes Requested.

10847733 [1/2] ath10k: Fix rate table updation in tx stats 10847737 [2/2] ath10k: Fix NSS tx stats for legacy rates

#8 lore raw

Re: [PATCH 1/2] ath10k: Fix rate table updation in tx stats

(please don't top post, fixing that manually)

Quoted 28 lines · Rakesh Pillai
Quoted 18 lines · Kalle Valo
Quoted 5 lines · Rakesh Pillai

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.

Quoted 8 lines

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

Fails to compile:

Quoted 8 lines

drivers/net/wireless/ath/ath10k/htt_rx.c: In function 'ath10k_accumulate_per_peer_tx_stats':
drivers/net/wireless/ath/ath10k/htt_rx.c:3252:14: error: implicit declaration of function 'ath10k_get_bw'; did you mean 'ath10k_get_tid'? [-Werror=implicit-function-declaration]

  rtable_bw = ath10k_get_bw(&ar->hw_params, pstats->flags);
              ^~~~~~~~~~~~~
              ath10k_get_tid
Quoted 3 lines

This set of patches is dependent on
https://patchwork.kernel.org/patch/10831319/
I can send out v2 for this patchset, marking the dependency, if needed.

Ok, I added this patchset back to my queue. No need to resend.

Signature · 6 lines
Kalle Valo

_______________________________________________
ath10k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath10k
#9 lore raw

Re: [PATCH 1/2] ath10k: Fix rate table updation in tx stats

In reply to Rakesh Pillai
Quoted 8 lines · Rakesh Pillai

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.

Quoted 6 lines

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

Fixes e88975ca37d1 ("ath10k: dump tx stats in rate table format")

I requested Surabhi to include these patches into his patchset, due to the dependency.

https://patchwork.kernel.org/project/linux-wireless/list/?series=85455&state=*&order=date

2 patches set to Changes Requested.

10847733 [1/2] ath10k: Fix rate table updation in tx stats 10847737 [2/2] ath10k: Fix NSS tx stats for legacy rates

Signature · 9 lines
https://patchwork.kernel.org/patch/10847733/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


_______________________________________________
ath10k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath10k
#10 lore raw

Re: [PATCH 1/2] ath10k: Fix rate table updation in tx stats

In reply to Rakesh Pillai
Quoted 8 lines · Rakesh Pillai

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.

Quoted 6 lines

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

Fixes e88975ca37d1 ("ath10k: dump tx stats in rate table format")

I requested Surabhi to include these patches into his patchset, due to the dependency.

https://patchwork.kernel.org/project/linux-wireless/list/?series=85455&state=*&order=date

2 patches set to Changes Requested.

10847733 [1/2] ath10k: Fix rate table updation in tx stats 10847737 [2/2] ath10k: Fix NSS tx stats for legacy rates

Signature · 3 lines
https://patchwork.kernel.org/patch/10847733/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches