Skip to content

Fix: fallback to lspci for NIC model name when not found in udevadm#670

Merged
harp-intel merged 4 commits intomainfrom
fix-nic-model
Mar 25, 2026
Merged

Fix: fallback to lspci for NIC model name when not found in udevadm#670
harp-intel merged 4 commits intomainfrom
fix-nic-model

Conversation

@harp-intel
Copy link
Contributor

This pull request improves the accuracy and reliability of NIC (Network Interface Card) detection and summarization in the system by enhancing how NIC model information is extracted and reported. The changes focus on providing better fallback mechanisms when model information is missing, filtering out non-physical NICs from summaries, and updating dependencies to ensure all necessary tools are available.

NIC Model Extraction and Summarization Improvements:

  • Enhanced the NIC information extraction script to fall back to lspci for model information if it's not available from udevadm, and to trim vendor prefixes from model names for cleaner output.
  • Updated the NIC summary logic in nic.go to exclude virtual functions and bridge devices, ensuring only physical NICs are reported. Also, improved handling of missing model names by constructing a default from the vendor name.

Dependency Updates:

  • Added lspci and pci.ids.gz as dependencies for the NIC information script to support the new fallback logic.

Copy link
Contributor

Copilot AI left a comment

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 improves NIC identification and reporting in PerfSpect by making NIC model detection more reliable (with a lspci fallback) and refining NIC summarization to better represent physical hardware.

Changes:

  • Update NIC info collection script to fall back to lspci when udev-based model lookup is missing, and add required dependencies (lspci, pci.ids.gz).
  • Adjust NIC summary generation to filter out non-physical NICs and provide a vendor-based default model when missing.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
internal/script/scripts.go Adds lspci fallback logic for NIC model name extraction and extends script dependencies.
internal/extract/nic.go Updates NIC summary logic to exclude certain interfaces and to handle missing model names more explicitly.

@harp-intel harp-intel merged commit 12abe5a into main Mar 25, 2026
5 checks passed
@harp-intel harp-intel deleted the fix-nic-model branch March 25, 2026 00:23
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