2020-04-27 08:07:46

by Wen Gong

[permalink] [raw]
Subject: [PATCH v2 0/4] ath10k: sdio: add support for rx/tx bitrate reporting

v2: rebased to ath-next of 04/27

iw wlan0 link/iw wlan0 station dump show the wrong bitrate for rx/tx.
wrong example:
rx bitrate: 6.0 MBit/s
tx bitrate: 2.8 MBit/s

These patches correct them.
rx bitrate: 234.0 MBit/s VHT-MCS 3 80MHz VHT-NSS 2
rx bitrate: 40.5 MBit/s MCS 2 40MHz
rx bitrate: 72.2 MBit/s MCS 7 short GI
rx bitrate: 54.0 MBit/s
rx bitrate: 48.0 MBit/s

tx bitrate: 54.0 MBit/s

Wen Gong (4):
ath10k: enable firmware peer stats info for wmi tlv
ath10k: add rx bitrate report for SDIO
ath10k: add bitrate parse for peer stats info
ath10k: correct tx bitrate of iw for SDIO

drivers/net/wireless/ath/ath10k/core.c | 2 +
drivers/net/wireless/ath/ath10k/core.h | 25 +++
drivers/net/wireless/ath/ath10k/hw.h | 3 +
drivers/net/wireless/ath/ath10k/mac.c | 216 ++++++++++++++++++++++
drivers/net/wireless/ath/ath10k/wmi-ops.h | 30 +++
drivers/net/wireless/ath/ath10k/wmi-tlv.c | 121 ++++++++++++
drivers/net/wireless/ath/ath10k/wmi-tlv.h | 110 +++++++++++
drivers/net/wireless/ath/ath10k/wmi.h | 9 +
8 files changed, 516 insertions(+)

--
2.23.0


2020-04-27 08:07:46

by Wen Gong

[permalink] [raw]
Subject: [PATCH v2 1/4] ath10k: enable firmware peer stats info for wmi tlv

For wmi tlv type, firmware disable peer stats info by default, after
enable it, firmware will report WMI_TLV_PEER_STATS_INFO_EVENTID if
ath10k send WMI_TLV_REQUEST_PEER_STATS_INFO_CMDID to firmware.

Enable it will only set a flag in firmware, firmware will not report
it without receive request WMI command.

Tested with QCA6174 SDIO with firmware WLAN.RMH.4.4.1-00042.

Signed-off-by: Wen Gong <[email protected]>
---
drivers/net/wireless/ath/ath10k/mac.c | 5 +++++
drivers/net/wireless/ath/ath10k/wmi-tlv.c | 1 +
drivers/net/wireless/ath/ath10k/wmi-tlv.h | 1 +
drivers/net/wireless/ath/ath10k/wmi.h | 1 +
4 files changed, 8 insertions(+)

diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index a1147ccc09bf..0fb082c9d04b 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -2959,6 +2959,11 @@ static void ath10k_bss_assoc(struct ieee80211_hw *hw,
arvif->aid = bss_conf->aid;
ether_addr_copy(arvif->bssid, bss_conf->bssid);

+ ret = ath10k_wmi_pdev_set_param(ar,
+ ar->wmi.pdev_param->peer_stats_info_enable, 1);
+ if (ret)
+ ath10k_warn(ar, "failed to enable peer stats info: %d\n", ret);
+
ret = ath10k_wmi_vdev_up(ar, arvif->vdev_id, arvif->aid, arvif->bssid);
if (ret) {
ath10k_warn(ar, "failed to set vdev %d up: %d\n",
diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.c b/drivers/net/wireless/ath/ath10k/wmi-tlv.c
index e1ab900f2662..27aaa48615d2 100644
--- a/drivers/net/wireless/ath/ath10k/wmi-tlv.c
+++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.c
@@ -4269,6 +4269,7 @@ static struct wmi_pdev_param_map wmi_tlv_pdev_param_map = {
.arp_dstaddr = WMI_PDEV_PARAM_UNSUPPORTED,
.rfkill_config = WMI_TLV_PDEV_PARAM_HW_RFKILL_CONFIG,
.rfkill_enable = WMI_TLV_PDEV_PARAM_RFKILL_ENABLE,
+ .peer_stats_info_enable = WMI_TLV_PDEV_PARAM_PEER_STATS_INFO_ENABLE,
};

static struct wmi_peer_param_map wmi_tlv_peer_param_map = {
diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.h b/drivers/net/wireless/ath/ath10k/wmi-tlv.h
index 4972dc12991c..cd400b19a64d 100644
--- a/drivers/net/wireless/ath/ath10k/wmi-tlv.h
+++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.h
@@ -451,6 +451,7 @@ enum wmi_tlv_pdev_param {
WMI_TLV_PDEV_PARAM_VDEV_RATE_STATS_UPDATE_PERIOD,
WMI_TLV_PDEV_PARAM_TXPOWER_REASON_NONE,
WMI_TLV_PDEV_PARAM_TXPOWER_REASON_SAR,
+ WMI_TLV_PDEV_PARAM_PEER_STATS_INFO_ENABLE = 0x8b,
WMI_TLV_PDEV_PARAM_TXPOWER_REASON_MAX,
};

diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h
index 209070714d1a..46740e16f3ce 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.h
+++ b/drivers/net/wireless/ath/ath10k/wmi.h
@@ -3798,6 +3798,7 @@ struct wmi_pdev_param_map {
u32 enable_btcoex;
u32 rfkill_config;
u32 rfkill_enable;
+ u32 peer_stats_info_enable;
};

#define WMI_PDEV_PARAM_UNSUPPORTED 0
--
2.23.0

2020-04-28 09:16:31

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH v2 1/4] ath10k: enable firmware peer stats info for wmi tlv

Wen Gong <[email protected]> wrote:

> For wmi tlv type, firmware disable peer stats info by default, after
> enable it, firmware will report WMI_TLV_PEER_STATS_INFO_EVENTID if
> ath10k send WMI_TLV_REQUEST_PEER_STATS_INFO_CMDID to firmware.
>
> Enable it will only set a flag in firmware, firmware will not report
> it without receive request WMI command.
>
> Tested with QCA6174 SDIO with firmware WLAN.RMH.4.4.1-00042.
>
> Signed-off-by: Wen Gong <[email protected]>
> Signed-off-by: Kalle Valo <[email protected]>

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

2289bef25e32 ath10k: enable firmware peer stats info for wmi tlv
0f7cb26830a6 ath10k: add rx bitrate report for SDIO
3344b99d69ab ath10k: add bitrate parse for peer stats info
4cc02c7c1494 ath10k: correct tx bitrate of iw for SDIO

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

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

2020-04-28 09:34:58

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH v2 1/4] ath10k: enable firmware peer stats info for wmi tlv

Kalle Valo <[email protected]> writes:

> Wen Gong <[email protected]> wrote:
>
>> For wmi tlv type, firmware disable peer stats info by default, after
>> enable it, firmware will report WMI_TLV_PEER_STATS_INFO_EVENTID if
>> ath10k send WMI_TLV_REQUEST_PEER_STATS_INFO_CMDID to firmware.
>>
>> Enable it will only set a flag in firmware, firmware will not report
>> it without receive request WMI command.
>>
>> Tested with QCA6174 SDIO with firmware WLAN.RMH.4.4.1-00042.
>>
>> Signed-off-by: Wen Gong <[email protected]>
>> Signed-off-by: Kalle Valo <[email protected]>
>
> 4 patches applied to ath-next branch of ath.git, thanks.
>
> 2289bef25e32 ath10k: enable firmware peer stats info for wmi tlv
> 0f7cb26830a6 ath10k: add rx bitrate report for SDIO
> 3344b99d69ab ath10k: add bitrate parse for peer stats info
> 4cc02c7c1494 ath10k: correct tx bitrate of iw for SDIO

I think these caused a new warning which I missed:

drivers/net/wireless/ath/ath10k/wmi-tlv.c:3013:34: warning: incorrect type in assignment (different base types)
drivers/net/wireless/ath/ath10k/wmi-tlv.c:3013:34: expected restricted __le32 [usertype] reset_after_request
drivers/net/wireless/ath/ath10k/wmi-tlv.c:3013:34: got unsigned int [usertype] reset

Please send a followup patch to fix that.

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

2020-04-28 09:51:31

by Wen Gong

[permalink] [raw]
Subject: Re: [PATCH v2 1/4] ath10k: enable firmware peer stats info for wmi tlv

On 2020-04-28 17:33, Kalle Valo wrote:
> Kalle Valo <[email protected]> writes:
>
>> Wen Gong <[email protected]> wrote:
>>
>>> For wmi tlv type, firmware disable peer stats info by default, after
>>> enable it, firmware will report WMI_TLV_PEER_STATS_INFO_EVENTID if
>>> ath10k send WMI_TLV_REQUEST_PEER_STATS_INFO_CMDID to firmware.
>>>
>>> Enable it will only set a flag in firmware, firmware will not report
>>> it without receive request WMI command.
>>>
>>> Tested with QCA6174 SDIO with firmware WLAN.RMH.4.4.1-00042.
>>>
>>> Signed-off-by: Wen Gong <[email protected]>
>>> Signed-off-by: Kalle Valo <[email protected]>
>>
>> 4 patches applied to ath-next branch of ath.git, thanks.
>>
>> 2289bef25e32 ath10k: enable firmware peer stats info for wmi tlv
>> 0f7cb26830a6 ath10k: add rx bitrate report for SDIO
>> 3344b99d69ab ath10k: add bitrate parse for peer stats info
>> 4cc02c7c1494 ath10k: correct tx bitrate of iw for SDIO
>
> I think these caused a new warning which I missed:
>
> drivers/net/wireless/ath/ath10k/wmi-tlv.c:3013:34: warning: incorrect
> type in assignment (different base types)
> drivers/net/wireless/ath/ath10k/wmi-tlv.c:3013:34: expected
> restricted __le32 [usertype] reset_after_request
> drivers/net/wireless/ath/ath10k/wmi-tlv.c:3013:34: got unsigned int
> [usertype] reset
ok. I will give new patch to fix the 3 warning.
>
> Please send a followup patch to fix that.