Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
### Fixes

- **Golden records: netem loses every bulk flow's segments.** TCP built multi-segment (GSO) packets on the bulk veths even with ethtool tso/gso off, and netem drew loss once per packet, so one flow in about 20 captures saw no loss and failed `loss_seen`. The bulk veths now use `gso_max_segs 1`. A failed capture keeps its records in `<transcript>.failed/`, and new rows check per-flow netem drops (`netem_per_flow`, `bulk_tap_complete`) ([design](docs/design-rocm-ernic-tests.md#round-4-loss_seen-found-a-failed-capture-keeps-its-records)).
- **Golden records: no first connection waits on neighbor discovery.** Right after link-up, about one fresh veth pair in eight lost its first IPv6 neighbor solicitation, and the 1 s retransmit outlasted `tcp_client`'s 1 s dial timeout. The abandoned attempt's RST then counted as a drop on golden-opts-b's IPv6 listener, which read 0 or 1. The workload's veth pairs now have permanent neighbor entries ([design](docs/design-rocm-ernic-tests.md#round-4-status)).
- **Uplinks follow a route change.** The uplink columns were chosen once at startup, so after a route-metric swap they still named the old uplink until a restart, while egress and locality had moved. Auto-detected uplinks are now re-read every `-localityRefreshInterval` (default 60s, 0 = never; pinned `-uplinkInterfaces` are never re-read). An unchanged list costs only the route and lower-device reads; a changed one is read again from sysfs and lldpd and swapped in whole. A failed lldpd read keeps the NIC columns and is retried on later ticks. New counter outcomes under `function="refreshUplinks"`: `unchanged`, `changed`, `lldp_recovered`, `lldp_error`.
- **Egress follows the lowest route metric.** With two routes for the same prefix, `enrich_socket_dest_egress_ifname` named the one listed last, which the kernel lists by ascending metric, so it was the highest-metric route. That is the one the kernel uses last. The lowest metric now wins, and on a tie the first route listed, as in the kernel's lookup.
- **Congestion names are matched whole.** `inet_diag_cong_enum` came from the first three letters, so `dctcp-reno` (DCTCP's fallback when ECN isn't negotiated) read as DCTCP and any name starting `cub` as CUBIC. Names now match exactly: `dctcp-reno` and look-alikes are UNSPECIFIED with their name kept, `bbr1` is BBR1, and `prague` gets its enum. A 2-letter name (`nv`, `lp`) without NLA padding is accepted (the minimum was 4 bytes). The in-tree names are now constants, so decoding them no longer allocates.
Expand Down
4 changes: 2 additions & 2 deletions docs/design-rocm-ernic-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,5 +246,5 @@ Status: done (2026-11-27). The uplink TODO is fixed separately (uplinks follow a
- **`seq_retrans` and DSACK (fixed).** One capture under load had `total_retrans` 13 for 12 drops, with `tcpi_dsack_dups` 1: a spurious retransmit (a TLP) the receiver reported as a duplicate. The row now checks `total_retrans - dsack_dups` == 12. `xtcp2-golden diff` no longer compares `tcp_info_dsack_dups` on the sequence rows (`goldenrec.seqColumns`, beside `rwnd_limited`), so the same capture doesn't then fail the diff; `total_retrans` stays compared.
- **Hunt, old code (17 captures, stopped once the cause was found):** no `loss_seen` failure. One `seq_retrans` (DSACK, above), one ernic dctcp-reno (above), one listener-drop diff (below), and three that timed out at host load 57 to 81 (environmental, not counted).
- **Hunt, with the fix (20 captures, host load 9 to 27):** all 55 rows passed in all 20. Every flow saw netem drops both ways, 60 to 128 per flow, about 2 % of its segments (before: as few as 8). `xtcp2-golden diff` against the fixture was clean in 19; the 20th is the listener flake below.
- **golden-opts-b IPv6 listener drops (TODO):** `sk_mem_info_drops` on the IPv6 port-4000 listener is 1 in the fixture but 0 in some captures, and once the client showed a `total_rto` instead. Seen twice: once in each hunt.
- **Checks:** `deadnix` (nix/ernic/oracle.nix, run-many.nix) and `go-sec` (tools/ipfeed-fixture) still fail on main 14d7e1c38 too (TODO, not this branch).
- **golden-opts-b IPv6 listener drops (fixed, follow-up):** `sk_mem_info_drops` on the dual-stack port-4000 listener read 1 or 0. In a capture that read 1, golden-opts-a made 8 active opens for its 7 clients, sent one RST, and golden-opts-b counted one `TcpExtEmbryonicRsts`. The tcp6 client's first SYN waited on neighbor discovery longer than its 1 s dial timeout, so Go abandoned the attempt and dialled again. The server's SYN-ACK for the abandoned attempt drew the client's RST. `tcp_check_req` reset the half-open request (`embryonic_reset`, net/ipv4/tcp_minisocks.c:964), and `tcp_v6_rcv` counted the segment on the listener (`discard_and_relse`, net/ipv6/tcp_ipv6.c:1944). A guest probe of 30 fresh veth pairs: in 4 of them the first ping6 right after link-up took about 1 s (the ND retransmit, `ND_RETRANS_TIMER`, include/net/ndisc.h:49), and every pair had already joined the solicited-node group. When the RST read 0 instead, the first solicitation had been answered in time. The old `total_rto` sighting is the same race: the kernel's 1 s SYN retransmit won instead of Go's timeout. `pair` now installs permanent neighbor entries on both ends (IPv4 and IPv6), so no handshake waits on ND: 30 of 30 first pings answered in under 0.05 ms, and the listener reads 0. The fixture was recaptured; that listener's drops are the only difference.
- **Checks:** `deadnix` (nix/ernic/oracle.nix, run-many.nix) and `go-sec` (tools/ipfeed-fixture) failed on main 14d7e1c38 too; fixed by #357.
18 changes: 17 additions & 1 deletion nix/microvms/scripts/golden-workload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,16 @@ systemd-run --unit=xtcp2-golden-ns-client --collect \
"$ip_bin" netns exec golden-ns "$TCP_CLIENT" -count 1 -connect 127.0.0.1 -sleep 1h -pads 0 -keepalive 1h

# pair NAME N MTU: netns golden-NAME-a and -b joined by veth0 at MTU, a at
# 10.N.0.1/24 and fd00:N::1/64, b at .2 and ::2.
# 10.N.0.1/24 and fd00:N::1/64, b at .2 and ::2. Each end has a permanent
# neighbor entry for the other, so no first connection waits on neighbor
# discovery. Right after link-up the first IPv6 solicitation went
# unanswered in about one pair in eight, and its 1 s retransmit
# (ND_RETRANS_TIMER, include/net/ndisc.h:49) outlasted tcp_client's 1 s
# dial timeout. The client's RST for the abandoned attempt then reached
# its half-open request: tcp_check_req resets it (embryonic_reset,
# net/ipv4/tcp_minisocks.c:964) and tcp_v6_rcv counts the segment on the
# listener (discard_and_relse, net/ipv6/tcp_ipv6.c:1944), so
# golden-opts-b's listener read 1 drop or 0.
pair() {
local a="golden-$1-a" b="golden-$1-b" n=$2 mtu=$3 ns
for ns in "$a" "$b"; do
Expand All @@ -102,6 +111,13 @@ pair() {
ip -n "$b" addr add "fd00:$n::2/64" dev veth0 nodad
ip -n "$a" link set veth0 up
ip -n "$b" link set veth0 up
local mac_a mac_b
mac_a=$(ip netns exec "$a" cat /sys/class/net/veth0/address)
mac_b=$(ip netns exec "$b" cat /sys/class/net/veth0/address)
ip -n "$a" neigh replace "10.$n.0.2" lladdr "$mac_b" dev veth0 nud permanent
ip -n "$a" neigh replace "fd00:$n::2" lladdr "$mac_b" dev veth0 nud permanent
ip -n "$b" neigh replace "10.$n.0.1" lladdr "$mac_a" dev veth0 nud permanent
ip -n "$b" neigh replace "fd00:$n::1" lladdr "$mac_a" dev veth0 nud permanent
}

# wait_listen NETNS PORT [N]: N listeners (default 1) on PORT, since the
Expand Down
2 changes: 1 addition & 1 deletion pkg/xtcp/testdata/golden/7_3_1/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,5 @@
"yeah"
],
"rows": 186,
"captured": "2026-11-27"
"captured": "2026-11-28"
}
Loading
Loading