diff mbox series

[1/1] wifi: mac80211: Fix 320 MHz max TPE field parsing.

Message ID 20240812213728.1799255-1-rory@candelatech.com
State New
Headers show
Series [1/1] wifi: mac80211: Fix 320 MHz max TPE field parsing. | expand

Commit Message

Rory Little Aug. 12, 2024, 9:37 p.m. UTC
Transmit Power Count will be one less than the number of HE fields, so
if we do find an extension field, its index will be this number, plus
one, rather than two.

This fixes an issue noted in the iwlmvm driver, where clients
associated at 320 MHz had degraded performance.

Fixes: 584b4bfff5ce ("wifi: mac80211: pass parsed TPE data to drivers")
Signed-off-by: Rory Little <rory@candelatech.com>
---

We noticed and recently reported a 20-30% drop in transmit throughput on BE200
radios, and have identified the issue as being that the TPE sent to the
firmware did not match the TPE reported by the AP. The fault appears to be an
off-by-one error in IE parsing logic. This patch fixes that error.

 net/mac80211/parse.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Johannes Berg Aug. 21, 2024, 9:16 a.m. UTC | #1
On Mon, 2024-08-12 at 14:37 -0700, Rory Little wrote:
> Transmit Power Count will be one less than the number of HE fields, so
> if we do find an extension field, its index will be this number, plus
> one, rather than two.
> 
> This fixes an issue noted in the iwlmvm driver, where clients
> associated at 320 MHz had degraded performance.
> 
> Fixes: 584b4bfff5ce ("wifi: mac80211: pass parsed TPE data to drivers")
> Signed-off-by: Rory Little <rory@candelatech.com>
> ---
> 
> We noticed and recently reported a 20-30% drop in transmit throughput on BE200
> radios, and have identified the issue as being that the TPE sent to the
> firmware did not match the TPE reported by the AP. The fault appears to be an
> off-by-one error in IE parsing logic. This patch fixes that error.
> 

This should be equivalent to my previous fix 5f12dd57a071 ("wifi:
mac80211: correct EHT EIRP TPE parsing")

johannes
diff mbox series

Patch

diff --git a/net/mac80211/parse.c b/net/mac80211/parse.c
index 28aae14db8a9..36a844e536e6 100644
--- a/net/mac80211/parse.c
+++ b/net/mac80211/parse.c
@@ -235,8 +235,8 @@  static void ieee80211_parse_tpe(struct ieee80211_parsed_tpe *tpe,
 		*cnt_out = count + 1;
 		/* separately take 320 MHz if present */
 		if (count == 3 && len > sizeof(*env) + count + 1) {
-			out[4] = env->variable[count + 2];
-			*cnt_out = 5;
+			out[4] = env->variable[count + 1];
+			*cnt_out = count + 2;
 		}
 		break;
 	case IEEE80211_TPE_LOCAL_EIRP_PSD: