All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ath9k: fix transmitting to stations in dynamic SMPS mode
@ 2021-02-14 18:49 Felix Fietkau
  2021-02-15  4:54 ` Kalle Valo
  2021-02-18  6:08 ` Kalle Valo
  0 siblings, 2 replies; 5+ messages in thread
From: Felix Fietkau @ 2021-02-14 18:49 UTC (permalink / raw)
  To: linux-wireless; +Cc: kvalo, hurricos

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: stable@vger.kernel.org
Reported-by: Martin Kennedy <hurricos@gmail.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
 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


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

* Re: [PATCH] ath9k: fix transmitting to stations in dynamic SMPS mode
  2021-02-14 18:49 [PATCH] ath9k: fix transmitting to stations in dynamic SMPS mode Felix Fietkau
@ 2021-02-15  4:54 ` Kalle Valo
  2021-02-15  7:20   ` Felix Fietkau
  2021-02-18  6:08 ` Kalle Valo
  1 sibling, 1 reply; 5+ messages in thread
From: Kalle Valo @ 2021-02-15  4:54 UTC (permalink / raw)
  To: Felix Fietkau; +Cc: linux-wireless, hurricos

Felix Fietkau <nbd@nbd.name> 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: stable@vger.kernel.org
> Reported-by: Martin Kennedy <hurricos@gmail.com>
> Signed-off-by: Felix Fietkau <nbd@nbd.name>

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

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

* Re: [PATCH] ath9k: fix transmitting to stations in dynamic SMPS mode
  2021-02-15  4:54 ` Kalle Valo
@ 2021-02-15  7:20   ` Felix Fietkau
  2021-02-15  9:12     ` Kalle Valo
  0 siblings, 1 reply; 5+ messages in thread
From: Felix Fietkau @ 2021-02-15  7:20 UTC (permalink / raw)
  To: Kalle Valo; +Cc: linux-wireless, hurricos


On 2021-02-15 05:54, Kalle Valo wrote:
> Felix Fietkau <nbd@nbd.name> 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: stable@vger.kernel.org
>> Reported-by: Martin Kennedy <hurricos@gmail.com>
>> Signed-off-by: Felix Fietkau <nbd@nbd.name>
> 
> 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

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

* Re: [PATCH] ath9k: fix transmitting to stations in dynamic SMPS mode
  2021-02-15  7:20   ` Felix Fietkau
@ 2021-02-15  9:12     ` Kalle Valo
  0 siblings, 0 replies; 5+ messages in thread
From: Kalle Valo @ 2021-02-15  9:12 UTC (permalink / raw)
  To: Felix Fietkau; +Cc: linux-wireless, hurricos

Felix Fietkau <nbd@nbd.name> writes:

> On 2021-02-15 05:54, Kalle Valo wrote:
>> Felix Fietkau <nbd@nbd.name> 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: stable@vger.kernel.org
>>> Reported-by: Martin Kennedy <hurricos@gmail.com>
>>> Signed-off-by: Felix Fietkau <nbd@nbd.name>
>> 
>> 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

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

* Re: [PATCH] ath9k: fix transmitting to stations in dynamic SMPS mode
  2021-02-14 18:49 [PATCH] ath9k: fix transmitting to stations in dynamic SMPS mode Felix Fietkau
  2021-02-15  4:54 ` Kalle Valo
@ 2021-02-18  6:08 ` Kalle Valo
  1 sibling, 0 replies; 5+ messages in thread
From: Kalle Valo @ 2021-02-18  6:08 UTC (permalink / raw)
  To: Felix Fietkau; +Cc: linux-wireless, hurricos

Felix Fietkau <nbd@nbd.name> 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: stable@vger.kernel.org
> Reported-by: Martin Kennedy <hurricos@gmail.com>
> Signed-off-by: Felix Fietkau <nbd@nbd.name>

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/20210214184911.96702-1-nbd@nbd.name/

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


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

end of thread, other threads:[~2021-02-18  6:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-14 18:49 [PATCH] ath9k: fix transmitting to stations in dynamic SMPS mode Felix Fietkau
2021-02-15  4:54 ` Kalle Valo
2021-02-15  7:20   ` Felix Fietkau
2021-02-15  9:12     ` Kalle Valo
2021-02-18  6:08 ` Kalle Valo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.