ath9k: fix regression in sending aggregated packets
PATCH 1/1 ath9k: fix regression in sending aggregated packets
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.
--- drivers/net/wireless/ath/ath9k/xmit.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
drivers/net/wireless/ath/ath9k/xmit.c +4 -1
@@ -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; }
Signature · 1 line
1.7.3.2
Quoted 16 lines · Felix Fietkau
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 <[email protected]>--- drivers/net/wireless/ath/ath9k/xmit.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)drivers/net/wireless/ath/ath9k/xmit.c +0
-0
drivers/net/wireless/ath/ath9k/xmit.c static bool ath_lookup_legacy(struct ath_buf *bf) · line 588
Quoted 8 lines
drivers/net/wireless/ath/ath9k/xmit.c +4
-1@@ -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
Quoted 20 lines · Rajkumar Manoharan
Quoted 19 lines · Felix Fietkau
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<[email protected]>---
drivers/net/wireless/ath/ath9k/xmit.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)diff --git
a/drivers/net/wireless/ath/ath9k/xmit.cb/drivers/net/wireless/ath/ath9k/xmit.cindex 5e29829..ac393a6 100644
---a/drivers/net/wireless/ath/ath9k/xmit.c
+++b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -582,7 +582,10 @@ static boolath_lookup_legacy(struct ath_buf *bf)
tx_info=IEEE80211_SKB_CB(skb);
rates =tx_info->control.rates;
Quoted 7 lines
Quoted 5 lines
- 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