Search Linux Wireless

Re: [PATCH V2 3/6] brcmfmac: reserve 2 credits for host tx control path

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





Dmitry Osipenko 於 8/11/2020 10:54 PM 寫道:
11.08.2020 11:35, Wright Feng пишет:
..
Hi Dmitry,
We have a fix for this issue. But we got the different test result
numbers from yours, so would you help us verify the same with
following patch in your setup?
With your confirmation, I can make sure we see the same issue.

---
  drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 9 +++++++--
  1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
index e8712ad3ac45..ea07bb1bfe27 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
@@ -664,8 +664,13 @@ 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 &&
+    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 &&
             ((bus->tx_max - bus->tx_seq) & 0x80) == 0;
  }

Hello, Wright!

I tried this patch and it doesn't fix the problem.

Could you please tell what firmware you're using?

I'm using stock firmware that comes from the linux-firmware package and
this NVRAM [1].

[1]
https://github.com/grate-driver/linux-firmware/blob/master/brcm/brcmfmac4329-sdio.acer%2Cpicasso.txt

  brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac4329-sdio for chip
BCM4329/3
  brcmfmac: brcmf_c_process_clm_blob: no clm_blob available (err=-2),
device may have limited channels available
  brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4329/3 wl0: Sep  2 2011
14:48:19 version 4.220.48

It also interesting that you're getting 40Mbit/s. I never managed to get
that speed on 4329 using upstream brcmfmac driver, but was getting it
using downstream BCMDHD driver. At some point I even tried to figure out
what's the difference which makes the upstream driver to have
significantly lower throughput than downstream and had older BCMDHD
ported to a recent upstream kernel, unfortunately I couldn't spot
anything obvious. Having BCMDHD and brcmfmac back-to-back on the same
hardware, the same kernel and using same firmware (IIRC), the BCMDHD was
more than x2 faster. I also remember that I had to enforce HT mode on AP
in order to get speeds over 15Mbit/s using BCMDHD, which made me to
conclude that upstream brcmfmac driver just doesn't support that HT mode
for 4329, but now I'm seeing yours iperf results and it makes me wonder..

Hi Dmitry,

The last time the drivers I used is v5.4 and I was not able to see low throughput issue as you saw. At this time, I changed the base to tag wt-2020-0727 and I am able to reproduce the issue as you did.
TX throughput with wt-2020-07-27 FMAC is 190 Kbits/sec


The root cause should be that tx_max and tx_seq are circle positive numbers, it should not use ">" to check if it still exists available TX credit.
With the solution below, I am able to get the normal throughput.
TX throughput with wt-2020-07-27+patch FMAC is 40.0 Mbits/sec

Regarding another case about 40Mbit/s, I am using 4329b0(4329/2) chip to verify the throughput because we are not able to find 4329b1(4329/3) which is very old product around 10 years ago. The firmware I am using is the same version but the build is for 4329b0. (private internal build - 4.220.48). My host platform is x86_64 with 4 cores on Linux kernel 4.12. I will try your NVRAM when I have time to see if I can find anything.

---
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
index e8712ad..50c8107 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
@@ -664,9 +664,14 @@ 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 */
---



[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux