public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3.12] ath5k: fix regression in tx status processing
@ 2013-10-14 19:18 Felix Fietkau
  2013-10-14 20:16 ` Thomas Hühn
  0 siblings, 1 reply; 2+ messages in thread
From: Felix Fietkau @ 2013-10-14 19:18 UTC (permalink / raw)
  To: linux-wireless; +Cc: linville, thomas, bvahl, ben

The regression was introduced in the following commit:

0967e01e8e713ed2982fb4eba8ba13794e9a6e89
"ath5k: make use of the new rate control API"

ath5k_tx_frame_completed saves the intended per-rate retry counts before
they are cleared by ieee80211_tx_info_clear_status, however at this
point the information in info->status.rates is incomplete.

This causes significant throughput degradation and excessive packet loss
on links where high bit rates don't work properly.

Move the copy from bf->rates a few lines up to ensure that the saved
retry counts are updated, and that they are really cleared in
info->status.rates after the call to ieee80211_tx_info_clear_status.

Cc: stable@vger.kernel.org # 3.10+
Cc: Thomas Huehn <thomas@net.t-labs.tu-berlin.de>
Cc: Benjamin Vahl <bvahl@net.t-labs.tu-berlin.de>
Reported-by: Ben West <ben@gowasabi.net>
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
---
 drivers/net/wireless/ath/ath5k/base.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index 48161ed..69f58b0 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -1663,15 +1663,15 @@ ath5k_tx_frame_completed(struct ath5k_hw *ah, struct sk_buff *skb,
 	ah->stats.tx_bytes_count += skb->len;
 	info = IEEE80211_SKB_CB(skb);
 
+	size = min_t(int, sizeof(info->status.rates), sizeof(bf->rates));
+	memcpy(info->status.rates, bf->rates, size);
+
 	tries[0] = info->status.rates[0].count;
 	tries[1] = info->status.rates[1].count;
 	tries[2] = info->status.rates[2].count;
 
 	ieee80211_tx_info_clear_status(info);
 
-	size = min_t(int, sizeof(info->status.rates), sizeof(bf->rates));
-	memcpy(info->status.rates, bf->rates, size);
-
 	for (i = 0; i < ts->ts_final_idx; i++) {
 		struct ieee80211_tx_rate *r =
 			&info->status.rates[i];
-- 
1.8.0.2


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

* Re: [PATCH 3.12] ath5k: fix regression in tx status processing
  2013-10-14 19:18 [PATCH 3.12] ath5k: fix regression in tx status processing Felix Fietkau
@ 2013-10-14 20:16 ` Thomas Hühn
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Hühn @ 2013-10-14 20:16 UTC (permalink / raw)
  To: Felix Fietkau; +Cc: linux-wireless, linville, bvahl, ben


On 14.10.2013, at 21:18, Felix Fietkau <nbd@openwrt.org> wrote:

> The regression was introduced in the following commit:
> 
> 0967e01e8e713ed2982fb4eba8ba13794e9a6e89
> "ath5k: make use of the new rate control API"
> 
> ath5k_tx_frame_completed saves the intended per-rate retry counts before
> they are cleared by ieee80211_tx_info_clear_status, however at this
> point the information in info->status.rates is incomplete.
> 
> This causes significant throughput degradation and excessive packet loss
> on links where high bit rates don't work properly.
> 
> Move the copy from bf->rates a few lines up to ensure that the saved
> retry counts are updated, and that they are really cleared in
> info->status.rates after the call to ieee80211_tx_info_clear_status.
> 
> Cc: stable@vger.kernel.org # 3.10+
> Cc: Thomas Huehn <thomas@net.t-labs.tu-berlin.de>
> Cc: Benjamin Vahl <bvahl@net.t-labs.tu-berlin.de>
> Reported-by: Ben West <ben@gowasabi.net>
> Signed-off-by: Felix Fietkau <nbd@openwrt.org>

Good catch !

Acked-by: Thomas Huehn <thomas@net.t-labs.tu-berlin.de>


> ---
> drivers/net/wireless/ath/ath5k/base.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
> index 48161ed..69f58b0 100644
> --- a/drivers/net/wireless/ath/ath5k/base.c
> +++ b/drivers/net/wireless/ath/ath5k/base.c
> @@ -1663,15 +1663,15 @@ ath5k_tx_frame_completed(struct ath5k_hw *ah, struct sk_buff *skb,
> 	ah->stats.tx_bytes_count += skb->len;
> 	info = IEEE80211_SKB_CB(skb);
> 
> +	size = min_t(int, sizeof(info->status.rates), sizeof(bf->rates));
> +	memcpy(info->status.rates, bf->rates, size);
> +
> 	tries[0] = info->status.rates[0].count;
> 	tries[1] = info->status.rates[1].count;
> 	tries[2] = info->status.rates[2].count;
> 
> 	ieee80211_tx_info_clear_status(info);
> 
> -	size = min_t(int, sizeof(info->status.rates), sizeof(bf->rates));
> -	memcpy(info->status.rates, bf->rates, size);
> -
> 	for (i = 0; i < ts->ts_final_idx; i++) {
> 		struct ieee80211_tx_rate *r =
> 			&info->status.rates[i];
> -- 
> 1.8.0.2
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

end of thread, other threads:[~2013-10-14 20:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-14 19:18 [PATCH 3.12] ath5k: fix regression in tx status processing Felix Fietkau
2013-10-14 20:16 ` Thomas Hühn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox