Skip to contentSkip to conversation

ath10k: correct tx/rx bitrate for QCA6174 PCIe and SDIO

PATCH In review Wen Gong 2 participants 5 messages Aug 13, 2020 – Aug 15, 2020 Qualcomm Atheros ATH10K wireless driver

lore
Share & tools
lore

Wen Gong

author
#0 lore raw

cover ath10k: correct tx/rx bitrate for QCA6174 PCIe and SDIO

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(-)
Signature · 1 line
2.23.0
author
#1 lore raw

PATCH 1/3 ath10k: add wmi service peer stat info for wmi tlv

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

---
 drivers/net/wireless/ath/ath10k/wmi-tlv.h | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/wireless/ath/ath10k/wmi-tlv.h +2 -0
index e77b97ca5c7f..b39c9b78b32b 100644
@@ -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
Signature · 1 line
2.23.0
#2 lore raw

Re: [PATCH 1/3] ath10k: add wmi service peer stat info for wmi tlv

Quoted 11 lines · Wen Gong

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.

Quoted 5 lines

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

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

Signature · 9 lines
https://patchwork.kernel.org/patch/11712349/

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


_______________________________________________
ath10k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath10k
author
#3 lore raw

PATCH 2/3 ath10k: remove return for NL80211_STA_INFO_TX_BITRATE

In reply to Wen Gong

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

---
 drivers/net/wireless/ath/ath10k/mac.c | 21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)
drivers/net/wireless/ath/ath10k/mac.c +10 -11
index 3e3896214e8b..4554a82d0105 100644
@@ -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;
Signature · 1 line
2.23.0
author
#4 lore raw

PATCH 3/3 ath10k: enable supports_peer_stats_info for QCA6174 PCI devices

In reply to Wen Gong

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

---
 drivers/net/wireless/ath/ath10k/core.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/wireless/ath/ath10k/core.c +1 -0
index 22b6937ac225..c4f098c4431f 100644
@@ -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,
Signature · 7 lines
2.23.0


_______________________________________________
ath10k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath10k