Skip to content

metric: add hardware rx dropped packet metric#26

Merged
hao022 merged 2 commits intoccfos:mainfrom
liuchangyan:teresa-fork
Sep 5, 2025
Merged

metric: add hardware rx dropped packet metric#26
hao022 merged 2 commits intoccfos:mainfrom
liuchangyan:teresa-fork

Conversation

@liuchangyan
Copy link
Copy Markdown
Contributor

@liuchangyan liuchangyan commented Sep 5, 2025

This patch is designed to retrieve the hardware packet drop count for network interfaces.
Currently, it supports bnxt, mlx, i40e, and ixgbe NICs.

Below are the software and hardware packet drop statistic paths for different NICs:

NIC Driver HW Drop Location SW Drop Location rx_dropped Meaning rx_missed_errors Meaning
mlx status->rx_dropped status->rx_dropped Software + hardware drops Always 0
ixgbe status->rx_missed_errors status->rx_dropped Software drops only Hardware drops only
i40e ns->rx_dropped ns->rx_dropped Software + hardware drops Always 0
bnxt status->rx_missed_errors status->rx_dropped Software drops only Hardware drops only

A general calculation method has been implemented:

  • If rx_missed_errors is non-zero, use it directly as hardware drops;
  • Otherwise, compute:
hardware_drops = rx_dropped - software_drops.

@liuchangyan liuchangyan force-pushed the teresa-fork branch 2 times, most recently from fef00e9 to 4e452d9 Compare September 5, 2025 14:16
@hao022 hao022 merged commit 7e0f64d into ccfos:main Sep 5, 2025
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