linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ath9k: Test for TID only in BlockAcks while checking tx status
@ 2012-10-29 12:25 Sven Eckelmann
  2012-10-29 12:34 ` Felix Fietkau
  0 siblings, 1 reply; 3+ messages in thread
From: Sven Eckelmann @ 2012-10-29 12:25 UTC (permalink / raw)
  To: linux-wireless
  Cc: ath9k-devel, linville, mcgrof, nbd, Sven Eckelmann,
	Simon Wunderlich

The ath9k xmit functions for AMPDUs can send frames as non-aggregate in case
only one frame is currently available. The client will then answer using a
normal Ack instead of a BlockAck. This acknowledgement has no TID stored and
therefore the hardware is not able to provide us the corresponding TID.

The TID set by the hardware in the tx status descriptor has to be seen as
undefined and not as a valid TID value for normal acknowledgements. Doing
otherwise results in a massive amount of retransmissions and stalls of
connections.

Users may experience low bandwidth and complete connection stalls in
environments with transfers using multiple TIDs.

This regression was introduced in b11b160defc48e4daa283f785192ea3a23a51f8e
("ath9k: validate the TID in the tx status information").

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
---
 drivers/net/wireless/ath/ath9k/xmit.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index 378bd70..d34d929 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -393,7 +393,7 @@ static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq,
 	u16 seq_st = 0, acked_cnt = 0, txfail_cnt = 0, seq_first;
 	u32 ba[WME_BA_BMP_SIZE >> 5];
 	int isaggr, txfail, txpending, sendbar = 0, needreset = 0, nbad = 0;
-	bool rc_update = true;
+	bool rc_update = true, isba;
 	struct ieee80211_tx_rate rates[4];
 	struct ath_frame_info *fi;
 	int nframes;
@@ -437,13 +437,17 @@ static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq,
 	tidno = ieee80211_get_qos_ctl(hdr)[0] & IEEE80211_QOS_CTL_TID_MASK;
 	tid = ATH_AN_2_TID(an, tidno);
 	seq_first = tid->seq_start;
+	isba = ts->ts_flags & ATH9K_TX_BA;
 
 	/*
 	 * The hardware occasionally sends a tx status for the wrong TID.
 	 * In this case, the BA status cannot be considered valid and all
 	 * subframes need to be retransmitted
+	 *
+	 * Only BlockAcks have a TID and therefore normal Acks cannot be
+	 * checked
 	 */
-	if (tidno != ts->tid)
+	if (isba && tidno != ts->tid)
 		txok = false;
 
 	isaggr = bf_isaggr(bf);
-- 
1.7.10.4


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

* Re: [PATCH] ath9k: Test for TID only in BlockAcks while checking tx status
  2012-10-29 12:25 [PATCH] ath9k: Test for TID only in BlockAcks while checking tx status Sven Eckelmann
@ 2012-10-29 12:34 ` Felix Fietkau
  2012-10-29 14:18   ` Felix Fietkau
  0 siblings, 1 reply; 3+ messages in thread
From: Felix Fietkau @ 2012-10-29 12:34 UTC (permalink / raw)
  To: Sven Eckelmann
  Cc: linux-wireless, ath9k-devel, linville, mcgrof, Simon Wunderlich

On 2012-10-29 1:25 PM, Sven Eckelmann wrote:
> The ath9k xmit functions for AMPDUs can send frames as non-aggregate in case
> only one frame is currently available. The client will then answer using a
> normal Ack instead of a BlockAck. This acknowledgement has no TID stored and
> therefore the hardware is not able to provide us the corresponding TID.
> 
> The TID set by the hardware in the tx status descriptor has to be seen as
> undefined and not as a valid TID value for normal acknowledgements. Doing
> otherwise results in a massive amount of retransmissions and stalls of
> connections.
> 
> Users may experience low bandwidth and complete connection stalls in
> environments with transfers using multiple TIDs.
> 
> This regression was introduced in b11b160defc48e4daa283f785192ea3a23a51f8e
> ("ath9k: validate the TID in the tx status information").
> 
> Signed-off-by: Sven Eckelmann <sven@narfation.org>
> Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Nice catch, thanks!
Acked-by: Felix Fietkau <nbd@openwrt.org>

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

* Re: [PATCH] ath9k: Test for TID only in BlockAcks while checking tx status
  2012-10-29 12:34 ` Felix Fietkau
@ 2012-10-29 14:18   ` Felix Fietkau
  0 siblings, 0 replies; 3+ messages in thread
From: Felix Fietkau @ 2012-10-29 14:18 UTC (permalink / raw)
  To: Sven Eckelmann
  Cc: linux-wireless, ath9k-devel, linville, mcgrof, Simon Wunderlich

On 2012-10-29 1:34 PM, Felix Fietkau wrote:
> On 2012-10-29 1:25 PM, Sven Eckelmann wrote:
>> The ath9k xmit functions for AMPDUs can send frames as non-aggregate in case
>> only one frame is currently available. The client will then answer using a
>> normal Ack instead of a BlockAck. This acknowledgement has no TID stored and
>> therefore the hardware is not able to provide us the corresponding TID.
>> 
>> The TID set by the hardware in the tx status descriptor has to be seen as
>> undefined and not as a valid TID value for normal acknowledgements. Doing
>> otherwise results in a massive amount of retransmissions and stalls of
>> connections.
>> 
>> Users may experience low bandwidth and complete connection stalls in
>> environments with transfers using multiple TIDs.
>> 
>> This regression was introduced in b11b160defc48e4daa283f785192ea3a23a51f8e
>> ("ath9k: validate the TID in the tx status information").
>> 
>> Signed-off-by: Sven Eckelmann <sven@narfation.org>
>> Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
> Nice catch, thanks!
> Acked-by: Felix Fietkau <nbd@openwrt.org>
One more thing: I think this deserves a
Cc: stable@vger.kernel.org

- Felix


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

end of thread, other threads:[~2012-10-29 14:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-29 12:25 [PATCH] ath9k: Test for TID only in BlockAcks while checking tx status Sven Eckelmann
2012-10-29 12:34 ` Felix Fietkau
2012-10-29 14:18   ` Felix Fietkau

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