linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] wcn36xx: Setup starting bitrate to MCS-5
@ 2020-08-25  8:49 Loic Poulain
  2020-08-25 11:40 ` Bryan O'Donoghue
  2020-08-27 10:14 ` Kalle Valo
  0 siblings, 2 replies; 3+ messages in thread
From: Loic Poulain @ 2020-08-25  8:49 UTC (permalink / raw)
  To: kvalo; +Cc: wcn36xx, linux-wireless, bryan.odonoghue, Loic Poulain

By default, after associated to an AP, the wcn36xx bitrate adjustment
algorithm starts sending data at 1Mbps, and increases the rate slowly
(1Mbps, 2Mbps, 6Mbps...) over the further TX packets.

Starting at 1Mbps usually causes the initial throughput to be really
low and the maximum possible bitrate to be reached after about hundreed
of TX packets.

That can be improved by setting a different initial bitrate for data
packets via the ENABLE_DYNAMIC_RA_START_RATE configuration value, this
value can be a legacy or MCS rate.

This patch sets the starting bitrate value to MCS-5, which seems to be
a good compromise given it can be quickly adjusted low or up if necessary.
(and based on what I observed in the wild with some mobile devices)

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
---
 drivers/net/wireless/ath/wcn36xx/hal.h | 8 ++++++++
 drivers/net/wireless/ath/wcn36xx/smd.c | 1 +
 2 files changed, 9 insertions(+)

diff --git a/drivers/net/wireless/ath/wcn36xx/hal.h b/drivers/net/wireless/ath/wcn36xx/hal.h
index 6ba0fd5..88e1ed5 100644
--- a/drivers/net/wireless/ath/wcn36xx/hal.h
+++ b/drivers/net/wireless/ath/wcn36xx/hal.h
@@ -728,6 +728,14 @@ enum pe_stats_mask {
 #define WCN36XX_HAL_CFG_ENABLE_TDLS_OXYGEN_MODE		104
 #define WCN36XX_HAL_CFG_MAX_PARAMS			105
 
+/* Specify the starting bitrate, 11B and 11A/G rates can be specified in
+ * multiples of 0.5 So for 5.5 mbps => 11. for MCS 0 - 7 rates, Bit 7 should
+ * set to 1 and Bit 0-6 represent the MCS index. so for MCS2 => 130.
+ * Any invalid non-zero value or unsupported rate will set the start rate
+ * to 6 mbps.
+ */
+#define WCN36XX_HAL_CFG_ENABLE_DYNAMIC_RA_START_RATE	210
+
 /* Message definitons - All the messages below need to be packed */
 
 /* Definition for HAL API Version. */
diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c
index 9864c6f..83247d3 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.c
+++ b/drivers/net/wireless/ath/wcn36xx/smd.c
@@ -77,6 +77,7 @@ static struct wcn36xx_cfg_val wcn36xx_cfg_vals[] = {
 	WCN36XX_CFG_VAL(BTC_STATIC_LEN_LE_WLAN, 30000),
 	WCN36XX_CFG_VAL(MAX_ASSOC_LIMIT, 10),
 	WCN36XX_CFG_VAL(ENABLE_MCC_ADAPTIVE_SCHEDULER, 0),
+	WCN36XX_CFG_VAL(ENABLE_DYNAMIC_RA_START_RATE, 133), /* MCS 5 */
 };
 
 static int put_cfg_tlv_u32(struct wcn36xx *wcn, size_t *len, u32 id, u32 value)
-- 
2.7.4


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

* Re: [PATCH] wcn36xx: Setup starting bitrate to MCS-5
  2020-08-25  8:49 [PATCH] wcn36xx: Setup starting bitrate to MCS-5 Loic Poulain
@ 2020-08-25 11:40 ` Bryan O'Donoghue
  2020-08-27 10:14 ` Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Bryan O'Donoghue @ 2020-08-25 11:40 UTC (permalink / raw)
  To: Loic Poulain, kvalo; +Cc: wcn36xx, linux-wireless

On 25/08/2020 09:49, Loic Poulain wrote:
> By default, after associated to an AP, the wcn36xx bitrate adjustment
> algorithm starts sending data at 1Mbps, and increases the rate slowly
> (1Mbps, 2Mbps, 6Mbps...) over the further TX packets.
> 
> Starting at 1Mbps usually causes the initial throughput to be really
> low and the maximum possible bitrate to be reached after about hundreed
> of TX packets.
> 
> That can be improved by setting a different initial bitrate for data
> packets via the ENABLE_DYNAMIC_RA_START_RATE configuration value, this
> value can be a legacy or MCS rate.
> 
> This patch sets the starting bitrate value to MCS-5, which seems to be
> a good compromise given it can be quickly adjusted low or up if necessary.
> (and based on what I observed in the wild with some mobile devices)
> 
> Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
> ---
>   drivers/net/wireless/ath/wcn36xx/hal.h | 8 ++++++++
>   drivers/net/wireless/ath/wcn36xx/smd.c | 1 +
>   2 files changed, 9 insertions(+)
> 
> diff --git a/drivers/net/wireless/ath/wcn36xx/hal.h b/drivers/net/wireless/ath/wcn36xx/hal.h
> index 6ba0fd5..88e1ed5 100644
> --- a/drivers/net/wireless/ath/wcn36xx/hal.h
> +++ b/drivers/net/wireless/ath/wcn36xx/hal.h
> @@ -728,6 +728,14 @@ enum pe_stats_mask {
>   #define WCN36XX_HAL_CFG_ENABLE_TDLS_OXYGEN_MODE		104
>   #define WCN36XX_HAL_CFG_MAX_PARAMS			105
>   
> +/* Specify the starting bitrate, 11B and 11A/G rates can be specified in
> + * multiples of 0.5 So for 5.5 mbps => 11. for MCS 0 - 7 rates, Bit 7 should
> + * set to 1 and Bit 0-6 represent the MCS index. so for MCS2 => 130.
> + * Any invalid non-zero value or unsupported rate will set the start rate
> + * to 6 mbps.
> + */
> +#define WCN36XX_HAL_CFG_ENABLE_DYNAMIC_RA_START_RATE	210
> +
>   /* Message definitons - All the messages below need to be packed */
>   
>   /* Definition for HAL API Version. */
> diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c
> index 9864c6f..83247d3 100644
> --- a/drivers/net/wireless/ath/wcn36xx/smd.c
> +++ b/drivers/net/wireless/ath/wcn36xx/smd.c
> @@ -77,6 +77,7 @@ static struct wcn36xx_cfg_val wcn36xx_cfg_vals[] = {
>   	WCN36XX_CFG_VAL(BTC_STATIC_LEN_LE_WLAN, 30000),
>   	WCN36XX_CFG_VAL(MAX_ASSOC_LIMIT, 10),
>   	WCN36XX_CFG_VAL(ENABLE_MCC_ADAPTIVE_SCHEDULER, 0),
> +	WCN36XX_CFG_VAL(ENABLE_DYNAMIC_RA_START_RATE, 133), /* MCS 5 */
>   };
>   
>   static int put_cfg_tlv_u32(struct wcn36xx *wcn, size_t *len, u32 id, u32 value)
> 

Interesting.

I did this to the wcn3680 config I have, which if I've understood your 
description right is MCS8 default

+       WCN36XX_CFG_VAL(ENABLE_DYNAMIC_RA_START_RATE, 136),

I'd say anecdotally I get up to higher data-rates faster. So its 
probably the right thing to do on the 3620/3660 too.

I'll rebase my 3680 patches since this patch will conflict

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

* Re: [PATCH] wcn36xx: Setup starting bitrate to MCS-5
  2020-08-25  8:49 [PATCH] wcn36xx: Setup starting bitrate to MCS-5 Loic Poulain
  2020-08-25 11:40 ` Bryan O'Donoghue
@ 2020-08-27 10:14 ` Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Kalle Valo @ 2020-08-27 10:14 UTC (permalink / raw)
  To: Loic Poulain; +Cc: wcn36xx, linux-wireless, bryan.odonoghue, Loic Poulain

Loic Poulain <loic.poulain@linaro.org> wrote:

> By default, after associated to an AP, the wcn36xx bitrate adjustment
> algorithm starts sending data at 1Mbps, and increases the rate slowly
> (1Mbps, 2Mbps, 6Mbps...) over the further TX packets.
> 
> Starting at 1Mbps usually causes the initial throughput to be really
> low and the maximum possible bitrate to be reached after about hundreed
> of TX packets.
> 
> That can be improved by setting a different initial bitrate for data
> packets via the ENABLE_DYNAMIC_RA_START_RATE configuration value, this
> value can be a legacy or MCS rate.
> 
> This patch sets the starting bitrate value to MCS-5, which seems to be
> a good compromise given it can be quickly adjusted low or up if necessary.
> (and based on what I observed in the wild with some mobile devices)
> 
> Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

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

1fcdb567df1b wcn36xx: Setup starting bitrate to MCS-5

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

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


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

end of thread, other threads:[~2020-08-27 10:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-25  8:49 [PATCH] wcn36xx: Setup starting bitrate to MCS-5 Loic Poulain
2020-08-25 11:40 ` Bryan O'Donoghue
2020-08-27 10:14 ` Kalle Valo

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