diff mbox series

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

Message ID 1552319602-17795-2-git-send-email-pillair@codeaurora.org (mailing list archive)
State New, archived
Headers show
Series Fix tx stats inconsistencies | expand

Commit Message

Rakesh Pillai March 11, 2019, 3:53 p.m. UTC
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(-)

Comments

kernel test robot March 11, 2019, 10:58 p.m. UTC | #1
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
kernel test robot March 11, 2019, 11:01 p.m. UTC | #2
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
Kalle Valo May 3, 2019, 6 a.m. UTC | #3
Rakesh Pillai <pillair@codeaurora.org> 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 <pillair@codeaurora.org>

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
Rakesh Pillai May 3, 2019, 6:56 a.m. UTC | #4
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 <pillair@codeaurora.org> 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 <pillair@codeaurora.org>
> 
> 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
Kalle Valo May 3, 2019, 7:04 a.m. UTC | #5
(please don't top post, fixing that manually)

Rakesh Pillai <pillair@codeaurora.org> writes:

> On 2019-05-03 11:30, Kalle Valo wrote:
>> Rakesh Pillai <pillair@codeaurora.org> 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 <pillair@codeaurora.org>
>>
>> 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 Sept. 23, 2019, 8:22 a.m. UTC | #6
Rakesh Pillai <pillair@codeaurora.org> 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 <pillair@codeaurora.org>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

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
diff mbox series

Patch

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]