Public bug reported:

Title: broadcom-sta (wl) on kernel 7.2.6: TCP upload ~2x slower than on
6.17.9 (UDP fine), plus "Unpatched return thunk" warning at module load

Summary
-------
On a MacBook Pro 11,2 (mid-2014) with a BCM4360, the wl driver built from 
broadcom-sta-dkms
works on kernel 6.17.9 but delivers about half the TCP upload throughput on 
7.2.6, with the
same access point, band, position and test server. UDP upload and TCP/UDP 
download are
normal on 7.2.6. The module also triggers a kernel warning when loaded on 7.2.6.

Environment
-----------
- Hardware: Apple MacBookPro11,2, Wi-Fi: Broadcom BCM4360 [14e4:43a0], 
subsystem Apple
- OS: Pop!_OS 24.04 LTS (COSMIC), amd64
- Package: broadcom-sta-dkms 6.30.223.271-31ubuntu1pop1~1787068366~24.04~fd42158
- Kernels tested: 6.17.9-76061709-generic (good), 7.2.6-76070206-generic 
(affected)
- dkms status: broadcom-sta/6.30.223.271 shows "installed" for 6.17.9, 7.0.9 
and 7.2.6
  (7.0.9 had to be built manually with "dkms install broadcom-sta/6.30.223.271 
-k <version>")
- Wi-Fi: 2.4 GHz, channel 1 (HT20), signal ~75-80, regulatory domain FR,
  NetworkManager wifi.powersave=2 and "iw dev wlp2s0 get power_save" reports 
"Power save: off"
- Conflicting modules (b43, bcma, ssb, brcm80211, brcmsmac) are blacklisted;
  only wl and cfg80211 are loaded
- Bluetooth off
- CPU: Intel Haswell; retbleed: Not affected; spectre_v2: Retpolines; IBPB 
conditional; IBRS_FW; STIBP conditional; RSB filling

Test method
-----------
iperf3 against a wired Intel i7 host on the same LAN (192.168.1.98), 10-15 s 
runs,
same access point, same position.

Results
-------
                              6.17.9              7.2.6
TCP send (Mac -> host)        72.3 and 73.6 Mbit/s   44.8, 32.1, 34.9, 29.3 
Mbit/s
                              0 retransmits          0-13 retransmits
TCP receive (host -> Mac)     80.2 Mbit/s            86.9 Mbit/s
UDP receive, 30 Mbit/s        0.085% loss            0.096% loss
UDP send, 60 Mbit/s           (not measured)         0/51791 lost, receiver 
56.7 Mbit/s
Ping to AP (20 packets)       0% loss, avg 1.97 ms   0% loss, avg 2.59 ms

On 7.2.6 the sender's congestion window stays at about 45-62 KB with 0 
retransmits, while on
6.17.9 it grows to 349-557 KB. The UDP send test at 60 Mbit/s shows the 
receiver finishing
0.58 s after the sender, which suggests packets are queued in the driver before 
transmission.

Things tried on 7.2.6 (no clear improvement)
--------------------------------------------
- iperf3 -C bbr: 29.4 Mbit/s
- net.ipv4.tcp_limit_output_bytes raised from 4 MiB to 16 MiB: 43.7 Mbit/s
- qdisc changed from fq_codel to pfifo_fast: 35.1 Mbit/s

Kernel warning at module load (7.2.6 only; not seen on 6.17.9)
-----------------------------------------------------------------
[    5.558362] Unpatched return thunk in use. This should not happen!
[    5.558364] WARNING: arch/x86/kernel/cpu/bugs.c:3776 at 
__warn_thunk+0x10/0x20, CPU#0: (udev-worker)/617
[    5.558470] CPU: 0 UID: 0 PID: 617 Comm: (udev-worker) Tainted: P OE 
7.2.6-76070206-generic
[    5.558480] RIP: 0010:__warn_thunk+0x10/0x20
[    5.558512]  <TASK>
[    5.558515]  warn_thunk_thunk+0x16/0x40
[    5.558521]  getvar+0x20/0x70 [wl]
[    5.558576]  wl_module_init+0x17/0xb0 [wl]
The interface still comes up (wlan0 renamed to wlp2s0) and associates normally.
This warning has been reported since 2024 for wl on other distributions
(Arch, Fedora, CachyOS), so it is probably not the cause of the slowdown, but I 
cannot rule it out.

Expected vs actual
------------------
Expected: TCP upload similar to 6.17.9 (~72 Mbit/s on this 2.4 GHz HT20 link).
Actual: 29-45 Mbit/s on 7.2.6, while radio capability (UDP) is unchanged.

Question
--------
Is a patch for 7.x kernels known that fixes the TCP transmit behaviour or the 
return-thunk
warning? My guess (not verified) is that the driver releases transmitted skbs 
too late,
which throttles TCP via small queues, but I have no data to confirm it.

Attachments
-----------
- full dmesg for the 7.2.6 boot
- /var/lib/dkms/broadcom-sta/6.30.223.271/build/make.log for 7.2.6
- output of: dkms status; apt policy broadcom-sta-dkms; uname -a

** Affects: broadcom-sta (Ubuntu)
     Importance: Undecided
         Status: New

** Attachment added: "3 files"
   
https://bugs.launchpad.net/bugs/2172872/+attachment/6014724/+files/wl-attachments.txt

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2172872

Title:
  Related: Ubuntu bug #2161038 (broadcom-sta-dkms fails to build with
  kernel 7.0), which is a build failure only. Here the module builds and
  works on 7.2.6, but TCP upload is much slower than on 6.17.9.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/broadcom-sta/+bug/2172872/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to