Skip to content

WiFi: never wait for a TX buffer in linkoutput, and count the stalls - #1071

Open
JC-000 wants to merge 12 commits into
GideonZ:masterfrom
JC-000:fix/wifi-tx-nowait
Open

JC-000 wants to merge 12 commits into
GideonZ:masterfrom
JC-000:fix/wifi-tx-nowait

Conversation

@JC-000

@JC-000 JC-000 commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #1060

Problem

Whenever the ESP32 WiFi module stops taking frames for a moment, the whole network stack — Ethernet included — freezes for several seconds. When the module stops draining its UART (its RX FIFO fills and it asserts RTS, as a congested or briefly busy module does), the host's pool of TX command buffers empties. The WiFi linkoutput then waits up to 5 s for a buffer while holding the lwIP core lock, so every part of the stack that needs that lock stops too — including Ethernet and the REST API, which have nothing to do with WiFi.

Cause, on current master:

wifi_tx_packet (software/io/wifi/wifi.cc:452) gets a TX buffer through the BUFARGS_NOREPLY path, which blocks on GetBuffer with a timeout while the lwIP core lock is held. A frame that cannot get a buffer waits the full timeout before failing.

What changed and why

linkoutput never waits: it takes a buffer only if the free pool is above a small reserve (GetBufferKeeping, reserve 2), otherwise it returns ERR_MEM immediately. A TCP segment that gets ERR_MEM is kept by TCP and sent again (tcp_txnow on the wake, or its normal retransmit). UDP, ICMP and ARP frames are not retried by the driver; the protocols' own timers apply. A TX-done interrupt wakes the TX path (above a hysteresis) via an lwIP tcpip_callbackmsg, so throughput recovers at once when buffers free. RPC traffic is untouched (it still waits, as before). Every refusal is counted.

The wake after a refusal is a static lwIP message, so nothing is allocated. The 'N' and '~' console writes of the receive interrupt are unchanged.

This change carries the host network counters it is measured with (refused, ovf and rxlong): the counters are the only hardware instrument for it, so they ship with it.

Products. every product with the WiFi module: the Ultimate 64, Ultimate 64 Elite II, C64 Ultimate and the Ultimate-II cartridges (U2+, U2+L). Tested on the Ultimate 64 Elite and the C64 Ultimate.

How I tested it

Host: macOS, with the device-free tests run in an Ubuntu 24.04 container (g++ 13.3). The hardware runs used the test harness from the same machine.

Host tests (device-free, run before and after the change):

  • WiFi TX path, sys_arch, UART interrupt model (the network tests directory): make -C software/io/network/tests all
    • with the change: exit 0; wifi-tx-nowait 15 and wifi-tx-sim 7 tests pass
    • without it: built-in -red targets: for wifi-tx-nowait the legacy waiting code and 15 broken variants, all failing as required; the wifi-tx-sim ones as before (the simulation of the old path shows a longest block of 2975 ms against 0 ms)
  • WiFi task host suite: make -C software/io/wifi/tests (three builds: 104, 104 and 50 tests) passes. wifi.cc includes lwip/priv/tcpip_priv.h for the static message, the same way lwIP's own tcpip_callbackmsg_new builds it; wifi.cc and the lwIP library are built with the same lwipopts, so the message layout matches.

Hardware.

Device Firmware Ultimate FPGA C64 core
Ultimate 64 Elite 3.15a; RED 27949e3f9, GREEN 21c19a9e0 126 1.50
C64 Ultimate RED 3bf2b4561, GREEN e5159553b 126 1.50

RED = the image with only the WiFi send function reverted to master's waiting code; GREEN = the fix. The C64 Ultimate images were loaded cold. On the Elite, RED is a RAM build of the red tree and GREEN is the flashed image. Same test and settings for both: three 3000 ms holds of the module's receive side under a 300 pkt/s WiFi flood. A bench-only diagnostic makes the module stop accepting frames so its transmit buffers run out — the condition a congested or briefly busy module creates.

C64 Ultimate:

per hold (×3) RED (old waiting code) GREEN (fix)
Ethernet ping, max gap 2906 / 2916 / 2955 ms 110 / 110 / 110 ms
Ethernet ping loss 63 / 66 / 64 % 0 %
REST, max latency 2746 / 2906 / 2896 ms 36 / 25 / 36 ms
WiFi frames refused 0 / 0 / 0 854 / 871 / 867

Ultimate 64 Elite:

per hold (×3) RED (old waiting code) GREEN (fix) current head
Ethernet ping, max gap 2974 / 2961 / 2957 ms 105.6 / 105.2 / 105.5 ms 111.2 / 110.5 / 113.9 ms
Ethernet ping loss 66.7 / 66.7 / 66.7 % 0 % 0 %
REST, max latency 3013 / 5177 / 2848 ms 49 / 32 / 61 ms 22.0 / 49.1 / 22.8 ms
WiFi frames refused not captured not captured no counters on the head

The syslog counters did not arrive in the Elite window, so the refused counts are not part of the Elite rows. The RED and GREEN images carry the earlier form of the change. The "current head" column is a RAM build of the PR head with the same bench hold command and #835 added, run with the same test and settings. The head has no counters, so in that run the hold is confirmed only by the module's "00,OK" reply; the ping gap stays at the 10 Hz ping interval (baseline before the holds: 110.2 ms gap, 19.5 ms REST).

Host suites wifi-tx-nowait (15) and wifi-tx-sim (7) pass; built-in RED/legacy targets and mutants are killed.

Standard profile (./run-tests --profile standard), red = master, green = a build carrying this landing set of fixes (this change included), report from python3 tools/e2e_report.py:

  • U64 Elite: 71 of 72 suites pass on master and 71 of 72 with the fixes. The one failure is the same on both, iec-partition-config: it stops at a key-send step because the upstream test's REST backend has no F2 key alias (rest_backend.py:556), a test-side limitation, not an app difference.
  • C64 Ultimate: 71 of 72 on master and 71 of 72 with the fixes. The one failure is again iec-partition-config, here at a "menu screen unavailable" step that also fails on master, so it is not from these changes.

Soaks pass on both devices: mount-cache-leak, listener-soak, network-connection.

Untested

Written with Claude Opus 5.5 in Claude Code.

JC-000 and others added 6 commits November 8, 2026 08:26
extract.awk prints one function definition from a C or C++ file, as it
is. The WiFi TX host tests build against the production wifi.cc by
extracting the functions they exercise instead of linking the file.
The WiFi series adds the same file; this copy lets the TX change stand alone.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Add counters for host network stalls, so that a measurement can be decided
from one console line instead of by guessing:

 - WiFi linkoutput: the wait for a UART TX buffer, as a histogram in
   ticks (0, 1, 2-9, 10-99, 100-999, timed out) and the longest wait. It
   runs under the lwIP core lock, so a long wait is a network-wide stall.
 - DMA UART: the overflow status bit (counted and cleared with bit 3 of
   the interrupt control register, which leaves the enables alone) and
   received frames longer than CMD_BUF_SIZE.

net_counters.h is in network/ because that directory is on the include
path of the lwIP libraries as well as of the applications, and the
variable is a weak definition in the header, so every program that
builds dma_uart.cc links without makefile changes. A task started by
initLwip() prints "NETCTR ..." every 5 s when a counter has changed.

The per-frame console bytes of wifi_rx_isr ('N' and '~') are removed; the
'^' and '!' of the ISR mark starvation, not frames, and stay.

Host tests in io/network/tests: the histogram boundaries, and the real dma_uart.cc and
cmd_buffer.c driven through a model of uart_dma.vhd. The register block
of dma_uart.h is a volatile struct whose status/ictrl and length
registers share an address, so the Makefile generates a test copy of the
header with proxy fields. Each part has a red target with models that
must fail.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The counters stay in every build: other code reads them. The task that
prints them every 5 s does not: a production build must not write to the
console on a timer, and over WiFi a printed line is a syslog frame that
changes the counters the next line prints. The reporter and its
xTaskCreate are now compiled only when NET_COUNTERS_REPORT is 1 (default
0 in net_counters.h; a diagnostic build sets it). The printf code stays in
place, inside the #if.

The host test cuts the real reporter and initLwip out of
network_interface.cc and runs them against FreeRTOS stand-ins: the
default creates no task and prints nothing, the diagnostic setting creates one
task and prints at most one line per 5 s round, only on a change.

Bounded and measurable. Production does no
periodic console output and no task wakeup from the reporter; the
reporter is at most one line per 5 s round.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The branches that add counters insert keys into the line, so the test pins the start and the
end of the line, not every key between. C64-never-waits: no runtime change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
wifi_tx_packet is called by lwIP with the core lock held, and waited up to
5 s (1000 ticks) for one of the 12 UART TX buffers. While the module does not
drain the UART (it rebooted, holds RTS, or its dispatcher is blocked), that
froze Ethernet, every socket, DHCP and DNS for as long as the module stalled,
5 s per frame.

It now takes a buffer without waiting, and only when more than WIFI_TX_RESERVE
(2) are free; otherwise it returns ERR_MEM, which TCP answers by keeping the
segment (TF_NAGLEMEMERR) and UDP by ENOMEM. Requests (BUFARGS) keep their wait
and may use the reserve, so control traffic is not starved by bulk data.

A refused frame raises wifi_tx_starved. The DMA UART interrupt calls a hook
after it has freed a transmitted buffer (DmaUART::SetTxFreeCallback, generic:
the updater and the module link register nothing); wifi.cc's hook, when the
flag is up and the free count is above the reserve again, posts a preallocated
callback message to the tcpip thread (tcpip_callbackmsg_trycallback_fromisr),
which runs tcp_txnow(). Without it a held-back segment waits for the next ACK,
the retransmit timer or lwIP's poll. sys_mbox_trypost_fromisr, which lwIP
declares but sys_arch.c lacked, is added and reports a woken task as
ERR_NEED_SCHED so that the interrupt switches context.

NETCTR gets refused=<n>; the wait histogram keeps counting the frames that got
a buffer, in its first bucket.

Moves toward the real-time design: the core lock is never held across a wait
on the module link.

Host tests (software/io/network/tests): wifi-tx-nowait (no wait, reserve, the
wake, the race between check and flag) and wifi-tx-sim (real lwIP TCP over the
real DmaUART ISR on a simulated clock: throughput old against new, a 3 s
module stall, the wake), each with models that must fail.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
With two TCP connections that both fill the UART, wifi_tx_free_isr posted
tcp_txnow() after every freed buffer once the pool was above the reserve,
and lwIP tried and was refused three times per frame: 12771 refusals in
10 s (1277/s) in the real-lwIP simulation (make wifi-tx-sim), each after
the TCP checksum of the segment, on the Nios. The wake now needs the pool
to be more than WIFI_TX_RESERVE + WIFI_TX_WAKE_HYSTERESIS (2) buffers
free.

Same two-connection run, RTT 5 ms: refusals 12771 -> 4257 (1277/s ->
425/s, one per frame), wake posts 4257 -> 0, delivered 6215220 bytes in
both (old blocking model 6215220). The price: the first TCP frame after a
stalled drain is taken 5.0 ms later instead of 0.6 ms, and after other
traffic took the pool 6.6 ms instead of 2.2 ms (a frame is 2.3 ms on the
UART). Also tried: refusing frames up to reserve+2 while the starved flag
is up; it gives 709 refusals/s for the same bytes, so the refusal side
stays at the reserve.

wifi-tx-sim asserts at most 450 refusals/s for the two connections, a
first frame within 6 ms after the stall and within 8 ms after the other
traffic; wifi-tx-nowait pins no post at reserve+1 and reserve+2 and one
above. Red models: wake without hysteresis (1277/s fails the refusal
bound), hysteresis +8 (19.7 ms fails the restart bound), at-the-edge and
+1 variants in the unit suite.

The C64 never waits on the CPU: fewer refused frames means fewer wasted
TCP checksums on the Nios per frame sent, measured as the refused counter
in NETCTR; the restart delay stays within a few UART frame times.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@chrisgleissner chrisgleissner added bug Existing behavior is incorrect, broken, or regressed; includes supported documentation defects. network Networking and remote services: REST, Socket DMA, FTP, Telnet, and online access. labels Nov 10, 2026
@chrisgleissner
chrisgleissner self-requested a review November 10, 2026 12:30

@chrisgleissner chrisgleissner left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JC-000 thanks for the thorough work here. Returning ERR_MEM from linkoutput is safe: no pbuf is owned, TCP keeps the segment and tcp_txnow retries it, and the starved-flag recheck means a buffer freed in between is not missed.

Requesting changes on these points:

  1. Unrelated removal. wifi_cmd.cc drops the 'N' and '~' debug UART writes from the receive interrupt. That is not mentioned in the description. Please explain it or move it to its own change.
  2. Dead counters. wifi_tx_wait[1..5], wifi_tx_wait_max and NET_WTX_TIMEOUT can no longer change, but the NETCTR line still prints them. Please remove them or say why they stay.
  3. Unchecked allocation. If tcpip_callbackmsg_new returns NULL, the wake never fires and TCP waits for the next send. Please handle that return value.
  4. Description. UDP, ICMP and ARP frames are not retried, only TCP segments, so "ARP re-queues" is not accurate.

I'll merge once these are in.

@chrisgleissner

chrisgleissner commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

@JC-000 thank you for the careful work on the WiFi TX path. I had said I would take this PR over. I am handing it back to you, so please treat it as yours again. I pushed nothing to your branch. This is what is outstanding:

  1. Merge conflict. The branch conflicts with master. The sys_arch commit it carries is already merged through # lwIP sys_arch: round millisecond timeouts up to whole ticks #1067, so a merge of master should drop it.
  2. Unchecked allocation. If tcpip_callbackmsg_new returns NULL, the wake-up is never sent and TCP waits for the next send. Please handle that return value.
  3. 'N' and '~' debug writes. wifi_cmd.cc no longer writes them from the receive interrupt. The change is not mentioned in the description, and tooling/c64u_monitor.py in 1541ultimate-tools counts those characters (docs/c64u-jtag.md). Please either restore them or say why they go and what replaces the monitor's counts.
  4. Dead counters. wifi_tx_wait[1..5], wifi_tx_wait_max and NET_WTX_TIMEOUT can no longer change, but the NETCTR line still prints them. Please remove them or say why they stay.
  5. Description. UDP, ICMP and ARP frames are not retried after ERR_MEM, only TCP segments, so "ARP re-queues" is not accurate.
  6. Proof. The description says the failing half has no hardware reproduction on the base image, and the Ultimate 64 Elite has a green run but no red run. If possible, add the red run, or state that the counters are the proof.

Once these are done, I will review it again.

JC-000 and others added 5 commits November 10, 2026 10:26
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The previous commits dropped them without saying so. tooling/c64u_monitor.py
counts the '~' of unsolicited ESP32 messages.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ead wait counters

wifi_tx_wake_init left wifi_txnow_msg NULL when tcpip_callbackmsg_new failed,
so the TX-done interrupt could never wake the tcpip thread and TCP waited for
its next send. A refused frame now retries the allocation. Host test
no_message_at_init_is_retried_at_the_next_refusal fails without it
(make wifi-tx-nowait-red-no-msg-retry).

wifi_tx_wait[], wifi_tx_wait_max and NET_WTX_* cannot change any more, so they
are removed from net_counters.h and the NETCTR line, with the histogram test.
Nothing reads the NETCTR layout: the reporter test is the only consumer.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ake_init in the WiFi task host tests

The wake message is now a static struct tcpip_msg (TCPIP_MSG_CALLBACK_STATIC) filled in by wifi_tx_wake_init:
nothing is allocated, so there is no NULL to handle, no retry and no lost wake; this replaces the retry added
in the previous commit. The host test checks that the interrupt posts that message and that the tcpip thread's
call of it reaches tcp_txnow (red model: wifi-tx-nowait-red-no-msg-init).

wifi_tx_wake_init is stubbed in io/wifi/tests/wifi_task_stubs.cpp, since WiFi::Init, which that suite extracts,
now calls it. io/wifi/tests and io/network/tests (all targets) pass in an ubuntu:24.04 container.

Correction to the previous commit message: nothing upstream reads the NETCTR layout, but our own bench parser
(net_bench.py) does and is updated outside this repository.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@JC-000

JC-000 commented Nov 10, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for handing it back. All six points are done in new commits on top of a merge of master; nothing was rebased.

  1. Merge conflict. Master is merged in as a merge commit. The sys_arch tick round-up is already in master through # lwIP sys_arch: round millisecond timeouts up to whole ticks #1067, so it no longer appears in the diff. The only conflict was software/io/network/tests/Makefile; both sides' targets are kept. The WiFi task host suite of master (software/io/wifi/tests) needed a stub for wifi_tx_wake_init; it is added, and both host suites pass in an Ubuntu 24.04 container.

  2. Unchecked allocation. The wake message is now a static lwIP message (TCPIP_MSG_CALLBACK_STATIC) filled in by wifi_tx_wake_init. Nothing is allocated, so there is no NULL to handle, no retry and no wake lost to an allocation. (A full tcpip mailbox can still refuse the post; that case was already handled and has its own test.) The host test checks that the interrupt posts that message and that the tcpip thread's call of it reaches tcp_txnow; the model without the message setup fails it (make wifi-tx-nowait-red-no-msg-init).

  3. 'N' and '~' writes. They should not have gone, and the description did not mention it. They are back in wifi_cmd.cc, as on master.

  4. Dead counters. wifi_tx_wait[1..5], wifi_tx_wait_max, NET_WTX_* and the histogram helper are removed, together with their host test. The NETCTR line is now NETCTR refused=.. ovf=.. rxlong=... Nothing in the repository reads the old layout except the reporter test, which is updated, and c64u_monitor.py does not read NETCTR.

  5. Description. Corrected, text below.

  6. Proof. The red run on the Ultimate 64 Elite is done. Same test and settings for both rows: three 3000 ms holds of the module's receive side (bench-only hold command, answered "00,OK" on both), Ethernet ping and REST polled throughout. The ESP32 module in the Elite had to carry that hold first, so the Elite was flashed with the bench image (module included) and its configuration reset before the runs.

    Elite, per hold (x3) RED: old waiting code GREEN: the fix
    image 27949e3f9 (RAM) = green image with only wifi_tx_packet reverted 21c19a9e0 (flashed)
    Ethernet ping, max gap 2974 / 2961 / 2957 ms 105.6 / 105.2 / 105.5 ms
    Ethernet ping loss 66.7 / 66.7 / 66.7 % 0 %
    REST, max latency 3013 / 5177 / 2848 ms 49 / 32 / 61 ms

    The syslog counters did not arrive in this window, so the refused counts are not part of the Elite rows (the C64 Ultimate rows have them). The Elite red image is a RAM build of the red tree; the green is the flashed image. These images carry the earlier form of the change; the changes since (static wake message, counter removal, restored debug writes) are covered by the host tests, not by this hardware run.

Host tests: make -C software/io/network/tests all (every green suite and every red model) and make -C software/io/wifi/tests pass.

Written with Claude Opus and Claude Sonnet in Claude Code.

@chrisgleissner

Copy link
Copy Markdown
Collaborator

Thanks, the four points are addressed: the N and ~ writes are back, the dead counters are gone, the wake message is static so there is no allocation to check, and the description is corrected. The red run on the Elite is a good addition.

One thing left before I approve. The hardware rows ran an earlier form of the change. The head now wakes TCP through a static tcpip message and the counters were removed, and those are covered by host tests only. Could you run the hold test once on the head (ping gap, loss and REST latency) on a C64 Ultimate or the Elite and add the row? No other open points.

@JC-000

JC-000 commented Nov 11, 2026

Copy link
Copy Markdown
Contributor Author

Thanks. I ran the hold test on the head's code on the Ultimate 64 Elite, as a RAM bench build with the hold command and the full-size UDP change (#835) added, with the same test and settings as the earlier rows: three 3000 ms holds, ping max gap 111.2 / 110.5 / 113.9 ms (10 Hz ping), loss 0 %, REST max latency 22 / 49 / 23 ms. The row is added to the description. The head has no counters, so the hold itself is confirmed only by the module's "00,OK".

Written with Claude Opus and Claude Sonnet in Claude Code.

@chrisgleissner

Copy link
Copy Markdown
Collaborator

@JC-000 thanks for the work on this and for the re-run on the head. I am taking the remaining merge work.

What I am adding: one commit that merges current master (6f89946 plus #1085) into fix/wifi-tx-nowait. The only conflict is software/io/network/tests/Makefile, where master added the send-all targets next to yours; the merge keeps both target sets. No other file is edited. With that commit, make -C software/io/network/tests and make -C software/io/wifi/tests pass, and every red target is killed as required.

Testing: I will repeat the hold test red/green on the Ultimate 64 Elite and, if the module can be loaded there, on the C64 Ultimate and the U2+L. The hold needs your bench-only module command that stops the module accepting frames. Could you push it somewhere I can build from (a branch or a patch in a gist), or say which commit carries it? I will not add it to this PR.

If you disagree with the merge commit, say so and I will revert it.

@chrisgleissner chrisgleissner self-assigned this Nov 12, 2026
@chrisgleissner

chrisgleissner commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

@JC-000 to save you some time, I'm happy to write the bench-only module command for the hold test and run it red/green on all three devices, now that the C64 Ultimate can take module builds too. I'll post it with the results, and none of it will be added to this PR. If you already have the command on a branch, a pointer is welcome and I'll use yours.

@JC-000

JC-000 commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

Thanks. We have this underway: one bench-only hold command for both #1071 and #1078 (an optional RTS-off flag for the forced overflow, plus an end-of-hold event that reports whether the RX FIFO overflowed), ported onto current master for raw_u64, u64ctrl and raw_c3. It applies cleanly to master, to this PR's head and to #1078's head, and it builds and passes host tests. It has not run on hardware yet; that happens on our Elite today. I'll post the branch link with the results afterwards. If you'd rather not wait, go ahead with your own.

Written with Claude Sonnet 5.5 and Claude Opus 5.5 in Claude Code.

@chrisgleissner

Copy link
Copy Markdown
Collaborator

@JC-000 great, thank you. This is all yours: I'll wait for your branch and your results and won't run a version of my own. Your bench work across #1071, #1078 and #1079 is much appreciated.

If extra devices help once your branch is up, I'm happy to run the same steps on our C64 Ultimate and U2+L and add the numbers. Just say if you'd like that.

@JC-000

JC-000 commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

The hold branch is up: https://github.com/JC-000/1541ultimate/tree/45bb9428bea4778857bdff5b1c0650878dfa9aec/repro/module-hold (branch repro/module-hold, on 085aad7). It adds module command 0xB1 to raw_u64, u64ctrl and raw_c3, and UCI 03 E5 <ms u32 LE> on the host. Bit 31 of the argument turns module RTS off for the hold (for #1078), and an end-of-hold event 0x6E reports the RX FIFO fill, with bit 15 set when the overflow flag was raised. After fetching, cherry-pick 085aad730..FETCH_HEAD. It applies cleanly to current master, to this PR's head (b9cdfe2) and to #1078's head (49074a0). The three modules build, and the module version has to be bumped for the updater to take it; the README has a script for that. The driver is smoke_hold.py in the same folder and needs only the c64-test-harness.

What ran on our Ultimate 64 Elite, on our bench image plus this branch. That image still has the waiting TX code, so these are the #1071 "before" numbers, under a steady 600 packets/s UDP stream to the WiFi address:

Hold Ethernet ping, longest gap Ping loss REST, slowest
none 108 ms 0 % 17 ms
3 × 3000 ms, RTS on 2899–2922 ms 64 % 2740–2910 ms
1500 ms, RTS on 1459–1474 ms 44–50 % 1376 ms
1500 ms, RTS off 105 ms 0 % 26–39 ms

Every hold answered 00,OK, and the module was alive afterwards. For #1078: our module already has the overflow handling, and we did not capture the 0x6E event (our syslog delivered nothing), so we have not confirmed on our side that the RTS-off hold overflowed the FIFO. On the console, look for Ev 6E … Seq: with bit 15 (0x8000) set. If the overflow does not happen, a longer hold or a heavier stream should cause it. The README has the details. The driver as committed is a cleaned-up copy of the one that ran and has not itself run on a device.

Written with Claude Sonnet 5.5 and Claude Opus 5.5 in Claude Code.

@JC-000 JC-000 changed the title # WiFi: never wait for a TX buffer in linkoutput, and count the stalls WiFi: never wait for a TX buffer in linkoutput, and count the stalls Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Existing behavior is incorrect, broken, or regressed; includes supported documentation defects. network Networking and remote services: REST, Socket DMA, FTP, Telnet, and online access.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WiFi linkoutput waits up to 5 s for a TX buffer under the lwIP core lock, stalling the whole stack

2 participants