816. designware_ethernet: proven DesignWare Ethernet QoS logic, released on its own
(From calef's rulings on pull request #1806; the title and slug are drafts. Milestone 813 (a proven FAT crate released on its own) is the shape this follows.)
calef's rulings, quoted from the maintainer comments on #1806 of 2026-10-07 (UTC):
- Policy: "Each publish-ours crate (NVMe, e1000e, the DesignWare pair, the JH7110 pair, xHCI, and
portable_executableonce it carries proofs) is published when ready (proofs passing, API stable), each through its own milestone at its review." His words: "Since the consumer would be other hobby OSes, I think it makes sense to publish them. [...] a nice legacy is a bunch of hobby oses that use its parts." - Crates: "one milestone per crate, minted now, each keeping its tree name (all free on crates.io as of today) [...] Names are ratified now and permanent on first publication." His words: "Yes, one per crate".
- The release rules are forks 1 to 4 and 6 of the same pull request, applied in Release below.
What exists, checked 2026-10-07 (UTC)
crates/designware_ethernet: 2,513 code lines (3,596 with comments), written by milestone 53 (the board's own peripherals: network and storage on real silicon), which is PARTIAL. It drives the Synopsys Ethernet QoS controller (snps,dwmac-5.20), the JH7110's two ports behind Motorcomm YT8531 PHYs on radon. The 4.x and 5.x descriptor format only; the 3.x GMAC that milestone 655 (DMA on a non-coherent RISC-V machine) names for the TH1520 would not fit.- Three Kani harnesses, each with a falsification patch: a delivered frame always fits the buffer and the room, every ring offset is inside the region, and the PHY link decode returns a link only the registers justify.
- Class B in #1806's note
notes/releasable-crates-2026-10-07.md. The cut, which is codebase rule 2 (a driver gets what it needs passed in): inlineaddress_space_layout::pair_page(src/lib.rs), and have the caller pass the register region instead ofjh7110::discoveranddiscover_aon_sysconreading aDeviceTreeBlob. The device-tree queries move to the kernel side, which already depends ondevice_tree_blob. The tests alsoinclude_bytes!a fixture from../../device_tree_blob/tests/fixtures/, outside the package, whichcargo packagecannot ship. - The crates take plain values, by the ruling in milestone 857 (crates released on their own).
- Cut on 2026-10-25 (UTC) by #2719. The crate names the compatible strings and node names, and
Discovered::from_node,mainline_phyandvendor_phydecode a node's properties. The walk ismachine_discovery::jh7110::designware_ethernet, and the fixtures moved with its tests. The two virtual addresses thatpair_pageplaced moved tocrates/driver_process_contract. - Its consumers:
kernel/src/designware_ethernet.rs(clocks, reset, PHY, coherence, rings),kernel/src/user/designware_ethernet_service.rs,kernel/src/memory.rs,kernel/src/network_bench.rs, and incomponents/,designware_ethernet_transport.rsandnet_stack.rs. - crates.io answers 404 for the name (checked 2026-10-07).
Reuse: the alternatives were surveyed in #1806's other-implementations.md appendix (looked up
2026-10-07), and none is taken, because calef ruled this crate "publish ours". elliott10's
dwmac-my 0.2.0 (2026-02, MIT) is the one Rust DWMAC crate on crates.io, with 35 downloads, no
reverse dependencies and no proofs found. Linux's stmmac (GPL-2.0) stays the reference for
behavior and is read, never copied. No upstream offer goes anywhere, by the ruling in
milestone 814 (proven NVMe queue logic).
What is proven
Each row is a property this crate must prove before it publishes. The harness cell reads as in
milestone 813's table. Each patch is at crates/designware_ethernet/falsifications/. All 3 proven
under stock Kani.
| property | harness |
|---|---|
| A delivered frame always fits the buffer and the room | proofs::a_delivered_frame_always_fits_the_buffer_and_the_room |
| Every ring offset is inside the region | proofs::every_ring_offset_is_inside_the_region |
The PHY link decode (motorcomm_physical_layer_device::link_from_registers, which motorcomm_physical_layer_device::read_link calls) is total and sound: any register answer yields a link or none without a panic, and a link needs the status bit up and the PHY not isolated, autonegotiation complete when it is on, and a speed and duplex both ends advertise (or the forced bits when it is off) |
proofs::a_link_is_decoded_only_from_what_the_registers_say |
The third row answers the question BUGS asks below: the PHY's answers are device input and the
link decode is the state a stranger's driver acts on. Its falsification patch drops the isolate
check. Not proven: the register reads in motorcomm_physical_layer_device::read_link (the double read of the latched status
bit), MDIO sequencing (mdio), the PHY configuration writes, the DMA-coherence probe's verdict (cache_coherence)
and controller bring-up.
Release, by #1806's rulings
- The name is settled before anything leaves (857's Fork 5 as calef amended it on 2026-10-11 UTC).
script/names designware_ethernetreports it ratified, crates.io answers 404 for it (or it is already ours), andpartsfoundry/designware_ethernetdoes not exist yet.script/crate-standalonechecks the first. - Make the cut above.
cargo tree -p designware_ethernetthen lists no nife crate, and the tests read only fixtures inside the package. - In the tree,
script/verifyproves the harnesses andCargo.tomlsayspublish = false. - The package meets Fork 3 of
milestone 857 (crates released on their own).
cargo package --listshows its harnesses and falsification patches. - Ready means proofs passing and the API stable.
Milestone 814 (proven NVMe queue logic)
says how each is measured; here the soak is step 6. When the soak exits, calef adds it to the
lint-checked publish allowlist. The
partsfoundry/designware_ethernetrepository is created when the crate moves, on the shared CI template (milestone 887), through reusable workflows: Kani throughkani-github-action, lint, release. Its release workflow refuses to publish unless the proof job is green. No harness here readstarget_arch, so stock Kani proves them. §218 (carry a Kani patch so riscv64 is proved) applies only if a harness comes to need riscv64. Milestone 589 (Kani can prove riscv64 from the hosts we already have) built it. - Soak, as its own repository, until the soak's five end conditions in the runbook hold.
- Publish and consume the release by version, by the runbook's publication steps.
Parity
Pure logic, tested on the host against a simulated controller. This lane built it on 2026-10-07
with the pinned nightly for aarch64-unknown-none-softfloat, riscv64imac-unknown-none-elf,
x86_64-unknown-none and the host, all exit 0. The release workflow builds the same four. The
silicon is riscv64 only; the crate is not.
Standalone
script/crate-standalone designware_ethernet is clean: the manifest and files pass, the crate has
no dependency, it builds on 1.88 for the host and the three bare-metal targets, stock Kani proves
all six harnesses, and each falsification patch makes its harness fail. script/names reports the
crate's name and all 173 of its Name: blocks ratified.
Before the move
The shared template's check job holds a crate repository's names and prose at a ceiling of 0, and
script/crate-standalone runs none of those gates. Run over the tree script/crate-move --dry-run
stages, at the template commit the moved crate repositories pin, they find:
| gate | findings | what they are |
|---|---|---|
register_names |
91 | 60 uses of address with no bus or mac qualifier, where it means a PHY's management bus address or the station (MAC) address; 20 lengths and sizes with no unit, burst lengths among them; 4 offsets that do not end _REGISTER; 2 constants the gate calls unexpanded; 3 doc comments that state a source spelling with no matching alias |
spelled_out |
2 | the two private 100BASE-TX constants: the gate reads TX as transmit, where it is the standard's name for the twisted-pair layer |
prose_acronyms |
25 | acronyms in doc comments not expanded at their first use |
Each is a rename or a doc-comment edit in this tree before the move, with its consumers. A rename of a public name the architect ratified goes to the architect as one table before the move; the maintainer decides the private names, parameters and tests provisionally. The README meets the template's prose caps.
Review before release
- The public API speaks the device's vocabulary, by the test milestone 813 states. A reviewer judges
this; no script can. Known today:
Handoffis nife's spawn ABI. The cut removedjh7110::discover, which took aDeviceTreeBlob. - The architect cleared the crate's review on 2026-11-11 (UTC), which approves creating
partsfoundry/designware_ethernet. The clearance covers neither the tag nor a publication.
Exit
A check proves it. In nife, cargo tree --locked -i designware_ethernet resolves to v0.1.x from
crates.io with a checksum in Cargo.lock, crates/designware_ethernet no longer exists, and the
tree builds for all three targets. In partsfoundry/designware_ethernet, the run that published 0.1.0
shows the Kani job green ahead of the publish job, and every harness's falsification patch makes its
proof fail. The five soak criteria of release step 6 hold before it publishes.
The name check of release step 1 passes first, by Fork 5 of milestone 857. Before the move,
script/crate-standalone designware_ethernet exits 0 in nife, and every row of What is proven
names a harness that stock Kani proves in the copy and whose falsification patch makes it fail. No
crate publishes without the proofs milestone 857 (crates released on their own) requires.
What the crate no longer cites
The crate's source cites nothing of this tree beyond its Name: blocks. This section keeps the
links it carried, by milestone 857's provenance rule.
src/lib.rs, the crate root: the design lives innotes/designware-ethernet.md.src/data_plane.rs,DataPlane:notes/designware-ethernet/the-hardware.mdexplains the held-back receive slot.src/regs.rsandsrc/motorcomm_physical_layer_device.rs, each module's doc: the register pages and the PHY settings are innotes/designware-ethernet/the-hardware.md.src/cache_coherence.rs, the module's doc:notes/designware-ethernet.md, "Is radon's DMA coherent? Yes, by measurement", records the probe reportingCoherenton radon over three boots on 2026-10-20 (UTC).src/descriptor.rs,rx_verdict: the distrust of every descriptor field applies finding 6 ofnotes/shared-page-audit.md(two virtio drivers trusted the buffer index the device wrote) to a third NIC.src/tests.rs, the module's doc: lane maintainer/mutation-triage-2026w42 split the tests out oflib.rson 2026-10-12 (UTC) under §282 (when a file is split, the parent becomes an index).Cargo.toml, the package comment: the pure-logic split is §7 (the testing harness)'s, and the crate's scope came from milestone 53 (the board's own peripherals: network and storage on real silicon).
BUGS
- Steps 5 and 6 wait on milestone 887 (one CI template) and on 610's co-change column.
- Milestone 53 (the board's own peripherals: network and storage on real silicon) is PARTIAL and its network lane is active, so the API is still moving.
- The device-tree fixtures (
tests/fixtures/*.dts) are excerpts of the mainline and vendor JH7110 trees. Their licenses were not checked here; record each beforecargo packageships them. - MDIO sequencing, the PHY configuration writes and controller bring-up have unit tests against the simulator and no harness.
needs_personisyesbecause the exit includes a publication only calef can approve. Everything before step 7 can start now.
Follow-on
- Done. The rename pass and the outside review's findings that precede the move
(1074 says which). The crate passes the template's
naming and prose gates, bounds
receiveandreclaim, and its manifest points at its own repository. - Done. The move. The crate lives at
partsfoundry/designware_ethernet,crates/designware_ethernetno longer exists, andcomponents,driver_process_contractandmachine_discoverypin a commit of the repository'smainby git revision. - Outstanding. The tag
v0.1.0-pre.1, which waits for calef, the soak's end conditions, the publication and nife consuming the release by semantic version. Checked bygit ls-remote --tags https://github.com/partsfoundry/designware_ethernet, which lists no tag.
Index row
nife's Synopsys DesignWare Ethernet QoS controller logic, three Kani proofs and their falsification
patches, cut free of nife's device tree and address map and published on crates.io as
designware_ethernet 0.1 from its own nifeos repository, then consumed back by nife.