From 803d9c12421f82a2c7b8138457ce832e3a0af922 Mon Sep 17 00:00:00 2001 From: d00f <8052722+DrDoof@users.noreply.github.com> Date: Tue, 18 Aug 2026 22:42:37 +0200 Subject: [PATCH] nic: do not claim a cause for the bounded TX wait The comment said the ASIC never completes a TX when the egress port is in a non-forwarding MSTP state. The guard is worth keeping either way, since an unbounded spin in the DMA wait takes the whole main loop down, but the mechanism is more than the evidence supports and the DMA into the TX ring has no business knowing the egress port at all. --- rtlplayground.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/rtlplayground.c b/rtlplayground.c index cf67699..c6c4006 100644 --- a/rtlplayground.c +++ b/rtlplayground.c @@ -702,12 +702,9 @@ void nic_tx_packet(uint16_t ring_ptr) len += 0xf; len >>= 3; SFR_NIC_CTRL = len; - /* Bounded wait: normally the NIC consumes the frame in microseconds, but - * when the egress port is held in an MSTP non-forwarding state the ASIC - * has been observed to never complete the TX - an unbounded spin here - * then freezes the entire main loop (no STP/LACP timers, no HTTP, no - * ARP) until a power cycle. Give up after ~65k polls and drop the frame: - * losing one packet is recoverable, a frozen switch is not. */ + /* Bounded wait: the NIC normally consumes the frame in microseconds, and + * an unbounded spin here would freeze the main loop for good if it ever + * did not. Dropping one frame is recoverable, a frozen switch is not. */ { uint16_t tx_guard = 0; do { } while (SFR_NIC_CTRL != 0 && ++tx_guard != 0);