2021-07-21 21:22:42

by Jouni Malinen

[permalink] [raw]
Subject: [PATCH 10/12] ath11k: Send PPDU_STATS_CFG with proper pdev mask to firmware

From: Rameshkumar Sundaram <[email protected]>

HTT_PPDU_STATS_CFG_PDEV_ID bit mask for target FW PPDU stats request
message was set as bit 8 to 15. Bit 8 is reserved for soc stats and
pdev id starts from bit 9. Hence change the bitmask as bit 9 to 15
and fill the proper pdev id in the request message.

Tested on: IPQ8074 hw2.0 AHB WLAN.HK.2.5.0.1-01092-QCAHKSWPL_SILICONZ-1
Tested on: IPQ6018 hw1.0 WLAN.HK.2.5.0.1-01067-QCAHKSWPL_SILICONZ-1

Fixes: 701e48a43e15 ("ath11k: add packet log support for QCA6390")

Co-developed-by: Sathishkumar Muruganandam <[email protected]>
Signed-off-by: Sathishkumar Muruganandam <[email protected]>
Signed-off-by: Rameshkumar Sundaram <[email protected]>
Signed-off-by: Jouni Malinen <[email protected]>
---
drivers/net/wireless/ath/ath11k/dp.h | 3 ++-
drivers/net/wireless/ath/ath11k/dp_tx.c | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath11k/dp.h b/drivers/net/wireless/ath/ath11k/dp.h
index b2e7621969c5..522d3a6ce253 100644
--- a/drivers/net/wireless/ath/ath11k/dp.h
+++ b/drivers/net/wireless/ath/ath11k/dp.h
@@ -541,7 +541,8 @@ struct htt_ppdu_stats_cfg_cmd {
} __packed;

#define HTT_PPDU_STATS_CFG_MSG_TYPE GENMASK(7, 0)
-#define HTT_PPDU_STATS_CFG_PDEV_ID GENMASK(15, 8)
+#define HTT_PPDU_STATS_CFG_SOC_STATS BIT(8)
+#define HTT_PPDU_STATS_CFG_PDEV_ID GENMASK(15, 9)
#define HTT_PPDU_STATS_CFG_TLV_TYPE_BITMASK GENMASK(31, 16)

enum htt_ppdu_stats_tag_type {
diff --git a/drivers/net/wireless/ath/ath11k/dp_tx.c b/drivers/net/wireless/ath/ath11k/dp_tx.c
index b00e78de36bc..125a9a8a5b0a 100644
--- a/drivers/net/wireless/ath/ath11k/dp_tx.c
+++ b/drivers/net/wireless/ath/ath11k/dp_tx.c
@@ -906,7 +906,7 @@ int ath11k_dp_tx_htt_h2t_ppdu_stats_req(struct ath11k *ar, u32 mask)
cmd->msg = FIELD_PREP(HTT_PPDU_STATS_CFG_MSG_TYPE,
HTT_H2T_MSG_TYPE_PPDU_STATS_CFG);

- pdev_mask = 1 << (i + 1);
+ pdev_mask = 1 << (ar->pdev_idx + i);
cmd->msg |= FIELD_PREP(HTT_PPDU_STATS_CFG_PDEV_ID, pdev_mask);
cmd->msg |= FIELD_PREP(HTT_PPDU_STATS_CFG_TLV_TYPE_BITMASK, mask);

--
2.25.1


2021-09-28 10:48:04

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH 10/12] ath11k: Send PPDU_STATS_CFG with proper pdev mask to firmware

Jouni Malinen <[email protected]> writes:

> From: Rameshkumar Sundaram <[email protected]>
>
> HTT_PPDU_STATS_CFG_PDEV_ID bit mask for target FW PPDU stats request
> message was set as bit 8 to 15. Bit 8 is reserved for soc stats and
> pdev id starts from bit 9. Hence change the bitmask as bit 9 to 15
> and fill the proper pdev id in the request message.
>
> Tested on: IPQ8074 hw2.0 AHB WLAN.HK.2.5.0.1-01092-QCAHKSWPL_SILICONZ-1
> Tested on: IPQ6018 hw1.0 WLAN.HK.2.5.0.1-01067-QCAHKSWPL_SILICONZ-1
>
> Fixes: 701e48a43e15 ("ath11k: add packet log support for QCA6390")
>
> Co-developed-by: Sathishkumar Muruganandam <[email protected]>
> Signed-off-by: Sathishkumar Muruganandam <[email protected]>
> Signed-off-by: Rameshkumar Sundaram <[email protected]>
> Signed-off-by: Jouni Malinen <[email protected]>
> ---
> drivers/net/wireless/ath/ath11k/dp.h | 3 ++-
> drivers/net/wireless/ath/ath11k/dp_tx.c | 2 +-
> 2 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath11k/dp.h b/drivers/net/wireless/ath/ath11k/dp.h
> index b2e7621969c5..522d3a6ce253 100644
> --- a/drivers/net/wireless/ath/ath11k/dp.h
> +++ b/drivers/net/wireless/ath/ath11k/dp.h
> @@ -541,7 +541,8 @@ struct htt_ppdu_stats_cfg_cmd {
> } __packed;
>
> #define HTT_PPDU_STATS_CFG_MSG_TYPE GENMASK(7, 0)
> -#define HTT_PPDU_STATS_CFG_PDEV_ID GENMASK(15, 8)
> +#define HTT_PPDU_STATS_CFG_SOC_STATS BIT(8)
> +#define HTT_PPDU_STATS_CFG_PDEV_ID GENMASK(15, 9)

This part is clear after reading the commit log.

> --- a/drivers/net/wireless/ath/ath11k/dp_tx.c
> +++ b/drivers/net/wireless/ath/ath11k/dp_tx.c
> @@ -906,7 +906,7 @@ int ath11k_dp_tx_htt_h2t_ppdu_stats_req(struct ath11k *ar, u32 mask)
> cmd->msg = FIELD_PREP(HTT_PPDU_STATS_CFG_MSG_TYPE,
> HTT_H2T_MSG_TYPE_PPDU_STATS_CFG);
>
> - pdev_mask = 1 << (i + 1);
> + pdev_mask = 1 << (ar->pdev_idx + i);
> cmd->msg |= FIELD_PREP(HTT_PPDU_STATS_CFG_PDEV_ID, pdev_mask);
> cmd->msg |= FIELD_PREP(HTT_PPDU_STATS_CFG_TLV_TYPE_BITMASK, mask);

But this part isn't. All I can see in the commit log is a vague comment
"and fill the proper pdev id in the request message" and nothing else.
Please provide a proper explanation for this change and I can then add
that to the commit log.

--
https://patchwork.kernel.org/project/linux-wireless/list/

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

2021-09-28 12:03:23

by Rameshkumar Sundaram

[permalink] [raw]
Subject: Re: [PATCH 10/12] ath11k: Send PPDU_STATS_CFG with proper pdev mask to firmware

On 2021-09-28 16:16, Kalle Valo wrote:
> Jouni Malinen <[email protected]> writes:
>
>> From: Rameshkumar Sundaram <[email protected]>
>>
>> HTT_PPDU_STATS_CFG_PDEV_ID bit mask for target FW PPDU stats request
>> message was set as bit 8 to 15. Bit 8 is reserved for soc stats and
>> pdev id starts from bit 9. Hence change the bitmask as bit 9 to 15
>> and fill the proper pdev id in the request message.
>>
>> Tested on: IPQ8074 hw2.0 AHB
>> WLAN.HK.2.5.0.1-01092-QCAHKSWPL_SILICONZ-1
>> Tested on: IPQ6018 hw1.0 WLAN.HK.2.5.0.1-01067-QCAHKSWPL_SILICONZ-1
>>
>> Fixes: 701e48a43e15 ("ath11k: add packet log support for QCA6390")
>>
>> Co-developed-by: Sathishkumar Muruganandam <[email protected]>
>> Signed-off-by: Sathishkumar Muruganandam <[email protected]>
>> Signed-off-by: Rameshkumar Sundaram <[email protected]>
>> Signed-off-by: Jouni Malinen <[email protected]>
>> ---
>> drivers/net/wireless/ath/ath11k/dp.h | 3 ++-
>> drivers/net/wireless/ath/ath11k/dp_tx.c | 2 +-
>> 2 files changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/net/wireless/ath/ath11k/dp.h
>> b/drivers/net/wireless/ath/ath11k/dp.h
>> index b2e7621969c5..522d3a6ce253 100644
>> --- a/drivers/net/wireless/ath/ath11k/dp.h
>> +++ b/drivers/net/wireless/ath/ath11k/dp.h
>> @@ -541,7 +541,8 @@ struct htt_ppdu_stats_cfg_cmd {
>> } __packed;
>>
>> #define HTT_PPDU_STATS_CFG_MSG_TYPE GENMASK(7, 0)
>> -#define HTT_PPDU_STATS_CFG_PDEV_ID GENMASK(15, 8)
>> +#define HTT_PPDU_STATS_CFG_SOC_STATS BIT(8)
>> +#define HTT_PPDU_STATS_CFG_PDEV_ID GENMASK(15, 9)
>
> This part is clear after reading the commit log.
>
>> --- a/drivers/net/wireless/ath/ath11k/dp_tx.c
>> +++ b/drivers/net/wireless/ath/ath11k/dp_tx.c
>> @@ -906,7 +906,7 @@ int ath11k_dp_tx_htt_h2t_ppdu_stats_req(struct
>> ath11k *ar, u32 mask)
>> cmd->msg = FIELD_PREP(HTT_PPDU_STATS_CFG_MSG_TYPE,
>> HTT_H2T_MSG_TYPE_PPDU_STATS_CFG);
>>
>> - pdev_mask = 1 << (i + 1);
>> + pdev_mask = 1 << (ar->pdev_idx + i);
>> cmd->msg |= FIELD_PREP(HTT_PPDU_STATS_CFG_PDEV_ID, pdev_mask);
>> cmd->msg |= FIELD_PREP(HTT_PPDU_STATS_CFG_TLV_TYPE_BITMASK, mask);
>
> But this part isn't. All I can see in the commit log is a vague comment
> "and fill the proper pdev id in the request message" and nothing else.
> Please provide a proper explanation for this change and I can then add
> that to the commit log.

Hi Kalle,
In patch 701e48a43e15 ("ath11k: add packet log support for QCA6390") ,
both HTT_PPDU_STATS_CFG_PDEV_ID and pdev_mask were changed, but this
pdev_mask calculation
is not valid for platforms which has multiple pdevs with 1 rxdma per
pdev, as this is writing same value(i.e. 2) for all pdevs.
Hence fixed it to consider pdev_idx as well, to make it compatible for
both single and multi pd cases.

2021-11-12 08:01:44

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH 10/12] ath11k: Send PPDU_STATS_CFG with proper pdev mask to firmware

Jouni Malinen <[email protected]> wrote:

> HTT_PPDU_STATS_CFG_PDEV_ID bit mask for target FW PPDU stats request message
> was set as bit 8 to 15. Bit 8 is reserved for soc stats and pdev id starts from
> bit 9. Hence change the bitmask as bit 9 to 15 and fill the proper pdev id in
> the request message.
>
> In commit 701e48a43e15 ("ath11k: add packet log support for QCA6390"), both
> HTT_PPDU_STATS_CFG_PDEV_ID and pdev_mask were changed, but this pdev_mask
> calculation is not valid for platforms which has multiple pdevs with 1 rxdma
> per pdev, as this is writing same value(i.e. 2) for all pdevs. Hence fixed it
> to consider pdev_idx as well, to make it compatible for both single and multi
> pd cases.
>
> Tested on: IPQ8074 hw2.0 AHB WLAN.HK.2.5.0.1-01092-QCAHKSWPL_SILICONZ-1
> Tested on: IPQ6018 hw1.0 WLAN.HK.2.5.0.1-01067-QCAHKSWPL_SILICONZ-1
>
> Fixes: 701e48a43e15 ("ath11k: add packet log support for QCA6390")
>
> Co-developed-by: Sathishkumar Muruganandam <[email protected]>
> Signed-off-by: Sathishkumar Muruganandam <[email protected]>
> Signed-off-by: Rameshkumar Sundaram <[email protected]>
> Signed-off-by: Jouni Malinen <[email protected]>
> Signed-off-by: Kalle Valo <[email protected]>

Patch applied to ath-next branch of ath.git, thanks.

16a2c3d5406f ath11k: Send PPDU_STATS_CFG with proper pdev mask to firmware

--
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/

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