diff --git a/gc_bba_test/source/netboot.c b/gc_bba_test/source/netboot.c index 0c4bd92..804db6c 100644 --- a/gc_bba_test/source/netboot.c +++ b/gc_bba_test/source/netboot.c @@ -182,7 +182,17 @@ static int send_ack(u16 seq) * out (TI only means TXFrameDrain handed it to the W5100), and if it did * not, the host's retransmit covers it. Blocking longer here would only * slow the common case to protect against the rare one. */ - for (i = 0; i < 200; i++) { + /* Poll a FEW times, not 200. Each bba_r8 is a whole EXI transaction + * (lock, select, header, gap, read, deselect, unlock) at tens of + * microseconds, so 200 of them is ~12 ms burned on the ONE path the host + * is waiting on -- and it only burns them when TI is slow, which is + * exactly when the host is closest to timing out. That turns a slow + * transmit into a missed deadline instead of just a slow one. + * + * TI is not needed for correctness here: the host retransmits anything + * it does not get an ACK for, and the GC re-ACKs duplicates. A handful + * of polls is enough to count genuine failures in txto. */ + for (i = 0; i < 8; i++) { ir = bba_r8(REG_IR); if (ir >= 0 && (ir & IR_TI)) return 0; diff --git a/scripts/send-dol.py b/scripts/send-dol.py index 22e31a2..bce698e 100755 --- a/scripts/send-dol.py +++ b/scripts/send-dol.py @@ -58,10 +58,11 @@ def main(): ap = argparse.ArgumentParser() ap.add_argument("iface", help="network interface facing the GameCube") ap.add_argument("dol", help=".dol to send") - ap.add_argument("--timeout", type=float, default=0.1, - help="per-block ACK timeout in seconds (default 0.1). " - "The round trip is a few ms on a LAN, so 0.5 made " - "every lost ACK cost half a second.") + ap.add_argument("--timeout", type=float, default=0.3, + help="per-block ACK timeout in seconds (default 0.3). " + "The GC needs ~20 ms per block and the variance is " + "what matters: at 0.1 roughly a third of blocks " + "overshot and each miss cost a full timeout.") ap.add_argument("--retries", type=int, default=20, help="per-block retransmits before giving up (default 20)") ap.add_argument("--dest", default="/gc_bba_test.dol",