Bump in-tree mctp-rs to dymk/mctp-rs @ 1b8b7f5#844
Merged
jerrysxie merged 5 commits intoMay 14, 2026
Conversation
Snapshot replacement of `mctp-rs/src/` and `mctp-rs/Cargo.toml` with dymk/mctp-rs main @ 1b8b7f5 (post-Phase-25/25.5 head). Picks up BufferEncoding trait + EncodingDecoder/Encoder cursors, MctpSerialMedium DSP0253 byte-stuffed framer with CRC-16/X-25 FCS behind opt-in `serial` feature, and `wire_size_of` chunk-sizing fix. High-level `MctpPacketContext::deserialize_packet/serialize_packet` signatures are UNCHANGED between 3d941ba and 1b8b7f5 — zero consumer source changes expected. Carry-forwards from Phase 31 IMPORT-03 preserved: - cargo-husky DROPPED from [dev-dependencies] (workspace-root build script incompatibility) - per-crate rustfmt.toml NOT re-introduced (workspace style governs) - [package.metadata.cargo-machete] ignored block updated to add `crc` (now an opt-in optional dep behind `serial` feature) Source: dymk/mctp-rs main @ 1b8b7f5 Bumps from: 3d941ba (v1.6 baseline)
No semantic change. The source at 1b8b7f5 was formatted under dymk/mctp-rs's nightly rustfmt config (per-crate rustfmt.toml); embedded-services workspace uses stable rustfmt with max_width = 120. Reformat brings the bumped source into line with the workspace style. Source: dymk/mctp-rs main @ 1b8b7f5 (no semantic change)
…-rs bump
- Workspace Cargo.lock regenerated via `cargo build --workspace`.
mctp-rs entry remains source-less (path-pinned per Phase 31).
New transitive entries: crc 3.4.0 + crc-catalog 2.4.0 (both gated
behind opt-in `serial` feature; not in default-features cargo-tree).
- examples/{std, rt685s-evk, pico-de-gallo}/Cargo.lock regenerated via
`cd examples/<name> && cargo update -p mctp-rs`. examples/rt633
does not depend on mctp-rs and is untouched.
- supply-chain/config.toml: added `safe-to-deploy` exemption for
crc 3.4.0. crc-catalog 2.4.0 is already audited via
imports.lock (OpenDevicePartnership/Microsoft, Jerry Xie).
`cargo vet --locked` confirms `Vetting Succeeded`
(220 fully audited, 1 partially audited, 15 exempted).
Source: dymk/mctp-rs main @ 1b8b7f5
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the in-tree mctp-rs workspace member to a newer upstream snapshot, adding an internal buffer-encoding abstraction so media can transparently apply byte-stuffing, and introducing an opt-in DSP0253 serial medium (CRC/FCS + framing) while keeping the high-level MctpPacketContext::{deserialize_packet,serialize_packet} API surface stable for existing consumers.
Changes:
- Add
BufferEncoding+EncodingDecoder/EncodingEncodercursors and thread them throughMctpMedium(de)serialization. - Fix packet chunk sizing in serialization to account for encoding overhead (stuffing) when computing per-packet body size.
- Add a new
serialfeature implementing DSP0253 serial framing + CRC-16/X-25 (with newcrcdependency + vet exemption).
Reviewed changes
Copilot reviewed 11 out of 15 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| supply-chain/config.toml | Adds a cargo-vet exemption for crc 3.4.0. |
| mctp-rs/Cargo.toml | Introduces optional crc dep and serial feature; updates cargo-machete ignored list. |
| mctp-rs/src/buffer_encoding.rs | New encoding abstraction and encoder/decoder cursors (+ unit tests). |
| mctp-rs/src/deserialize.rs | Transport-header parsing updated to read via encoding-aware decoder. |
| mctp-rs/src/lib.rs | Wires in new module and re-exports encoding types; re-exports serial medium behind feature. |
| mctp-rs/src/mctp_packet_context.rs | Decodes packet bodies via EncodingDecoder to support stuffed media. |
| mctp-rs/src/medium/mod.rs | Extends MctpMedium trait with Encoding and updates serialize/deserialize signatures. |
| mctp-rs/src/medium/smbus_espi.rs | Adapts SMBus/eSPI medium to encoding-aware cursors (passthrough encoding). |
| mctp-rs/src/medium/serial.rs | New DSP0253 serial medium implementation + fixtures and tests (feature-gated). |
| mctp-rs/src/serialize.rs | Adjusts chunk sizing to account for encoding wire overhead; writes through encoder. |
| mctp-rs/src/test_util.rs | Updates test medium to the new encoding-aware MctpMedium signature. |
| Cargo.lock | Adds/updates lock entries for new optional crc dependency. |
| examples/std/Cargo.lock | Regenerated example lockfile (git pin churn). |
| examples/rt685s-evk/Cargo.lock | Regenerated example lockfile (git pin churn). |
| examples/pico-de-gallo/Cargo.lock | Regenerated example lockfile (git pin churn). |
The doc previously described InvalidEscape as 'currently unreachable' — that's now stale: SerialEncoding can produce it when the byte following an escape (0x7D) is neither 0x5E nor 0x5D, per RFC1662 §4.2 / DSP0253 §6.4. Addresses code review feedback on the in-tree mctp-rs bump.
This was referenced May 14, 2026
Open
kurtjd
approved these changes
May 14, 2026
tullom
approved these changes
May 14, 2026
dymk
added a commit
to dymk/embedded-services
that referenced
this pull request
May 19, 2026
Add a new method `frame_complete(&self, buf: &[u8]) -> Result<Option<usize>, Self::Error>` to the `MctpMedium` trait that returns `Ok(Some(len))` when buf contains a complete medium-framed packet starting at buf[0], `Ok(None)` when buf has a partial packet, `Err(...)` when buf is malformed. This lets generic consumers (uart-service::Service<R, M>) read packets from byte streams without knowing the framing details: - `SmbusEspiMedium::frame_complete` reads the 4-byte SMBUS header, parses the byte_count field, and returns `Ok(Some(4 + byte_count + 1))` when the full body+PEC has been received. Length-prefix framing. - `MctpSerialMedium::frame_complete` scans buf for the 0x7E end-flag (skipping a leading flag if present) and returns the position +1. DSP0253 sentinel framing. BREAKING CHANGE: this is a new required trait method (no default impl). Both shipped media (SmbusEspi + Serial) are updated in this same commit so the change is non-breaking at the workspace level. Out-of-tree implementations of `MctpMedium` (none known) will need to add a `frame_complete` impl. Refs: v1.8 GENERIC-07. Coordinated with uart-service genericization (commit c2) and the SP-side EcBattery service (v1.8 Phase 36). Also fixes a pre-existing rustdoc intra-doc-link in `MctpMedium::Encoding`'s doc comment (introduced by the in-tree mctp-rs port in upstream PR OpenDevicePartnership#844) that points at the now-private `crate::buffer_encoding` module. Re-points the link to the public `crate::BufferEncoding` and `crate::PassthroughEncoding` re-exports. Surfaced as a CI failure on the nightly/doc job on this PR's first push; trivial to fix here vs as a separate upstream PR.
dymk
added a commit
to dymk/embedded-services
that referenced
this pull request
May 19, 2026
Add a new method `frame_complete(&self, buf: &[u8]) -> Result<Option<usize>, Self::Error>` to the `MctpMedium` trait that returns `Ok(Some(len))` when buf contains a complete medium-framed packet starting at buf[0], `Ok(None)` when buf has a partial packet, `Err(...)` when buf is malformed. This lets generic consumers (uart-service::Service<R, M>) read packets from byte streams without knowing the framing details: - `SmbusEspiMedium::frame_complete` reads the 4-byte SMBUS header, parses the byte_count field, and returns `Ok(Some(4 + byte_count + 1))` when the full body+PEC has been received. Length-prefix framing. - `MctpSerialMedium::frame_complete` scans buf for the 0x7E end-flag (skipping a leading flag if present) and returns the position +1. DSP0253 sentinel framing. BREAKING CHANGE: this is a new required trait method (no default impl). Both shipped media (SmbusEspi + Serial) are updated in this same commit so the change is non-breaking at the workspace level. Out-of-tree implementations of `MctpMedium` (none known) will need to add a `frame_complete` impl. Refs: v1.8 GENERIC-07. Coordinated with uart-service genericization (commit c2) and the SP-side EcBattery service (v1.8 Phase 36). Also fixes a pre-existing rustdoc intra-doc-link in `MctpMedium::Encoding`'s doc comment (introduced by the in-tree mctp-rs port in upstream PR OpenDevicePartnership#844) that points at the now-private `crate::buffer_encoding` module. Re-points the link to the public `crate::BufferEncoding` and `crate::PassthroughEncoding` re-exports. Surfaced as a CI failure on the nightly/doc job on this PR's first push; trivial to fix here vs as a separate upstream PR.
dymk
added a commit
to dymk/embedded-services
that referenced
this pull request
May 19, 2026
Add a new method `frame_complete(&self, buf: &[u8]) -> Result<Option<usize>, Self::Error>` to the `MctpMedium` trait that returns `Ok(Some(len))` when buf contains a complete medium-framed packet starting at buf[0], `Ok(None)` when buf has a partial packet, `Err(...)` when buf is malformed. This lets generic consumers (uart-service::Service<R, M>) read packets from byte streams without knowing the framing details: - `SmbusEspiMedium::frame_complete` reads the 4-byte SMBUS header, parses the byte_count field, and returns `Ok(Some(4 + byte_count + 1))` when the full body+PEC has been received. Length-prefix framing. - `MctpSerialMedium::frame_complete` scans buf for the 0x7E end-flag (skipping a leading flag if present) and returns the position +1. DSP0253 sentinel framing. BREAKING CHANGE: this is a new required trait method (no default impl). Both shipped media (SmbusEspi + Serial) are updated in this same commit so the change is non-breaking at the workspace level. Out-of-tree implementations of `MctpMedium` (none known) will need to add a `frame_complete` impl. Coordinated with the uart-service genericization commit later in this PR. Also fixes a pre-existing rustdoc intra-doc-link in `MctpMedium::Encoding`'s doc comment (introduced by the in-tree mctp-rs port in upstream PR OpenDevicePartnership#844) that points at the now-private `crate::buffer_encoding` module. Re-points the link to the public `crate::BufferEncoding` and `crate::PassthroughEncoding` re-exports. Surfaced as a CI failure on the nightly/doc job on this PR's first push; trivial to fix here vs as a separate upstream PR.
dymk
added a commit
to dymk/embedded-services
that referenced
this pull request
May 19, 2026
Add a new method `frame_complete(&self, buf: &[u8]) -> Result<Option<usize>, Self::Error>` to the `MctpMedium` trait that returns `Ok(Some(len))` when buf contains a complete medium-framed packet starting at buf[0], `Ok(None)` when buf has a partial packet, `Err(...)` when buf is malformed. This lets generic consumers (uart-service::Service<R, M>) read packets from byte streams without knowing the framing details: - `SmbusEspiMedium::frame_complete` reads the 4-byte SMBUS header, parses the byte_count field, and returns `Ok(Some(4 + byte_count + 1))` when the full body+PEC has been received. Length-prefix framing. - `MctpSerialMedium::frame_complete` scans buf for the 0x7E end-flag (skipping a leading flag if present) and returns the position +1. DSP0253 sentinel framing. BREAKING CHANGE: this is a new required trait method (no default impl). Both shipped media (SmbusEspi + Serial) are updated in this same commit so the change is non-breaking at the workspace level. Out-of-tree implementations of `MctpMedium` (none known) will need to add a `frame_complete` impl. Coordinated with the uart-service genericization commit later in this PR. Also fixes a pre-existing rustdoc intra-doc-link in `MctpMedium::Encoding`'s doc comment (introduced by the in-tree mctp-rs port in upstream PR OpenDevicePartnership#844) that points at the now-private `crate::buffer_encoding` module. Re-points the link to the public `crate::BufferEncoding` and `crate::PassthroughEncoding` re-exports. Surfaced as a CI failure on the nightly/doc job on this PR's first push; trivial to fix here vs as a separate upstream PR.
dymk
added a commit
to dymk/embedded-services
that referenced
this pull request
May 19, 2026
Add a new method `frame_complete(&self, buf: &[u8]) -> Result<Option<usize>, Self::Error>` to the `MctpMedium` trait that returns `Ok(Some(len))` when buf contains a complete medium-framed packet starting at buf[0], `Ok(None)` when buf has a partial packet, `Err(...)` when buf is malformed. This lets generic consumers (uart-service::Service<R, M>) read packets from byte streams without knowing the framing details: - `SmbusEspiMedium::frame_complete` reads the 4-byte SMBUS header, parses the byte_count field, and returns `Ok(Some(4 + byte_count + 1))` when the full body+PEC has been received. Length-prefix framing. - `MctpSerialMedium::frame_complete` scans buf for the 0x7E end-flag (skipping a leading flag if present) and returns the position +1. DSP0253 sentinel framing. BREAKING CHANGE: this is a new required trait method (no default impl). Both shipped media (SmbusEspi + Serial) are updated in this same commit so the change is non-breaking at the workspace level. Out-of-tree implementations of `MctpMedium` (none known) will need to add a `frame_complete` impl. Coordinated with the uart-service genericization commit later in this PR. Also fixes a pre-existing rustdoc intra-doc-link in `MctpMedium::Encoding`'s doc comment (introduced by the in-tree mctp-rs port in upstream PR OpenDevicePartnership#844) that points at the now-private `crate::buffer_encoding` module. Re-points the link to the public `crate::BufferEncoding` and `crate::PassthroughEncoding` re-exports. Surfaced as a CI failure on the nightly/doc job on this PR's first push; trivial to fix here vs as a separate upstream PR.
dymk
added a commit
to dymk/embedded-services
that referenced
this pull request
May 20, 2026
Add a new method `frame_complete(&self, buf: &[u8]) -> Result<Option<usize>, Self::Error>` to the `MctpMedium` trait that returns `Ok(Some(len))` when buf contains a complete medium-framed packet starting at buf[0], `Ok(None)` when buf has a partial packet, `Err(...)` when buf is malformed. This lets generic consumers (uart-service::Service<R, M>) read packets from byte streams without knowing the framing details: - `SmbusEspiMedium::frame_complete` reads the 4-byte SMBUS header, parses the byte_count field, and returns `Ok(Some(4 + byte_count + 1))` when the full body+PEC has been received. Length-prefix framing. - `MctpSerialMedium::frame_complete` scans buf for the 0x7E end-flag (skipping a leading flag if present) and returns the position +1. DSP0253 sentinel framing. BREAKING CHANGE: this is a new required trait method (no default impl). Both shipped media (SmbusEspi + Serial) are updated in this same commit so the change is non-breaking at the workspace level. Out-of-tree implementations of `MctpMedium` (none known) will need to add a `frame_complete` impl. Coordinated with the uart-service genericization commit later in this PR. Also fixes a pre-existing rustdoc intra-doc-link in `MctpMedium::Encoding`'s doc comment (introduced by the in-tree mctp-rs port in upstream PR OpenDevicePartnership#844) that points at the now-private `crate::buffer_encoding` module. Re-points the link to the public `crate::BufferEncoding` and `crate::PassthroughEncoding` re-exports. Surfaced as a CI failure on the nightly/doc job on this PR's first push; trivial to fix here vs as a separate upstream PR.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bump in-tree mctp-rs to dymk/mctp-rs @ 1b8b7f5
Bumps the in-tree
mctp-rs/source from3d941ba(currentv0.2.0baseline imported in #823) to1b8b7f5(the head ofdymk/mctp-rs main). This brings the in-tree copy to parity with the dymk fork's main, after whichdymk/mctp-rswill be archived.The high-level
MctpPacketContext::deserialize_packet/serialize_packetAPI signatures are identical between3d941baand1b8b7f5(only internalMctpMedium::deserialize/serializecursor types changed). All 4 in-tree consumers (uart-service,espi-service,embedded-service, plus macro re-exports) use the high-levelMctpPacketContextAPI, so zero consumer source changes were required. Consumer test counts are unchanged at 128.What's picked up
BufferEncodingtrait +EncodingDecoder/EncodingEncodercursor wrappers (src/buffer_encoding.rs, NEW) — stateless cross-medium encoding abstraction; threads throughMctpMedium::deserialize/serializeinternalsMctpSerialMediumDSP0253 byte-stuffed serial framer with CRC-16/X-25 FCS (src/medium/serial.rs, NEW; gated behind opt-inserialfeature)wire_size_ofchunk-sizing fix insrc/serialize.rs(correctly accounts for encoding overhead during packet chunking)SerialEncodingbyte-stuffing implementation (inmedium/serial.rs)Source lineage
Carry-forwards from #823
These edits are preserved across the bump:
cargo-huskyfrom[dev-dependencies](workspace-root build script incompatibility; the source at1b8b7f5still has cargo-husky declared but the in-tree copy must drop it)mctp-rs/rustfmt.toml(workspace style governs; source at1b8b7f5has arustfmt.tomlfor nightly rustfmt, but the workspace uses stable rustfmt withmax_width = 120)[package.metadata.cargo-machete] ignoredblock updated to add"crc"(now an opt-in optional dep behind theserialfeature; cargo-machete would otherwise false-positive at default features)Test results
passedmctp-rsunit testsmctp-rsdoctestscargo test --workspaceexits 0. New mctp-rs tests come frombuffer_encoding.rscursor unit tests at default features. The 41+medium/serial.rsgolden-fixture tests live behind opt-in--features serialand are exercised by thehack-clippycargo-hack feature-powerset job incheck.yml.Cargo.lock churn
Cargo.lockregenerated viacargo build --workspace.mctp-rsentry remains source-less (path-pinned).Cargo.lock:crc 3.4.0andcrc-catalog 2.4.0(both gated behind opt-inserial; neither is reachable fromcargo build --workspaceat default features).cargo tree -p mctp-rsis byte-identical pre/post at default features (verified viadiff).cd examples/<name> && cargo update -p mctp-rs:examples/std,examples/rt685s-evk,examples/pico-de-galloupdated.examples/rt633does not depend onmctp-rsand is untouched.cargo-vet
cargo vet --lockedreports:Vetting Succeeded (220 fully audited, 1 partially audited, 15 exempted).Added one new exemption for
crc 3.4.0assafe-to-deployinsupply-chain/config.toml(alphabetically interleaved viacargo vet fmt).crc-catalog 2.4.0did not require a new exemption — already audited viaimports.lock(OpenDevicePartnership-imported audit by Jerry Xie, Microsoft).CI matrix coverage (
hack-clippy)check.yml'shack-clippyjob runscargo hack --feature-powerset --mutually-exclusive-features=log,defmt,defmt-timestamp-uptimeworkspace-wide across{stable,beta} × {x86_64-unknown-linux-gnu, thumbv8m.main-none-eabihf}. Sincemctp-rsis a workspace member, this matrix automatically exercises the newserialfeature (16 feature combinations total).