Skip to content

router: afxdp underlay#4892

Draft
romshark wants to merge 251 commits into
scionproto:masterfrom
romshark:router_raw_socket2
Draft

router: afxdp underlay#4892
romshark wants to merge 251 commits into
scionproto:masterfrom
romshark:router_raw_socket2

Conversation

@romshark
Copy link
Copy Markdown
Contributor

No description provided.

jiceathome and others added 30 commits May 5, 2025 17:20
Added another filter. Needed to ensure that the kernel does not
do any processing on the packets received by the raw socket.
Expensive stuff would otherwise result (e.g. icmp responses).
Also ditched the PacketSource and Packets() channel. It's too buggy even for
us in tests (crashes after closing the afp).

Added draining for afp once filter is set. Else we get stray packets, which
confuses the test. Did the same in the afp undelay.
Comments, debug stmt and useless error return.
Now passes the benchmark.
Not quite sure what difference it makes, but it sure isn't an sh_test.
In passing added some facility for short debug runs.
This is a feable attempt at making it at least slightly faster than the router.
We used to require more than 3% packet drop. We are now content with 3% or more.
Had to rearrange the code a tiny bit.
In passing, attempting to add the needed capabilities to the router
in integration tests besides the router benchmark.
In passing. Fixed another missing space in router_multi test script.
In passing, further simplified the process of making debug runs of the router
benchmark.
Reduce critical section around address resolution.
Replace hw address map with single address for ptp links.
Presumably code complete. Probably not working yet.
Returns link count instead of connection count,
undersizing processor queues and causing packet
drops under load (DroppedPacketsBusyProcessor).
The frame format is [dst][src][ethertype] but says otherwise.
@romshark romshark self-assigned this Feb 20, 2026
@romshark romshark requested a review from a team as a code owner February 20, 2026 08:05
@romshark romshark changed the title feat[router]: af_xdp underlay feat[router]: afxdp underlay Feb 20, 2026
@romshark romshark changed the title feat[router]: afxdp underlay router: afxdp underlay Feb 20, 2026
@romshark romshark marked this pull request as draft February 20, 2026 08:36
XDP mmap offsets overflow uintptr on 32-bit.
Delete sockfilter_lint.go and add the bpfel build
constraint to portfilter.go instead, so it only
compiles where the generated code exists.
@jiceathome
Copy link
Copy Markdown
Contributor

Whoohoo! I don’t have approval powers, but thanks to Church-Turing separation I can still use my self-bestowed blessing powers: ship it! Thanks for making good the last project of my career. 🎉

Force inet for loopback topologies since XDP
cannot attach to lo. Add scion_integration and
failing-links tests to Docker E2E so both
underlays get identical test coverage.
Remove wrong "scion_" prefix from glob pattern.
Docker compose service names are not prefixed (e.g. br1-ff00_0_110-3)
Increase post-connectivity sleep to 15s for AF_XDP data plane.
eBPF sockfilter: drop IPv4/IPv6 fragments. AF_XDP userspace has
no reassembly path and a first fragment looks like a truncated
SCION packet; SCION negotiates path MTU end-to-end so a fragment
on our port is misconfiguration, non-conformance, or adversarial.

underlay/afxdp: register TX metadata headroom and expose
SubmitCsumOffload; netdev.go probes per-NIC TX-checksum-offload
support via generic-netlink so we only enable it when the kernel
advertises XDP_METADATA_TX_CHECKSUM.

Golden-frame tests assert finishPacket output is byte-identical
to a kernel-generated frame on a veth pair.
cmd/packetgolden regenerates the fixtures deterministically.

router_benchmark: IPv6 acceptance harness — new cases/*6.go, conf
(topology6.json, router6.toml, prometheus6.yml), brload -ipv6.

TX checksum offloading requires Kernel version >= 6.8 and
drivers that advertise NETDEV_XSK_FLAGS_TX_CHECKSUM;
the queue must also use XDP_ZEROCOPY.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants