Skip to contentSkip to conversation

brcmfmac: reserve tx credit only when txctl is ready to send

PATCH In review Wright Feng 2 participants 3 messages Aug 13, 2020 – Aug 18, 2020 Broadcom BRCM80211 IEEE802.11 wireless drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 brcmfmac: reserve tx credit only when txctl is ready to send

The 4329 throughput drops from 40.2 Mbits/sec to 190 Kbits/sec in 2G 11n mode because the commit b41c232d33666 ("brcmfmac: reserve 2 credits for host tx control path"). To fix the issue, host driver only reserves tx control credit when there is a txctl frame is pending to send. And we also check available credit by using "not equal to 0" instead of "greater than 0" because tx_max and tx_seq are circled positive numbers.

Fixes b41c232d33666 ("brcmfmac: reserve 2 credits for host tx control

path")

---
 .../net/wireless/broadcom/brcm80211/brcmfmac/sdio.c  | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +9 -3
index e8712ad3ac45..3c07d1bbe1c6 100644
@@ -664,9 +664,15 @@ static void pkt_align(struct sk_buff *p, int len, int align)
 /* To check if there's window offered */
 static bool data_ok(struct brcmf_sdio *bus)
 {
-	/* Reserve TXCTL_CREDITS credits for txctl */
-	return (bus->tx_max - bus->tx_seq) > TXCTL_CREDITS &&
-	       ((bus->tx_max - bus->tx_seq) & 0x80) == 0;
+	u8 tx_rsv = 0;
+
+	/* Reserve TXCTL_CREDITS credits for txctl when it is ready to send */
+	if (bus->ctrl_frame_stat)
+		tx_rsv = TXCTL_CREDITS;
+
+	return (bus->tx_max - bus->tx_seq - tx_rsv) != 0 &&
+	       ((bus->tx_max - bus->tx_seq - tx_rsv) & 0x80) == 0;
+
 }
 
 /* To check if there's window offered */
Signature · 1 line
2.25.0
#1 lore raw
Quoted 10 lines · Wright Feng

The 4329 throughput drops from 40.2 Mbits/sec to 190 Kbits/sec in 2G 11n mode because the commit b41c232d33666 ("brcmfmac: reserve 2 credits for host tx control path"). To fix the issue, host driver only reserves tx control credit when there is a txctl frame is pending to send. And we also check available credit by using "not equal to 0" instead of "greater than 0" because tx_max and tx_seq are circled positive numbers.

Fixes b41c232d33666 ("brcmfmac: reserve 2 credits for host tx control

path")

Fixes tag should be in one line, but I can fix it.

Quoted 2 lines

And I'll queue this to v5.9.

Signature · 1 line
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
#2 lore raw
In reply to Wright Feng
Quoted 11 lines · Wright Feng

The 4329 throughput drops from 40.2 Mbits/sec to 190 Kbits/sec in 2G 11n mode because the commit b41c232d33666 ("brcmfmac: reserve 2 credits for host tx control path"). To fix the issue, host driver only reserves tx control credit when there is a txctl frame is pending to send. And we also check available credit by using "not equal to 0" instead of "greater than 0" because tx_max and tx_seq are circled positive numbers.

Fixes b41c232d33666 ("brcmfmac: reserve 2 credits for host tx control path")

Patch applied to wireless-drivers.git, thanks.

9a2a0862d973 brcmfmac: reserve tx credit only when txctl is ready to send

Signature · 3 lines
https://patchwork.kernel.org/patch/11711809/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches