netboot: stop with the summary before booting Swiss
The transfer completes on hardware -- 293/293 blocks, 299908 bytes in 15.7 s --
but roughly a third of blocks needed a retry, and the numbers that say WHY are
printed by the GC and then scrolled away when Swiss boots. So the one side
that knows whether an ACK failed to transmit or was lost on the wire could not
be read.
netboot now stops after writing the SD card and waits for a button press, and
the summary carries the counters that separate the cases:
desc@+0=N +1=M bad=N lapped=N txto=N
txto is the discriminator: it counts ACKs where TI never set, meaning the
frame never reached the W5100. High txto alongside the host's retries points
at the TX path; txto near zero points at frames sent but lost.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -413,14 +413,23 @@ int netboot_receive(void *dst, u32 maxlen, void (*status)(const char *msg))
|
||||
memcpy(s_dest, frame + NB_HDR, plen);
|
||||
s_dest[plen] = 0;
|
||||
}
|
||||
if (status) { snprintf(line, sizeof(line),
|
||||
"received %u bytes, %u blocks "
|
||||
"(desc@+0=%u +1=%u, %u bad)",
|
||||
(unsigned)got, (unsigned)nblocks,
|
||||
(unsigned)s_shift_hits[0],
|
||||
(unsigned)s_shift_hits[1],
|
||||
(unsigned)bad);
|
||||
status(line); }
|
||||
if (status) {
|
||||
snprintf(line, sizeof(line),
|
||||
"received %u bytes in %u blocks",
|
||||
(unsigned)got, (unsigned)nblocks);
|
||||
status(line);
|
||||
/* txto distinguishes the two reasons an ACK can go
|
||||
* missing: TI never set (the frame did not reach the
|
||||
* W5100) versus sent-but-lost. The host reports the
|
||||
* retries; only the GC knows which kind they were. */
|
||||
snprintf(line, sizeof(line),
|
||||
"desc@+0=%u +1=%u bad=%u lapped=%u txto=%u",
|
||||
(unsigned)s_shift_hits[0],
|
||||
(unsigned)s_shift_hits[1],
|
||||
(unsigned)bad, (unsigned)lapped,
|
||||
(unsigned)s_tx_timeouts);
|
||||
status(line);
|
||||
}
|
||||
return (int)got;
|
||||
}
|
||||
if (frame[18] != NB_OP_DATA) continue;
|
||||
|
||||
Reference in New Issue
Block a user