Skip to content

fix pipeline drops stats - #1706

Open
Fredi-raspall wants to merge 1 commit into
mainfrom
pr/fredi/fix-stats-nth
Open

fix pipeline drops stats#1706
Fredi-raspall wants to merge 1 commit into
mainfrom
pr/fredi/fix-stats-nth

Conversation

@Fredi-raspall

Copy link
Copy Markdown
Contributor

The prior logic computed the pipeline drops by comparing the number of packets received with the number of packets output by the pipeline. However, there are received packets that the pipeline wouldn't normally output (because they need not be transmitted) but which should not be considered drops: local packets.

So, the old logic was accounting those as pipeline drops, providing false positives on the number of drops.

Fix this by letting the pipeline stats stage let those packets through (until the pkt injection lands) and make sure the driver ignores them on xmit.

Also, remove the scaffolding for packet injection.

@Fredi-raspall
Fredi-raspall requested a review from a team as a code owner August 7, 2026 16:11
@Fredi-raspall
Fredi-raspall requested review from Copilot and daniel-noland and removed request for a team August 7, 2026 16:11
@Fredi-raspall Fredi-raspall self-assigned this Aug 7, 2026
@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8642395e-5167-407e-b148-5dcd5345b018

📥 Commits

Reviewing files that changed from the base of the PR and between d6998e6 and f74e422.

📒 Files selected for processing (1)
  • dataplane/src/drivers/kernel/worker.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • dataplane/src/drivers/kernel/worker.rs

📝 Walkthrough

Walkthrough

The worker now transmits only delivered pipeline outputs, tracks selected and attempted packets separately, and computes drops from all outputs. Packet::enforce now preserves local packets. tx_packet reports missing output-interface metadata as a pipeline error.

Changes

Packet transmission behavior

Layer / File(s) Summary
Verdict preservation and transmission guard
net/src/packet/mod.rs, dataplane/src/drivers/kernel/worker.rs
Packet::enforce preserves DoneReason::Local. tx_packet requires DoneReason::Delivered and handles missing output-interface metadata as a pipeline error.
Pipeline output accounting
dataplane/src/drivers/kernel/worker.rs
The worker counts selected and attempted transmissions separately, transmits only delivered outputs, updates transmission logging, and calculates drops from total pipeline outputs.

Possibly related PRs

Suggested reviewers: daniel-noland

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the primary change: correcting pipeline drop statistics.
Description check ✅ Passed The description directly explains the false pipeline-drop statistics and the local-packet handling changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

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

@Fredi-raspall Fredi-raspall added bug Something isn't working ci:+vlab Enable VLAB tests labels Aug 7, 2026
@Fredi-raspall Fredi-raspall reopened this Aug 7, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@dataplane/src/drivers/kernel/worker.rs`:
- Around line 241-250: The output-packet handling around get_done must handle
missing completion verdicts in release builds instead of relying on
debug_assert!. Ensure packets without a verdict are assigned Delivered or Local
before this boundary; otherwise record the missing verdict as a pipeline error
and increment the appropriate drop accounting so num_out_pkts is fully accounted
for. Preserve the existing Delivered transmission path and counters.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 18819c41-51ad-4c5e-a8ed-81f1b248838a

📥 Commits

Reviewing files that changed from the base of the PR and between 7835eae and d6998e6.

📒 Files selected for processing (2)
  • dataplane/src/drivers/kernel/worker.rs
  • net/src/packet/mod.rs

Comment thread dataplane/src/drivers/kernel/worker.rs

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR corrects dataplane “pipeline drop” statistics by ensuring packets intended for local kernel consumption are not treated as pipeline drops, and by preventing the kernel driver from attempting to transmit those local-only packets.

Changes:

  • Allow DoneReason::Local packets to pass through Packet::enforce() so they reach the end of the pipeline.
  • Update the kernel worker TX loop to transmit only DoneReason::Delivered packets and to log “sent out of” using only the packets actually eligible for TX.
  • Simplify/remove packet-injection-related scaffolding in the worker’s pipeline drop accounting logic.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
net/src/packet/mod.rs Adjusts Packet::enforce() to keep Local packets (not drop-filter them).
dataplane/src/drivers/kernel/worker.rs Skips TX for Local packets; updates “pipeline drops” computation and TX logging; simplifies tx_packet assumptions.

Comment thread dataplane/src/drivers/kernel/worker.rs
The prior logic computed the pipeline drops by comparing the number
of packets received with the number of packets output by the
pipeline. However, there are received packets that the pipeline
wouldn't normally output (because they need not be transmitted) but
which should not be considered drops: local packets.

So, the old logic was accounting those as pipeline drops, providing
false positives on the number of drops.

Fix this by letting the pipeline stats stage let those packets
through (until the pkt injection lands) and make sure the driver
ignores them on xmit.

Also, remove the scaffolding for packet injection.

Signed-off-by: Fredi Raspall <fredi@githedgehog.com>
@Fredi-raspall
Fredi-raspall force-pushed the pr/fredi/fix-stats-nth branch from d6998e6 to f74e422 Compare August 7, 2026 17:55

@qmonnet qmonnet left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks OK to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working ci:+vlab Enable VLAB tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants