2021-02-14 18:51:39

by Felix Fietkau

[permalink] [raw]
Subject: [PATCH] ath9k: fix transmitting to stations in dynamic SMPS mode

When transmitting to a receiver in dynamic SMPS mode, all transmissions that
use multiple spatial streams need to be sent using CTS-to-self or RTS/CTS to
give the receiver's extra chains some time to wake up.
This fixes the tx rate getting stuck at <= MCS7 for some clients, especially
Intel ones, which make aggressive use of SMPS.

Cc: [email protected]
Reported-by: Martin Kennedy <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
---
drivers/net/wireless/ath/ath9k/ath9k.h | 3 ++-
drivers/net/wireless/ath/ath9k/xmit.c | 6 ++++++
2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h
index 13b4f5f50f8a..ef6f5ea06c1f 100644
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -177,7 +177,8 @@ struct ath_frame_info {
s8 txq;
u8 keyix;
u8 rtscts_rate;
- u8 retries : 7;
+ u8 retries : 6;
+ u8 dyn_smps : 1;
u8 baw_tracked : 1;
u8 tx_power;
enum ath9k_key_type keytype:2;
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index e60d4737fc6e..5691bd6eb82c 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -1271,6 +1271,11 @@ static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf,
is_40, is_sgi, is_sp);
if (rix < 8 && (tx_info->flags & IEEE80211_TX_CTL_STBC))
info->rates[i].RateFlags |= ATH9K_RATESERIES_STBC;
+ if (rix >= 8 && fi->dyn_smps) {
+ info->rates[i].RateFlags |=
+ ATH9K_RATESERIES_RTS_CTS;
+ info->flags |= ATH9K_TXDESC_CTSENA;
+ }

info->txpower[i] = ath_get_rate_txpower(sc, bf, rix,
is_40, false);
@@ -2114,6 +2119,7 @@ static void setup_frame_info(struct ieee80211_hw *hw,
fi->keyix = an->ps_key;
else
fi->keyix = ATH9K_TXKEYIX_INVALID;
+ fi->dyn_smps = sta && sta->smps_mode == IEEE80211_SMPS_DYNAMIC;
fi->keytype = keytype;
fi->framelen = framelen;
fi->tx_power = txpower;
--
2.28.0


2021-02-15 05:04:40

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH] ath9k: fix transmitting to stations in dynamic SMPS mode

Felix Fietkau <[email protected]> writes:

> When transmitting to a receiver in dynamic SMPS mode, all transmissions that
> use multiple spatial streams need to be sent using CTS-to-self or RTS/CTS to
> give the receiver's extra chains some time to wake up.
> This fixes the tx rate getting stuck at <= MCS7 for some clients, especially
> Intel ones, which make aggressive use of SMPS.
>
> Cc: [email protected]
> Reported-by: Martin Kennedy <[email protected]>
> Signed-off-by: Felix Fietkau <[email protected]>

No Fixes tag so I assume this is not a regression?

Should this go to v5.12 or -next? I guess that depends how much testing
this patch has got.

--
https://patchwork.kernel.org/project/linux-wireless/list/

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

2021-02-15 07:25:04

by Felix Fietkau

[permalink] [raw]
Subject: Re: [PATCH] ath9k: fix transmitting to stations in dynamic SMPS mode


On 2021-02-15 05:54, Kalle Valo wrote:
> Felix Fietkau <[email protected]> writes:
>
>> When transmitting to a receiver in dynamic SMPS mode, all transmissions that
>> use multiple spatial streams need to be sent using CTS-to-self or RTS/CTS to
>> give the receiver's extra chains some time to wake up.
>> This fixes the tx rate getting stuck at <= MCS7 for some clients, especially
>> Intel ones, which make aggressive use of SMPS.
>>
>> Cc: [email protected]
>> Reported-by: Martin Kennedy <[email protected]>
>> Signed-off-by: Felix Fietkau <[email protected]>
>
> No Fixes tag so I assume this is not a regression?
>
> Should this go to v5.12 or -next? I guess that depends how much testing
> this patch has got.
I'd prefer v5.12. I got confirmation that the patch makes a big
difference in throughput with Intel clients (makes tx with MCS > 7
work), and I think there is very little potential for regressions.

- Felix

2021-02-15 09:14:24

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH] ath9k: fix transmitting to stations in dynamic SMPS mode

Felix Fietkau <[email protected]> writes:

> On 2021-02-15 05:54, Kalle Valo wrote:
>> Felix Fietkau <[email protected]> writes:
>>
>>> When transmitting to a receiver in dynamic SMPS mode, all transmissions that
>>> use multiple spatial streams need to be sent using CTS-to-self or RTS/CTS to
>>> give the receiver's extra chains some time to wake up.
>>> This fixes the tx rate getting stuck at <= MCS7 for some clients, especially
>>> Intel ones, which make aggressive use of SMPS.
>>>
>>> Cc: [email protected]
>>> Reported-by: Martin Kennedy <[email protected]>
>>> Signed-off-by: Felix Fietkau <[email protected]>
>>
>> No Fixes tag so I assume this is not a regression?
>>
>> Should this go to v5.12 or -next? I guess that depends how much testing
>> this patch has got.
>
> I'd prefer v5.12. I got confirmation that the patch makes a big
> difference in throughput with Intel clients (makes tx with MCS > 7
> work), and I think there is very little potential for regressions.

Good, I'll queue this to v5.12 then. And we have plenty of time to fix
any regressions anyway.

--
https://patchwork.kernel.org/project/linux-wireless/list/

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

2021-02-18 06:21:03

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH] ath9k: fix transmitting to stations in dynamic SMPS mode

Felix Fietkau <[email protected]> wrote:

> When transmitting to a receiver in dynamic SMPS mode, all transmissions that
> use multiple spatial streams need to be sent using CTS-to-self or RTS/CTS to
> give the receiver's extra chains some time to wake up.
> This fixes the tx rate getting stuck at <= MCS7 for some clients, especially
> Intel ones, which make aggressive use of SMPS.
>
> Cc: [email protected]
> Reported-by: Martin Kennedy <[email protected]>
> Signed-off-by: Felix Fietkau <[email protected]>

Patch applied to wireless-drivers.git, thanks.

3b9ea7206d7e ath9k: fix transmitting to stations in dynamic SMPS mode

--
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/

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