ath10k.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] ath10k: correct tx/rx bitrate for QCA6174 PCIe and SDIO
@ 2020-08-13  9:47 Wen Gong
  2020-08-13  9:47 ` [PATCH 1/3] ath10k: add wmi service peer stat info for wmi tlv Wen Gong
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Wen Gong @ 2020-08-13  9:47 UTC (permalink / raw)
  To: ath10k; +Cc: linux-wireless, wgong

iw wlan0 station dump not show the correct tx/rx bitrate of QCA6174
PCIe and SDIO, it is because it has 1 check for WMI_SERVICE_PEER_STATS
and 1 return for empty arsta->txrate, so change to pass the check and
remove the return, then iw wlan0 station dump show correct tx/rx bitrate
for QCA6174 SDIO.

After that, set true for supports_peer_stats_info of QCA6174 PCIe, then
it show same correct tx/rx bitrate.

Wen Gong (3):
  ath10k: add wmi service peer stat info for wmi tlv
  ath10k: remove return for NL80211_STA_INFO_TX_BITRATE
  ath10k: enable supports_peer_stats_info for QCA6174 PCI devices

 drivers/net/wireless/ath/ath10k/core.c    |  1 +
 drivers/net/wireless/ath/ath10k/mac.c     | 21 ++++++++++-----------
 drivers/net/wireless/ath/ath10k/wmi-tlv.h |  2 ++
 3 files changed, 13 insertions(+), 11 deletions(-)

-- 
2.23.0


_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/3] ath10k: add wmi service peer stat info for wmi tlv
  2020-08-13  9:47 [PATCH 0/3] ath10k: correct tx/rx bitrate for QCA6174 PCIe and SDIO Wen Gong
@ 2020-08-13  9:47 ` Wen Gong
  2020-08-15  7:05   ` Kalle Valo
  2020-08-13  9:47 ` [PATCH 2/3] ath10k: remove return for NL80211_STA_INFO_TX_BITRATE Wen Gong
  2020-08-13  9:47 ` [PATCH 3/3] ath10k: enable supports_peer_stats_info for QCA6174 PCI devices Wen Gong
  2 siblings, 1 reply; 5+ messages in thread
From: Wen Gong @ 2020-08-13  9:47 UTC (permalink / raw)
  To: ath10k; +Cc: linux-wireless, wgong

ath10k_sta_statistics is used to report info for iw wlan0 link,
it check ath10k_peer_stats_enabled, and ath10k_peer_stats_enabled
check WMI_SERVICE_PEER_STATS bit of ar->wmi.svc_map. SVCMAP() for
WMI_SERVICE_PEER_STATS was defined only for wmi_10x_svc_map and
wmi_10_4_svc_map interfaces, it missed in wmi_tlv_svc_map, so it is
not usable for iw wlan0 link for wmi tlv interface.

If firmware report WMI_TLV_SERVICE_PEER_STATS_INFO for wmi tlv, then
enable the WMI_SERVICE_PEER_STATS bit in ath10k, and then it pass check
in ath10k_peer_stats_enabled and ath10k_sta_statistics pass check.

Tested-on: QCA6174 hw3.2 SDIO WLAN.RMH.4.4.1-00048
Tested-on: QCA6174 hw3.2 PCI WLAN.RM.4.4.1-00110-QCARMSWP-1

Signed-off-by: Wen Gong <wgong@codeaurora.org>
---
 drivers/net/wireless/ath/ath10k/wmi-tlv.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.h b/drivers/net/wireless/ath/ath10k/wmi-tlv.h
index e77b97ca5c7f..b39c9b78b32b 100644
--- a/drivers/net/wireless/ath/ath10k/wmi-tlv.h
+++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.h
@@ -1614,6 +1614,8 @@ wmi_tlv_svc_map(const __le32 *in, unsigned long *out, size_t len)
 	       WMI_SERVICE_MESH_11S, len);
 	SVCMAP(WMI_TLV_SERVICE_SYNC_DELETE_CMDS,
 	       WMI_SERVICE_SYNC_DELETE_CMDS, len);
+	SVCMAP(WMI_TLV_SERVICE_PEER_STATS_INFO,
+	       WMI_SERVICE_PEER_STATS, len);
 }
 
 static inline void
-- 
2.23.0


_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/3] ath10k: remove return for NL80211_STA_INFO_TX_BITRATE
  2020-08-13  9:47 [PATCH 0/3] ath10k: correct tx/rx bitrate for QCA6174 PCIe and SDIO Wen Gong
  2020-08-13  9:47 ` [PATCH 1/3] ath10k: add wmi service peer stat info for wmi tlv Wen Gong
@ 2020-08-13  9:47 ` Wen Gong
  2020-08-13  9:47 ` [PATCH 3/3] ath10k: enable supports_peer_stats_info for QCA6174 PCI devices Wen Gong
  2 siblings, 0 replies; 5+ messages in thread
From: Wen Gong @ 2020-08-13  9:47 UTC (permalink / raw)
  To: ath10k; +Cc: linux-wireless, wgong

ath10k_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.

It has 4 bit to set after the return:
NL80211_STA_INFO_TX_FAILED
NL80211_STA_INFO_RX_BITRATE
NL80211_STA_INFO_TX_BITRATE
NL80211_STA_INFO_TX_RETRIES

This patch not effect the info of above 4 bit for all hardware, reason
as below:

NL80211_STA_INFO_TX_FAILED is only for htt.disable_tx_comp is true, it
is for QCA6174 SDIO.

NL80211_STA_INFO_RX_BITRATE and NL80211_STA_INFO_TX_BITRATE are both
set in ath10k_mac_sta_get_peer_stats_info, it is only enabled for chips
which supports_peer_stats_info is true in hw_params, recently only for
QCA6174 SDIO, NL80211_STA_INFO_TX_BITRATE is set again in function
ath10k_mac_sta_get_peer_stats_info because the value which parsed from
arsta->tx_rate_code and arsta->tx_bitrate_kbps is correct for QCA6174
SDIO and PCIe, and the value arsta->txrate is not correct for QCA6174
SDIO and PCIe, so it need to set again with the correct value.

NL80211_STA_INFO_TX_RETRIES is use value of arsta->tx_retries, it is set
in ath10k_update_per_peer_tx_stats, which accumulate the retry_pkts in
HTT message from firmware, if the chips not support this feature, then
it is always 0 after accumulate, then iw wlan0 station dump always show
0 for retry count. If not set NL80211_STA_INFO_TX_RETRIES here, then it
is still 0, so the result is same, then set NL80211_STA_INFO_TX_RETRIES
has no effect.

Tested-on: QCA6174 hw3.2 SDIO WLAN.RMH.4.4.1-00048
Tested-on: QCA6174 hw3.2 PCI WLAN.RM.4.4.1-00110-QCARMSWP-1

Signed-off-by: Wen Gong <wgong@codeaurora.org>
---
 drivers/net/wireless/ath/ath10k/mac.c | 21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index 3e3896214e8b..4554a82d0105 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -8533,18 +8533,17 @@ static void ath10k_sta_statistics(struct ieee80211_hw *hw,
 	sinfo->rx_duration = arsta->rx_duration;
 	sinfo->filled |= BIT_ULL(NL80211_STA_INFO_RX_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;
+	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.flags = arsta->txrate.flags;
+		sinfo->filled |= BIT_ULL(NL80211_STA_INFO_TX_BITRATE);
 	}
-	sinfo->txrate.flags = arsta->txrate.flags;
-	sinfo->filled |= BIT_ULL(NL80211_STA_INFO_TX_BITRATE);
 
 	if (ar->htt.disable_tx_comp) {
 		sinfo->tx_failed = arsta->tx_failed;
-- 
2.23.0


_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/3] ath10k: enable supports_peer_stats_info for QCA6174 PCI devices
  2020-08-13  9:47 [PATCH 0/3] ath10k: correct tx/rx bitrate for QCA6174 PCIe and SDIO Wen Gong
  2020-08-13  9:47 ` [PATCH 1/3] ath10k: add wmi service peer stat info for wmi tlv Wen Gong
  2020-08-13  9:47 ` [PATCH 2/3] ath10k: remove return for NL80211_STA_INFO_TX_BITRATE Wen Gong
@ 2020-08-13  9:47 ` Wen Gong
  2 siblings, 0 replies; 5+ messages in thread
From: Wen Gong @ 2020-08-13  9:47 UTC (permalink / raw)
  To: ath10k; +Cc: linux-wireless, wgong

When using QCA6174 PCI devices working in station mode, after connected
to AP, tx bitrate is always '1.0 MBit/s' in output of command 'iw wlan0
station dump'. (QCA6174 SDIO devices are working fine.)

After this patch, it show correct bitrate:

Station c4:04:15:5d:97:22 (on wls1)
        inactive time:  312 ms
        rx bytes:       31496
        rx packets:     173
        tx bytes:       8625
        tx packets:     46
        tx retries:     0
        tx failed:      0
        signal:         -76 [-88, -80] dBm
        signal avg:     -75 [-82, -77] dBm
        tx bitrate:     39.0 MBit/s MCS 4
        rx bitrate:     26.0 MBit/s MCS 3

Tested-on: QCA6174 hw3.2 PCI WLAN.RM.4.4.1-00110-QCARMSWP-1

Signed-off-by: Wen Gong <wgong@codeaurora.org>
---
 drivers/net/wireless/ath/ath10k/core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
index 22b6937ac225..c4f098c4431f 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -334,6 +334,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
 		.hw_filter_reset_required = true,
 		.fw_diag_ce_download = true,
 		.tx_stats_over_pktlog = false,
+		.supports_peer_stats_info = true,
 	},
 	{
 		.id = QCA99X0_HW_2_0_DEV_VERSION,
-- 
2.23.0


_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/3] ath10k: add wmi service peer stat info for wmi tlv
  2020-08-13  9:47 ` [PATCH 1/3] ath10k: add wmi service peer stat info for wmi tlv Wen Gong
@ 2020-08-15  7:05   ` Kalle Valo
  0 siblings, 0 replies; 5+ messages in thread
From: Kalle Valo @ 2020-08-15  7:05 UTC (permalink / raw)
  To: Wen Gong; +Cc: linux-wireless, ath10k

Wen Gong <wgong@codeaurora.org> wrote:

> ath10k_sta_statistics is used to report info for iw wlan0 link,
> it check ath10k_peer_stats_enabled, and ath10k_peer_stats_enabled
> check WMI_SERVICE_PEER_STATS bit of ar->wmi.svc_map. SVCMAP() for
> WMI_SERVICE_PEER_STATS was defined only for wmi_10x_svc_map and
> wmi_10_4_svc_map interfaces, it missed in wmi_tlv_svc_map, so it is
> not usable for iw wlan0 link for wmi tlv interface.
> 
> If firmware report WMI_TLV_SERVICE_PEER_STATS_INFO for wmi tlv, then
> enable the WMI_SERVICE_PEER_STATS bit in ath10k, and then it pass check
> in ath10k_peer_stats_enabled and ath10k_sta_statistics pass check.
> 
> Tested-on: QCA6174 hw3.2 SDIO WLAN.RMH.4.4.1-00048
> Tested-on: QCA6174 hw3.2 PCI WLAN.RM.4.4.1-00110-QCARMSWP-1
> 
> Signed-off-by: Wen Gong <wgong@codeaurora.org>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

3 patches applied to ath-next branch of ath.git, thanks.

e39f32afc6d2 ath10k: add wmi service peer stat info for wmi tlv
1cd6ba8ae33e ath10k: remove return for NL80211_STA_INFO_TX_BITRATE
cbcbabb9c395 ath10k: enable supports_peer_stats_info for QCA6174 PCI devices

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

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


_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-08-15  7:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-13  9:47 [PATCH 0/3] ath10k: correct tx/rx bitrate for QCA6174 PCIe and SDIO Wen Gong
2020-08-13  9:47 ` [PATCH 1/3] ath10k: add wmi service peer stat info for wmi tlv Wen Gong
2020-08-15  7:05   ` Kalle Valo
2020-08-13  9:47 ` [PATCH 2/3] ath10k: remove return for NL80211_STA_INFO_TX_BITRATE Wen Gong
2020-08-13  9:47 ` [PATCH 3/3] ath10k: enable supports_peer_stats_info for QCA6174 PCI devices Wen Gong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).