1074. designware_ethernet: what an outside maintainer would fix before the move and the first tag
Raised by a read-only outside review of crates/designware_ethernet, as a stranger meeting it for
the first time would. It changes nothing; it lists what the next lanes change.
The review took its baseline from the review package and reopens none of the decisions it settles. Those are the crate name, the 173 ratified names, the license expression, the provenance notices, the six harnesses and their patches, and the two Motorcomm alias sets (built in #3319). Where a later rule or a later template gate contradicts a ratified name, the item says so and leaves the rename to the release review that the rules provide for.
Reuse: the template partsfoundry/crate-workflows and its scaffold, helpers/crate_move.py,
cargo-mutants, Kani, the crate's own simulator. No new tool.
Goal
A stranger who finds designware_ethernet in its own repository can tell in one screen what it is
for and which board the authors aimed it at. The same stranger can build, test, prove and falsify
it from the README alone, and finds the repository's gates green on the first pull request for the
crate's own reasons.
The public surface at the first tag is the surface the crate means to keep.
What was checked, and how
The tools run, the sources read and what was not run are in the appendix.
Prior art
The comparison with nearby work is in the prior art appendix.
The items
Effort: XS is under an hour for a lane, S half a day, M a day or two. A door is one-way when somebody outside the repository acts on it after the first tag (a public name or path, a published behavior, a layout, a dependency); everything else is two-way and the maintainer decides it. The crate has no release yet, so a public rename is one-way only from the tag on; the items say "one-way at the tag" for those.
P0: blocks the move
-
The template's naming and prose gates refuse the crate as it stands. Finding:
check / standalonerunsspelled_out,register_names,prose_acronyms,passive_voice,prose_capsandtypos_gateat a ceiling of zero with no baseline file. Run over this crate they report 2, 91, 26, 3 (allowance 1), 1 and a missing_typos.toml. nife carries the first three as report counts (helpers/template_report_baseline.txtlines 73 to 75); a crate repository carries no baseline, so the first pull request after the move is red for reasons that are not that pull request's. The sibling crates already moved pass this job onmain, so the gate is as described. The 91 register findings fall into four classes. Thirty-three come from the address rule readingphysical_layer_device_address(an MDIO bus address, five bits) andstation_address(a MAC address) as memory addresses. The rule indesign/naming.mdis about memory. The helper offers its escape hatch only for fields and constants, not for the parameters and bindings that make up most of these. Sixteen are a length without a unit:PROBE_LENGTH(src/cache_coherence.rs:24), the three_LENGTH_MASKdescriptor fields (src/descriptor.rs:101,115,143), the two_RING_LENGTH_REGISTERoffsets (src/registers.rs:396,401), the three burst-length fields ofBusConfiguration(src/network_interface_controller.rs:169-180) and test names. Four are an offset that does not end_REGISTER:DIRECT_MEMORY_ACCESS_REGISTER_PAGE(src/registers.rs:467, used by the kernel andcomponents) andGMAC0_SYSTEM_CONTROLLER_OFFSET(src/jh7110.rs:107, used bymachine_discovery) among them. One is a missing alias (item 10). The 26 acronym findings areRFD,RFA,IOMMU,MII,AXI,MTLand their kin unexpanded at first use in doc comments, andYT8531andPHYin the README's first paragraph. The twospelled_outfindings are item 11. Change in the template: scope the address rule to memory addresses, or acceptstation_addressandphysical_layer_device_addressas the specification's names (both IEEE 802.3 terms), and acceptYT8531as a part number. Change in the crate: rename the private lengths and offsets (PROBE_BYTES, a_BYTESon the burst lengths or a doc saying they are beats). Expand the acronyms once per file, split the README's long sentence and recast two passives. Copy the scaffold's_typos.tomland.github/accepted-wordswithdesignware,motorcomm,gmac,jh,ytandpicosecondsand their reasons. The five public names among the findings are a decision (below). Door: two-way for the private names and the prose; one-way at the tag for the five public names. Effort: M, split between a template lane and a crate lane. -
The manifest points outside the repository and names no repository. Finding:
publish = falsecarries a comment that sends the reader tocrates/publish-allowlist.txt, a file of this tree (Cargo.toml:11). The comment block below it namesnet_stack's transport file by path (Cargo.toml:14-22). The manifest has norepositoryordocumentationfield, whichcargo packagewarns about and which the scaffold's badge row and docs.rs link need. Change: the comment says what a stranger can act on ("set totrueonly in the release that publishes"). Thenet_stacksentence names the two halves by role, not by path. Addrepository. An earlier ruling settles publishing itself, and this block does not reopen it. Door: two-way. Effort: XS.
P1: before the first tag
-
The receive loop and the reclaim loop have no bound, and the recorded mutation runs show it. Finding:
DataPlane::receive(src/data_plane.rs:137-172) loops until a descriptor readsNotYetor a frame arrives. It consumes a run ofDropdescriptors one per iteration with no cap.reclaim(src/data_plane.rs:216-226) loops until the cursors meet. Twelvegaprows in the triage, and the 14 timeouts of the latest census, come from mutants of these two loops and ofreceive_descriptor_wordsthat never end. Cargo-mutants reads a hang where a test would have failed, and the triage defers the fix as a change to production logic. On hardware, a storm of error frames keepsreceivefrom returning to its caller for as long as the device refills faster than the loop reposts; Linux's NAPI budget and every polled driver in the table bound one poll. Change: boundreceiveatRECEIVE_ENTRIESiterations per call and returnNonewhen the budget runs out (the caller polls again). The ring boundsreclaimonce its arithmetic is correct, so give it aTRANSMIT_ENTRIEScap too. Add one test with sixteen error frames in a row. The twelvegaprows then become kills, and the census's timeouts drop. Door: two-way (a caller that saw a frame after sixteen drops now seesNoneand polls again). Effort: S. -
LinkandSpeedlive in the PHY's module but belong to the MAC. Finding:network_interface_controller::mac_configurationandstarttakemotorcomm_physical_layer_device::LinkandSpeed(src/motorcomm_physical_layer_device.rs:152-187;src/network_interface_controller.rs:12). They describe the link the MAC runs at; nothing in them is Motorcomm's. A second PHY module would import its link type from Motorcomm's, and a user who reads the controller module finds the type under a vendor's name. Change: the crate-levellinkmodule holds both, and the PHY module re-exports neither (Decision 1). Door: one-way at the tag (a public path). Effort: S. -
Sixteen compile-time gates were public API. Finding:
pub const …_DO_NOT_OVERLAP: ()items sit in every public module:network_interface_controller(lines 220, 251, 468, 541),management_data_io(234, 351, 394),motorcomm_physical_layer_device(140, 281, 586),jh7110(77, 136) andcache_coherence(62). They exist so a mutation exclusion can cite them, and docs.rs will list unit-typed constants beside the API. The three indescriptor.rssit in a private module and no caller reaches them, which shows the shape wanted. Change: each ispub(crate)with#[allow(dead_code)], asdescriptor.rsdoes; the exclusion still names them (Decision 2). Door: one-way at the tag if they stay public (removing a public item later is a breaking change). Effort: XS. -
The visibility of register and clause 22 constants follows no rule. Finding:
MAC_CONFIGURATION_REGISTERispub(crate)(src/registers.rs:22) while seven of its bits arepub(lines 36 to 79).BASIC_MODE_CONTROL_RESETandBASIC_MODE_STATUS_AUTONEGOTIATION_COMPLETEarepub(src/management_data_io.rs:88,180) while the registers they live in andBASIC_MODE_STATUS_LINK_STATUSarepub(crate). TheManagementDataIotrait takesregister: u8, yet a caller or an implementer must restate0x00and0x01. No caller outside the crate uses any of the stray public bits; the callers reachDIRECT_MEMORY_ACCESS_REGISTER_PAGE_OFFSET_BYTES,REGISTER_WINDOW_BYTES, the two tail pointer registers,MAC_ADDRESS_0_HIGH_REGISTER,MAC_ADDRESS_0_LOW_REGISTERandCHANNEL_STATUS_REGISTER. Change: one rule, written at the top ofregistersandmanagement_data_io. The compatible choice is the narrow one:pub(crate)for every constant no caller uses, since widening later breaks nobody and narrowing later breaks everybody. The whole-map alternative is also defensible: every BSD*reg.hand Linux'sdwmac4.hpublish the complete map, and a kernel half outside the crate is this crate's design. It is the architect's if wanted, and this block recommends against it until a caller asks. Door: two-way now; one-way at the tag. Effort: S. -
The README does not yet carry a stranger through a build, a proof and a falsification. Finding: the scaffold's README shape has
## Building and testing,### Running the proofsand### Running one falsification patch; the README has the install line andpatch -p3in prose (README.md## What is proven) and no build, test, bare-metal, single-harness or undo command. The example (README.md## EXAMPLES) is not a documentation test, socargo testwould not notice it breaking. It names its bindingsoff,v,bandbuf, the clipped forms the crate's own names forbid. After the move the patches apply with-p1, not-p3. The first paragraph says "PHY (physical layer device)" and "YT8531" before the text introduces either (item 1 counts them). Change: add the three sections with real commands from this crate. Include the README as the crate's documentation (#![doc = include_str!("../README.md")]), or move the example to a documentation test socargo testcompiles it. Spell the bindings out. Write-p1once the move has regenerated the patches. Door: two-way. Effort: S. -
The crate's documentation names a bench machine sixteen times and the board never. Finding:
radonappears in the first line of the crate documentation (src/lib.rs:2), injh7110.rsfive times, innetwork_interface_controller.rssix times and inmotorcomm_physical_layer_device.rsfour times. It appears as the owner of the bus configuration, the fallback PHY settings, the device tree and the ports. A reader of the standalone crate has no radon. Neitherlib.rsnor the README names the board the settings describe, the StarFive VisionFive 2, and onlyjh7110.rsexplains "both trees". Change: name the board and its two device trees once inlib.rsand the README, and say "the board" or "the VisionFive 2" where the text saysradon. The bench record stays in nife's notes. Door: two-way. Effort: S. -
The falsification patches target this tree, and the move must regenerate them. Finding: every patch names
a/crates/designware_ethernet/src/…and three carry aName:line in their context (falsifications/proofs.a_coherent_verdict_…,…transmit_descriptor_…,…every_ring_offset_…). The template'sproofs / falsifyapplies withgit apply -p1from the crate root and the move deletes everyName:block, so the patches as they stand would fail there.helpers/crate_move.pyalready regenerates them (regenerate_patch) and refuses a patch that applies only at an offset (patch_application,-F0). Change: nothing new; the move's pull request shows all six regenerated patches applying with-F0and each turning its own harness red, and the README's command follows (item 7). Door: two-way. Effort: XS. -
Two rename artifacts in documentation. Finding:
CLOCK_RANGE_SHIFTcarries#[doc(alias = "GMAC_MAC_MANAGEMENT_DATA_IO_ADDRESS_REGISTER_CR_SHIFT")](src/management_data_io.rs:21), a spelling no source has; its doc comment names the real one,GMAC_MAC_MDIO_ADDR_CR_SHIFT, andregister_namesflags the mismatch. The two100BASE-TXconstants open their doc comments with their own names in the place the source spelling goes (src/management_data_io.rs:129,134) where every neighbor opens withANLPAR_…; the aliasesANLPAR_TX_FDandANLPAR_TXare right. Change: the alias readsGMAC_MAC_MDIO_ADDR_CR_SHIFT; the two openings read(ANLPAR_TX_FD, OpenBSD mii.h)and(ANLPAR_TX, OpenBSD mii.h). Door: two-way. Effort: XS. -
100BASE-TXmeets the spelled-out gate. Finding:spelled_out.pyrefusesAUTONEGOTIATION_LINK_PARTNER_100BASE_TXand…_100BASE_TX_FULL_DUPLEX(src/management_data_io.rs:133,139):txis on the spelled-out list and the helper never keeps a source spelling for an integer constant. The review package accepted the names as the standard's term, anddesign/naming.mdsays a specification's term of art keeps its spelling inside a name this tree authors.100BASE-TXis IEEE 802.3's name for the physical layer. ItsXstands for the 4B5B encoding, so "transmit" would be a wrong word, and the names arepub(crate). Change: in the template, a term-of-art allowance for100BASE_TX(and100BASE_T4's kin) thatspelled_out.pyreads, with the reason, and no rename. If the template keeps the rule as it is, the fallback is…_100BASE_T_X…, which nobody writes, or a renaming that drops the standard's name, which this block recommends against. Door: two-way (private names). Effort: XS, template lane.
P2: later
The P2 items are in the appendix.
Decisions for the architect
Four one-way doors, all ruled and built. Each ruling, its date and an example are in the decisions appendix.
Open decisions
None for calef from this block. calef ruled the v0.1.0-pre.1 tag on 2026-11-19 (UTC): tag after a
green release dry run, and publish nothing. calef already holds the crate's release name review,
which covers the provisional names of items 12, 15 and 18.
Done when
The checks are in the done-when appendix.
BUGS
- Items 1 and 11 are built in the crate and not in the template, which has no allowance for either shape; Decision 4 ratifies the crate's names instead.
- Item 16: mainline's tree does not invert the 10 Mbit/s transmit clock and the vendor tree does. Which is right for the board is not measured; it is a bench step.
- Items 15 and 17 cite Linux's
motorcomm.cand the controller databook from memory, marked so in the text. The review took the crate's own account of OpenBSD as given. - The review did not run Kani, cargo-mutants or Miri, and did not build at
rust-version1.88. The template's weeklymsrvjob will; a lane that touches the proofs runscargo kanibefore it pushes.
Finding status
- Item 1 (P0), the template's naming and prose gates: Done, #3569, #3624 and #3634.
- Item 2 (P0), the manifest's outside pointers and
repository: Done, #3624. - Item 3 (P1), the receive and reclaim bounds: Done, #3624 and partsfoundry/designware_ethernet#10, whose test reaches the receive budget.
- Item 4 (P1),
LinkandSpeedin alinkmodule: Done, #3569. - Item 5 (P1), the sixteen compile-time gates: Done, #3569.
- Item 6 (P1), one visibility rule for the register constants: Done, #3624.
- Item 7 (P1), the README's stranger path: Done, #3624, #3634 and partsfoundry/designware_ethernet#7.
- Item 8 (P1), the bench machine's name and the board's: Done, #3624 and partsfoundry/designware_ethernet#5.
- Item 9 (P1), the falsification patches regenerated: Done, #3634.
- Item 10 (P1), two rename artifacts: Done, #3624.
- Item 11 (P1),
100BASE-TXagainst the spelled-out gate: Done, #3624. - Item 12 (P2), literal field values: Done, partsfoundry/designware_ethernet#9.
- Item 13 (P2), a short buffer loses the frame: Done, partsfoundry/designware_ethernet#9.
- Item 14 (P2), the extended-address port restored on failure: Done, partsfoundry/designware_ethernet#9.
- Item 15 (P2), a defaulted drive current: Done, partsfoundry/designware_ethernet#9.
- Item 16 (P2), the fallback's 10 Mbit/s transmit clock inversion: Waiting on a board run.
- Item 17 (P2), the stale-transmit verdict and the receive clock: Done, partsfoundry/designware_ethernet#9.
- Item 18 (P2), the transport's own peek: Done, partsfoundry/designware_ethernet#9 and #3939.
- Item 19 (P2),
starttwice: Done, partsfoundry/designware_ethernet#9. - Item 20 (P2), small text fixes: Done, #3624 and partsfoundry/designware_ethernet#9.
- Item 21 (P2), the crate root's descriptor re-exports: Done, partsfoundry/designware_ethernet#9.
- Decision 1, where the link type lives: Done, #3569.
- Decision 2, the compile-time gates are not API: Done, #3569.
- Decision 3, the five public names: Done, #3569.
- Decision 4, the five names that say what they hold: Done, #3624.
- The
v0.1.0-pre.1tag: Waiting on a green release dry run (ruled 2026-11-19 UTC). The dry run's gate needs a full mutation run green on the same commit, and the crate's scheduled run still defers its record. - Publishing: Waiting on the publishing hold, which keeps every crate unpublished until the last outside-review milestone closes (ruled 2026-11-18 UTC).
Follow-on
- Outstanding. Each line under Finding status that is not Done, checked against both repositories' main.
Index row
An outside review of designware_ethernet before its move. Two items would turn the new
repository's first pull request red, nine land before the first tag, and ten follow later. The nine
cover the unbounded receive loop behind twelve recorded mutation gaps, the link type's home, twelve
public compile-time gates, an unruled visibility mix and the README's missing stranger path. They
also cover a bench machine named sixteen times, the patches the move regenerates, two rename
artifacts, and 100BASE-TX against the spelled-out gate.