linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ath9k: fix regression in sending aggregated packets
@ 2011-08-27  8:25 Felix Fietkau
  2011-08-27  8:35 ` Rajkumar Manoharan
  0 siblings, 1 reply; 3+ messages in thread
From: Felix Fietkau @ 2011-08-27  8:25 UTC (permalink / raw)
  To: linux-wireless; +Cc: linville, rmanohar

The recent commit "ath9k: Send legacy rated frames as unaggregated"
introduced a check to ensure that packets with non-MCS rates set in
the rate series will not be aggregated. However, it failed to check
if the rate series is valid before testing the flags, thus breaking
aggregation for normal MCS-only packets if the last series is unset.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
---
 drivers/net/wireless/ath/ath9k/xmit.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index 5e29829..ac393a6 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -582,7 +582,10 @@ static bool ath_lookup_legacy(struct ath_buf *bf)
 	tx_info = IEEE80211_SKB_CB(skb);
 	rates = tx_info->control.rates;
 
-	for (i = 3; i >= 0; i--) {
+	for (i = 0; i < 4; i++) {
+		if (!rates[i].count || rates[i].idx < 0)
+			break;
+
 		if (!(rates[i].flags & IEEE80211_TX_RC_MCS))
 			return true;
 	}
-- 
1.7.3.2


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

* Re: [PATCH] ath9k: fix regression in sending aggregated packets
  2011-08-27  8:25 [PATCH] ath9k: fix regression in sending aggregated packets Felix Fietkau
@ 2011-08-27  8:35 ` Rajkumar Manoharan
  2011-08-27  8:50   ` Felix Fietkau
  0 siblings, 1 reply; 3+ messages in thread
From: Rajkumar Manoharan @ 2011-08-27  8:35 UTC (permalink / raw)
  To: Felix Fietkau; +Cc: linux-wireless, linville

On Sat, Aug 27, 2011 at 10:25:27AM +0200, Felix Fietkau wrote:
> The recent commit "ath9k: Send legacy rated frames as unaggregated"
> introduced a check to ensure that packets with non-MCS rates set in
> the rate series will not be aggregated. However, it failed to check
> if the rate series is valid before testing the flags, thus breaking
> aggregation for normal MCS-only packets if the last series is unset.
> 
> Signed-off-by: Felix Fietkau <nbd@openwrt.org>
> ---
>  drivers/net/wireless/ath/ath9k/xmit.c |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
> index 5e29829..ac393a6 100644
> --- a/drivers/net/wireless/ath/ath9k/xmit.c
> +++ b/drivers/net/wireless/ath/ath9k/xmit.c
> @@ -582,7 +582,10 @@ static bool ath_lookup_legacy(struct ath_buf *bf)
>  	tx_info = IEEE80211_SKB_CB(skb);
>  	rates = tx_info->control.rates;
>  
> -	for (i = 3; i >= 0; i--) {
> +	for (i = 0; i < 4; i++) {
> +		if (!rates[i].count || rates[i].idx < 0)
> +			break;
> +
Good catch. Let it be descending order that helps to reduce number of iteration in case of
ath9k_rate_control.

--
Rajkumar

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

* Re: [PATCH] ath9k: fix regression in sending aggregated packets
  2011-08-27  8:35 ` Rajkumar Manoharan
@ 2011-08-27  8:50   ` Felix Fietkau
  0 siblings, 0 replies; 3+ messages in thread
From: Felix Fietkau @ 2011-08-27  8:50 UTC (permalink / raw)
  To: Rajkumar Manoharan; +Cc: linux-wireless, linville

On 2011-08-27 10:35 AM, Rajkumar Manoharan wrote:
> On Sat, Aug 27, 2011 at 10:25:27AM +0200, Felix Fietkau wrote:
>>  The recent commit "ath9k: Send legacy rated frames as unaggregated"
>>  introduced a check to ensure that packets with non-MCS rates set in
>>  the rate series will not be aggregated. However, it failed to check
>>  if the rate series is valid before testing the flags, thus breaking
>>  aggregation for normal MCS-only packets if the last series is unset.
>>
>>  Signed-off-by: Felix Fietkau<nbd@openwrt.org>
>>  ---
>>   drivers/net/wireless/ath/ath9k/xmit.c |    5 ++++-
>>   1 files changed, 4 insertions(+), 1 deletions(-)
>>
>>  diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
>>  index 5e29829..ac393a6 100644
>>  --- a/drivers/net/wireless/ath/ath9k/xmit.c
>>  +++ b/drivers/net/wireless/ath/ath9k/xmit.c
>>  @@ -582,7 +582,10 @@ static bool ath_lookup_legacy(struct ath_buf *bf)
>>   	tx_info = IEEE80211_SKB_CB(skb);
>>   	rates = tx_info->control.rates;
>>
>>  -	for (i = 3; i>= 0; i--) {
>>  +	for (i = 0; i<  4; i++) {
>>  +		if (!rates[i].count || rates[i].idx<  0)
>>  +			break;
>>  +
> Good catch. Let it be descending order that helps to reduce number of iteration in case of
> ath9k_rate_control.
That would really just be a very minor micro-optimization and it would 
make finding the first invalid rate harder and the code more convoluted. 
I don't think it's worth changing the patch for that.

- Felix

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

end of thread, other threads:[~2011-08-27  8:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-27  8:25 [PATCH] ath9k: fix regression in sending aggregated packets Felix Fietkau
2011-08-27  8:35 ` Rajkumar Manoharan
2011-08-27  8:50   ` 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).