Skip to content

(04) net: single-segment packet guards and mbuf tail edits - #1883

Open
daniel-noland wants to merge 3 commits into
split/dpdk-core/03-buffersfrom
split/dpdk-core/03b-segments
Open

daniel-noland wants to merge 3 commits into
split/dpdk-core/03-buffersfrom
split/dpdk-core/03b-segments

Conversation

@daniel-noland

@daniel-noland daniel-noland commented Oct 3, 2026 •

Copy link
Copy Markdown
Collaborator

Distinguish whole-packet length (PacketLength) from the contiguous head segment exposed by AsRef. Mbuf tailroom, append, and trim-from-end act on the last segment, matching DPDK. Based on #1876.

Packets are single-segment for now: checksums and TAP I/O read only the head segment, so Packet::new and TapDevice reject chained buffers. Buffers are sized to the MTU instead of chaining. TestBuffer stays flat.

Chained-packet support (a segment-chain TestBuffer, chunk-aware checksums, chain-on-write) is deferred until we can measure buffer sizing and TX fast-free on the bench.

Adds native DPDK tests for chained mbuf edits, deep copies, allocation failure, chain rejection, and packet integration, including generated edit sequences checked against a byte model.

🤖 Generated with Claude Code

@daniel-noland
daniel-noland requested a review from a team as a code owner October 3, 2026 21:45
@daniel-noland
daniel-noland requested review from Fredi-raspall and removed request for a team October 3, 2026 21:45
@coderabbitai

coderabbitai Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: e5496a3b-e46d-45db-8c81-b0e07e4300a6

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@daniel-noland daniel-noland changed the title (04b) net: Mbuf and TestBuffer segment semantics (04b) net: single-segment packet guards and mbuf tail edits Oct 3, 2026
@daniel-noland
daniel-noland force-pushed the split/dpdk-core/03b-segments branch from 4faf099 to ab54519 Compare October 3, 2026 23:18
daniel-noland and others added 3 commits October 4, 2026 00:03
Use PacketLength for whole-packet sizing; AsRef exposes only the
contiguous head segment.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Daniel Noland <daniel@githedgehog.com>
Tailroom, append, and trim-from-end now act on the last segment and
return that segment, matching DPDK. Add native mbuf tests for chained
edits, deep copies, and packet integration.

Co-authored-by: Codex <codex@openai.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Daniel Noland <daniel@githedgehog.com>
Packet checksums and TAP reads and writes see only the head segment, so
a chained buffer would be checksummed or written truncated, and a TAP
read could panic trimming across segments. Reject chains in Packet::new
and TapDevice until chained packets are supported.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Daniel Noland <daniel@githedgehog.com>
@daniel-noland
daniel-noland force-pushed the split/dpdk-core/03-buffers branch from 996c9bc to 545f4e9 Compare October 4, 2026 06:05
@daniel-noland
daniel-noland force-pushed the split/dpdk-core/03b-segments branch from ab54519 to 4d77831 Compare October 4, 2026 06:05
@daniel-noland daniel-noland changed the title (04b) net: single-segment packet guards and mbuf tail edits (04) net: single-segment packet guards and mbuf tail edits Oct 4, 2026
@daniel-noland daniel-noland self-assigned this Oct 4, 2026
@daniel-noland daniel-noland added the area/dpdk Related to DPDK (interface with or usage of the library) label Oct 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/dpdk Related to DPDK (interface with or usage of the library)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant