Skip to content

Conversation

ovsrobot
Copy link
Owner

@ovsrobot ovsrobot commented Oct 14, 2025

NOTE: This is an auto submission for "net/ice: revert count drop-all filter in Rx stats".

See "http://patchwork.dpdk.org/project/dpdk/list/?series=36343" for details.

Summary by Sourcery

Revert the drop-all filter from Rx statistics and correct the source of received byte counts.

Bug Fixes:

  • Remove the subtraction of unknown-protocol packets from receive packet statistics to restore drop-all counts.
  • Switch the input byte counter to use the main VSI’s hardware rx_bytes instead of the previous ns->eth.rx_bytes source.

Summary by CodeRabbit

  • Bug Fixes
    • Corrected received packet counts to exclude unknown-protocol packets and align with unicast/multicast/broadcast minus discards.
    • Updated received byte counts to use primary interface byte counters for consistent per-port statistics.
    • Improves accuracy and consistency of per-port statistics on supported Intel Ethernet devices.

This reverts commit af05f9e

This patch caused testpmd to count packets not destined for our MAC
even when promiscuous mode is off.This behaviour is inconsistent with
other drivers and leads to incorrect Rx statistics.

Fixes: af05f9e ("net/ice: count drop-all filter in Rx stats")
Cc: stable@dpdk.org

Signed-off-by: Shaiq Wani <shaiq.wani@intel.com>
Signed-off-by: 0-day Robot <robot@bytheb.org>
Copy link

sourcery-ai bot commented Oct 14, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR reverts the inclusion of drop-all filter counts in Rx packet stats and aligns the ibytes metric to use the main_vsi eth_stats counter.

Class diagram for updated ice_stats_get function

classDiagram
    class ice_stats_get {
        +stats.ipackets
        +stats.opackets
        +stats.ibytes
        +stats.obytes
        +stats.oerrors
    }
    class pf {
        +main_vsi
    }
    class main_vsi {
        +eth_stats.rx_unicast
        +eth_stats.rx_multicast
        +eth_stats.rx_broadcast
        +eth_stats.rx_discards
        +eth_stats.rx_bytes
        +eth_stats.tx_errors
    }
    class ns {
        +eth.rx_unknown_protocol
        +eth.tx_unicast
        +eth.tx_multicast
        +eth.tx_broadcast
        +eth.tx_bytes
        +eth.tx_errors
    }
    ice_stats_get --> pf
    pf --> main_vsi
    ice_stats_get --> ns
    ice_stats_get : - uses ns.eth.rx_unknown_protocol in ipackets
    ice_stats_get : + uses pf.main_vsi.eth_stats.rx_bytes in ibytes
Loading

File-Level Changes

Change Details Files
Revert counting of drop-all filter in Rx stats
  • Removed ns->eth.rx_unknown_protocol from ipackets calculation
  • Adjusted ipackets summation to exclude drop-all filter counts
drivers/net/intel/ice/ice_ethdev.c
Align ibytes metric to main_vsi eth_stats
  • Switched ibytes source from ns->eth.rx_bytes to pf->main_vsi->eth_stats.rx_bytes
drivers/net/intel/ice/ice_ethdev.c

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

coderabbitai bot commented Oct 14, 2025

Walkthrough

The change updates ice_stats_get in drivers/net/intel/ice/ice_ethdev.c to compute ipackets without rx_unknown_protocol and to source ibytes from the main VSI’s rx_bytes. ipackets now sum unicast, multicast, and broadcast and subtract rx_discards; ibytes uses pf->main_vsi->eth_stats.rx_bytes.

Changes

Cohort / File(s) Summary
Intel ICE stats computation
drivers/net/intel/ice/ice_ethdev.c
Adjust ipackets to exclude rx_unknown_protocol; compute ipackets as rx_unicast + rx_multicast + rx_broadcast − rx_discards; source ibytes from pf->main_vsi->eth_stats.rx_bytes instead of ns->eth.rx_bytes.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant App as Application
    participant PMD as ICE PMD
    participant Fn as ice_stats_get
    participant MainVSI as PF.main_vsi.eth_stats
    participant NS as ns->eth (previous source)

    App->>PMD: rte_eth_stats_get(port)
    PMD->>Fn: ice_stats_get(port)

    rect rgba(230,245,255,0.5)
    note right of Fn: New byte source
    Fn->>MainVSI: read rx_bytes
    MainVSI-->>Fn: rx_bytes (ibytes)
    end

    rect rgba(240,255,230,0.5)
    note right of Fn: New packet aggregation
    Fn->>MainVSI: read rx_unicast/multicast/broadcast, rx_discards
    MainVSI-->>Fn: values
    Fn->>Fn: ipackets = uni + multi + bcast - discards<br/>exclude rx_unknown_protocol
    end

    Fn-->>PMD: stats (ipackets, ibytes, ...)
    PMD-->>App: return rte_eth_stats
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I count the packets, ears held high,
No “unknowns” nibble as they fly.
Bytes from the main burrow, clear and bright,
Unicast, multicast—balanced right.
I twitch, I tally, with gentle might—
A stats-savvy rabbit, hopping by night. 🐇📊

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title succinctly captures the primary change by indicating that the Rx stats filter revert is being applied in the net/ice driver, and it avoids unnecessary detail or generic phrasing, making it clear to reviewers what the patch addresses.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch series_36343

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2b403dd and e14e957.

📒 Files selected for processing (1)
  • drivers/net/intel/ice/ice_ethdev.c (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Sourcery review
🔇 Additional comments (1)
drivers/net/intel/ice/ice_ethdev.c (1)

6354-6361: LGTM! Consistent data source for Rx statistics.

The change aligns ibytes with ipackets by sourcing both from VSI-level statistics (pf->main_vsi->eth_stats). This ensures that both byte and packet counts exclude drop-all filtered traffic, maintaining consistency in the reported Rx statistics.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants