* [PATCH] wifi: ath12k: remove return for empty tx bitrate in mac_op_sta_statistics
@ 2025-01-17 19:30 Remi Pommarel
2025-01-20 4:39 ` Aditya Kumar Singh
2025-01-26 18:31 ` Jeff Johnson
0 siblings, 2 replies; 4+ messages in thread
From: Remi Pommarel @ 2025-01-17 19:30 UTC (permalink / raw)
To: ath12k, linux-wireless, linux-kernel
Cc: Kalle Valo, Jeff Johnson, Remi Pommarel
Currently in ath12k_mac_op_sta_statistics() there is the following
logic:
if (!arsta->txrate.legacy && !arsta->txrate.nss)
return;
Because ath12k_sta_statistics is used to report many info to iw wlan0 link,
if it return for empty legacy and nss of arsta->txrate, then the other
stats after it will not be set.
To address this issue remove the return and instead invert the logic to set
the txrate logic if (arsta->txrate.legacy || arsta->txrate.nss).
The same was done also in both ath10k with commit 1cd6ba8ae33e ("ath10k:
remove return for NL80211_STA_INFO_TX_BITRATE") and ath11k as well with
commit 1d795645e1ee ("ath11k: remove return for empty tx bitrate in
mac_op_sta_statistics").
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1
Signed-off-by: Remi Pommarel <repk@triplefau.lt>
---
drivers/net/wireless/ath/ath12k/mac.c | 29 +++++++++++++--------------
1 file changed, 14 insertions(+), 15 deletions(-)
diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c
index d493ec812055..cbc79ec7ac47 100644
--- a/drivers/net/wireless/ath/ath12k/mac.c
+++ b/drivers/net/wireless/ath/ath12k/mac.c
@@ -8912,21 +8912,20 @@ static void ath12k_mac_op_sta_statistics(struct ieee80211_hw *hw,
sinfo->tx_duration = arsta->tx_duration;
sinfo->filled |= BIT_ULL(NL80211_STA_INFO_TX_DURATION);
- if (!arsta->txrate.legacy && !arsta->txrate.nss)
- return;
-
- if (arsta->txrate.legacy) {
- sinfo->txrate.legacy = arsta->txrate.legacy;
- } else {
- sinfo->txrate.mcs = arsta->txrate.mcs;
- sinfo->txrate.nss = arsta->txrate.nss;
- sinfo->txrate.bw = arsta->txrate.bw;
- sinfo->txrate.he_gi = arsta->txrate.he_gi;
- sinfo->txrate.he_dcm = arsta->txrate.he_dcm;
- sinfo->txrate.he_ru_alloc = arsta->txrate.he_ru_alloc;
- }
- sinfo->txrate.flags = arsta->txrate.flags;
- sinfo->filled |= BIT_ULL(NL80211_STA_INFO_TX_BITRATE);
+ if (arsta->txrate.legacy || arsta->txrate.nss) {
+ if (arsta->txrate.legacy) {
+ sinfo->txrate.legacy = arsta->txrate.legacy;
+ } else {
+ sinfo->txrate.mcs = arsta->txrate.mcs;
+ sinfo->txrate.nss = arsta->txrate.nss;
+ sinfo->txrate.bw = arsta->txrate.bw;
+ sinfo->txrate.he_gi = arsta->txrate.he_gi;
+ sinfo->txrate.he_dcm = arsta->txrate.he_dcm;
+ sinfo->txrate.he_ru_alloc = arsta->txrate.he_ru_alloc;
+ }
+ sinfo->txrate.flags = arsta->txrate.flags;
+ sinfo->filled |= BIT_ULL(NL80211_STA_INFO_TX_BITRATE);
+ }
/* TODO: Use real NF instead of default one. */
sinfo->signal = arsta->rssi_comb + ATH12K_DEFAULT_NOISE_FLOOR;
--
2.40.0
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] wifi: ath12k: remove return for empty tx bitrate in mac_op_sta_statistics
2025-01-17 19:30 [PATCH] wifi: ath12k: remove return for empty tx bitrate in mac_op_sta_statistics Remi Pommarel
@ 2025-01-20 4:39 ` Aditya Kumar Singh
2025-01-26 18:18 ` Jeff Johnson
2025-01-26 18:31 ` Jeff Johnson
1 sibling, 1 reply; 4+ messages in thread
From: Aditya Kumar Singh @ 2025-01-20 4:39 UTC (permalink / raw)
To: ath12k
On 1/18/25 01:00, Remi Pommarel wrote:
> Currently in ath12k_mac_op_sta_statistics() there is the following
> logic:
>
> if (!arsta->txrate.legacy && !arsta->txrate.nss)
> return;
>
> Because ath12k_sta_statistics is used to report many info to iw wlan0 link,
> if it return for empty legacy and nss of arsta->txrate, then the other
> stats after it will not be set.
>
> To address this issue remove the return and instead invert the logic to set
> the txrate logic if (arsta->txrate.legacy || arsta->txrate.nss).
>
> The same was done also in both ath10k with commit 1cd6ba8ae33e ("ath10k:
> remove return for NL80211_STA_INFO_TX_BITRATE") and ath11k as well with
> commit 1d795645e1ee ("ath11k: remove return for empty tx bitrate in
> mac_op_sta_statistics").
>
> Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1
nit: An empty line after Tested-on tag since that's not an official tag.
It is ath specific tag. But I guess Jeff can fix this in pending?
> Signed-off-by: Remi Pommarel<repk@triplefau.lt>
> ---
Anyways, patch LGTM so
Reviewed-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
Lastly, one more nit - please include base commit in future submissions :)
--
Aditya
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] wifi: ath12k: remove return for empty tx bitrate in mac_op_sta_statistics
2025-01-20 4:39 ` Aditya Kumar Singh
@ 2025-01-26 18:18 ` Jeff Johnson
0 siblings, 0 replies; 4+ messages in thread
From: Jeff Johnson @ 2025-01-26 18:18 UTC (permalink / raw)
To: Aditya Kumar Singh, ath12k
On 1/19/2025 8:39 PM, Aditya Kumar Singh wrote:
> On 1/18/25 01:00, Remi Pommarel wrote:
>> Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1
>
> nit: An empty line after Tested-on tag since that's not an official tag.
> It is ath specific tag. But I guess Jeff can fix this in pending?
Yes, I can do that
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] wifi: ath12k: remove return for empty tx bitrate in mac_op_sta_statistics
2025-01-17 19:30 [PATCH] wifi: ath12k: remove return for empty tx bitrate in mac_op_sta_statistics Remi Pommarel
2025-01-20 4:39 ` Aditya Kumar Singh
@ 2025-01-26 18:31 ` Jeff Johnson
1 sibling, 0 replies; 4+ messages in thread
From: Jeff Johnson @ 2025-01-26 18:31 UTC (permalink / raw)
To: Remi Pommarel, ath12k, linux-wireless, linux-kernel
Cc: Kalle Valo, Jeff Johnson
On 1/17/2025 11:30 AM, Remi Pommarel wrote:
> Currently in ath12k_mac_op_sta_statistics() there is the following
> logic:
>
> if (!arsta->txrate.legacy && !arsta->txrate.nss)
> return;
>
> Because ath12k_sta_statistics is used to report many info to iw wlan0 link,
> if it return for empty legacy and nss of arsta->txrate, then the other
> stats after it will not be set.
>
> To address this issue remove the return and instead invert the logic to set
> the txrate logic if (arsta->txrate.legacy || arsta->txrate.nss).
>
> The same was done also in both ath10k with commit 1cd6ba8ae33e ("ath10k:
> remove return for NL80211_STA_INFO_TX_BITRATE") and ath11k as well with
> commit 1d795645e1ee ("ath11k: remove return for empty tx bitrate in
> mac_op_sta_statistics").
>
> Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1
> Signed-off-by: Remi Pommarel <repk@triplefau.lt>
> ---
> drivers/net/wireless/ath/ath12k/mac.c | 29 +++++++++++++--------------
> 1 file changed, 14 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c
> index d493ec812055..cbc79ec7ac47 100644
> --- a/drivers/net/wireless/ath/ath12k/mac.c
> +++ b/drivers/net/wireless/ath/ath12k/mac.c
> @@ -8912,21 +8912,20 @@ static void ath12k_mac_op_sta_statistics(struct ieee80211_hw *hw,
> sinfo->tx_duration = arsta->tx_duration;
> sinfo->filled |= BIT_ULL(NL80211_STA_INFO_TX_DURATION);
>
> - if (!arsta->txrate.legacy && !arsta->txrate.nss)
> - return;
> -
> - if (arsta->txrate.legacy) {
> - sinfo->txrate.legacy = arsta->txrate.legacy;
> - } else {
> - sinfo->txrate.mcs = arsta->txrate.mcs;
> - sinfo->txrate.nss = arsta->txrate.nss;
> - sinfo->txrate.bw = arsta->txrate.bw;
> - sinfo->txrate.he_gi = arsta->txrate.he_gi;
> - sinfo->txrate.he_dcm = arsta->txrate.he_dcm;
> - sinfo->txrate.he_ru_alloc = arsta->txrate.he_ru_alloc;
> - }
> - sinfo->txrate.flags = arsta->txrate.flags;
> - sinfo->filled |= BIT_ULL(NL80211_STA_INFO_TX_BITRATE);
> + if (arsta->txrate.legacy || arsta->txrate.nss) {
> + if (arsta->txrate.legacy) {
> + sinfo->txrate.legacy = arsta->txrate.legacy;
> + } else {
> + sinfo->txrate.mcs = arsta->txrate.mcs;
> + sinfo->txrate.nss = arsta->txrate.nss;
> + sinfo->txrate.bw = arsta->txrate.bw;
> + sinfo->txrate.he_gi = arsta->txrate.he_gi;
> + sinfo->txrate.he_dcm = arsta->txrate.he_dcm;
> + sinfo->txrate.he_ru_alloc = arsta->txrate.he_ru_alloc;
> + }
> + sinfo->txrate.flags = arsta->txrate.flags;
> + sinfo->filled |= BIT_ULL(NL80211_STA_INFO_TX_BITRATE);
> + }
>
> /* TODO: Use real NF instead of default one. */
> sinfo->signal = arsta->rssi_comb + ATH12K_DEFAULT_NOISE_FLOOR;
This patch conflicts with the following that is in the pending branch:
https://patchwork.kernel.org/project/linux-wireless/patch/20250115063537.35797-2-quic_lingbok@quicinc.com/
The pending patch adds eht settings:
+ sinfo->txrate.eht_gi = arsta->txrate.eht_gi;
+ sinfo->txrate.eht_ru_alloc = arsta->txrate.eht_ru_alloc;
The pending branch will be promoted to ath-next & main soon, so please rebase
after that occurs
/jeff
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-01-26 18:31 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-17 19:30 [PATCH] wifi: ath12k: remove return for empty tx bitrate in mac_op_sta_statistics Remi Pommarel
2025-01-20 4:39 ` Aditya Kumar Singh
2025-01-26 18:18 ` Jeff Johnson
2025-01-26 18:31 ` Jeff Johnson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox