Skip to content

(03) dpdk: batch ownership and safety - #1875

Open
daniel-noland wants to merge 1 commit into
split/dpdk-core/01-allocatorfrom
split/dpdk-core/02-batch-ownership
Open

daniel-noland wants to merge 1 commit into
split/dpdk-core/01-allocatorfrom
split/dpdk-core/02-batch-ownership

Conversation

@daniel-noland

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

Copy link
Copy Markdown
Collaborator

I know that the coverage report for this is empty.

Fixing that in a practical way requires n-vm. That is fine, it just arrives later in the stack. I may be able to pull those tests back here. Still working on that. That said, the logic itself is ready for review.

MbufArray frees unused packets in bulk and transfers accepted TX packets
to the PMD. This fixes double frees, dropped-RX leaks, and null Mbuf
construction. Return unsent packets when TX stops making progress.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Daniel Noland <daniel@githedgehog.com>
@daniel-noland
daniel-noland requested a review from a team as a code owner October 3, 2026 05:32
@daniel-noland
daniel-noland requested review from Fredi-raspall and removed request for a team October 3, 2026 05:32
@coderabbitai

coderabbitai Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: dab703d6-9f25-43f7-b4d0-74129d7a532c
📥 Commits

Reviewing files that changed from the base of the PR and between 8c620f5 and fecafd7.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (4)
  • dpdk/Cargo.toml
  • dpdk/src/mem.rs
  • dpdk/src/queue/rx.rs
  • dpdk/src/queue/tx.rs

Included review availability: This review used your included allowance. 3 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.


📝 Walkthrough

Walkthrough

The DPDK crate adds a fixed-capacity owning mbuf batch type. Bulk allocation, receive, and transmit APIs now use this type. Transmit returns packets that the PMD did not accept.

Changes

DPDK mbuf batches

Layer / File(s) Summary
Mbuf batch allocation and ownership
dpdk/Cargo.toml, dpdk/src/mem.rs
Pool::alloc_bulk returns MbufArray or MbufAllocError. MbufArray provides fixed-capacity storage, iteration, and bulk freeing. Mbuf::into_raw transfers ownership of a pointer.
Receive into owning batches
dpdk/src/queue/rx.rs
RxQueue::receive returns an owning MbufArray and uses the shared MBUF_BURST capacity.
Transmit batches and return unsent packets
dpdk/src/queue/tx.rs
TxQueue::transmit accepts an MbufArray, transfers accepted packets to the PMD, and returns the unaccepted tail.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to fecaf

This change moves DPDK packet batches to an owning fixed-capacity type. It also returns packets the PMD did not accept instead of dropping them. No concrete merge-blocking risk was identified. Test coverage is acknowledged as deferred to a later PR in the stack.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 20 functions across 3 files. (1 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title identifies the DPDK batch ownership and safety changes described in the pull request.
Description check ✅ Passed The description discusses coverage and testing for this change and states that the logic is ready for review.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 20 functions across 3 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
  • 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

❌ Patch coverage is 0% with 97 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
dpdk/src/mem.rs 0.00% 74 Missing ⚠️
dpdk/src/queue/tx.rs 0.00% 18 Missing ⚠️
dpdk/src/queue/rx.rs 0.00% 5 Missing ⚠️

📢 Thoughts on this report? Let us know!

@daniel-noland daniel-noland self-assigned this Oct 3, 2026
@daniel-noland daniel-noland added ci:+merge-ready Run all checks which will be run in the merge queue regardless of label status design related to high level design labels Oct 3, 2026
@daniel-noland
daniel-noland added this pull request to stack #1882 October 3, 2026 06:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:+merge-ready Run all checks which will be run in the merge queue regardless of label status design related to high level design

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant