2019-03-11 15:53:32

by Rakesh Pillai

[permalink] [raw]
Subject: [PATCH 0/2] 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(-)

--
2.7.4



2019-03-11 15:53:34

by Rakesh Pillai

[permalink] [raw]
Subject: [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")
Signed-off-by: Rakesh Pillai <[email protected]>
---
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


2019-03-11 15:53:36

by Rakesh Pillai

[permalink] [raw]
Subject: [PATCH 2/2] ath10k: Fix NSS tx stats for legacy rates

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 <[email protected]>
---
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


2019-03-11 22:59:37

by kernel test robot

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

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


Attachments:
(No filename) (2.31 kB)
.config.gz (48.75 kB)
Download all attachments

2019-03-11 23:02:37

by kernel test robot

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

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


Attachments:
(No filename) (2.36 kB)
.config.gz (55.02 kB)
Download all attachments

2019-05-03 06:04:06

by Kalle Valo

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

Rakesh Pillai <[email protected]> wrote:

> 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 <[email protected]>

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

--
https://patchwork.kernel.org/patch/10847733/

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

2019-05-03 07:00:30

by Rakesh Pillai

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

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.


On 2019-05-03 11:30, Kalle Valo wrote:
> Rakesh Pillai <[email protected]> wrote:
>
>> 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 <[email protected]>
>
> 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

2019-05-03 07:06:21

by Kalle Valo

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

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

Rakesh Pillai <[email protected]> writes:

> On 2019-05-03 11:30, Kalle Valo wrote:
>> Rakesh Pillai <[email protected]> wrote:
>>
>>> 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 <[email protected]>
>>
>> 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
>
> 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.

--
Kalle Valo

2019-09-24 16:51:00

by Kalle Valo

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

Rakesh Pillai <[email protected]> wrote:

> 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 <[email protected]>
> Signed-off-by: Kalle Valo <[email protected]>

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

--
https://patchwork.kernel.org/patch/10847733/

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