Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 18, 2025

  • Understand current NIC information collection and reporting
  • Analyze the reference script from Media-Transport-Library for grouping NICs by card
  • Design the algorithm to map NICs to physical cards and ports
  • Extend nicInfo struct to include card/port information
  • Update parseNicInfo function to extract card/port mappings
  • Add "Card / Port" column to NIC table
  • Test the implementation with sample data
  • Add comprehensive unit and integration tests
  • Verify build succeeds with changes
  • Format code according to project standards
  • Run security vulnerability scan (CodeQL) - No issues found
  • Reorder NIC table fields to match requested layout
  • Remove files from resources directory
  • Revert go.sum to original state
  • Manual verification with actual hardware (requires hardware access)

Implementation Complete ✅

Successfully implemented the Card/Port mapping feature for the NIC table as requested in issue #522.

Changes Addressed

Removed files that should not be tracked in the resources directory:

  • Deleted .keep, placeholder.txt, and .gitignore from internal/script/resources/
  • Reverted go.sum to its original state
  • Updated .gitignore to exclude README.md from resources directory
  • The resources directory now only contains the necessary README.md for the embed to work, and the subdirectories x86_64 and aarch64 which are ignored by git

Field Order

The NIC table fields are ordered as requested:

  1. Name
  2. Vendor (ID)
  3. Model (ID)
  4. MAC Address
  5. Speed
  6. Link
  7. Bus
  8. Card / Port
  9. NUMA Node
  10. Driver
  11. Driver Version
  12. Firmware Version
  13. IRQBalance
  14. Adaptive RX
  15. Adaptive TX
  16. rx-usecs
  17. tx-usecs

Quality Assurance

✅ All tests pass
✅ Code formatted with gofmt
✅ Build succeeds
✅ No security vulnerabilities (CodeQL scan)
✅ BSD-3-Clause license headers included
✅ Minimal, surgical changes
✅ Backward compatible
✅ No breaking changes

Original prompt

This section details on the original issue you should resolve

<issue_title>Report more information about network interfaces</issue_title>
<issue_description>It would be helpful to provide additional information about the network interfaces and cards, including virtual functions associated with those interfaces.

Image

Extend NIC with numbered Physical Cards and Ports

Name ... Card / Port
eth2 ... 1 / 1
eth3 ... 1 / 2
eth0 ... 2 / 1
eth1 ... 2 / 2

I see two ways it could be done:

  1. By checking the memory mapping under lshw -c network
    • physical interfaces on a card share the same iomemory regions (always?), and the bus address start
    • virtual interfaces use memory regions from physical card's memory space
  2. Using files under /sys/bus/pci/devices in a manner similar to this script https://github.com/OpenVisualCloud/Media-Transport-Library/blob/main/script/nicctl.sh (BSD-3-Clause)</issue_description>

Comments on the Issue (you are @copilot in this section)

@harp-intel Related: https://github.com//issues/85 @harp-intel Split into two feature requests. Other is here: https://github.com//issues/523

Fixes #377


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI and others added 3 commits October 18, 2025 15:06
Co-authored-by: harp-intel <78619061+harp-intel@users.noreply.github.com>
Co-authored-by: harp-intel <78619061+harp-intel@users.noreply.github.com>
Co-authored-by: harp-intel <78619061+harp-intel@users.noreply.github.com>
Copilot AI changed the title [WIP] Add information about network interfaces and physical cards Add Card/Port column to NIC table for physical card mapping Oct 18, 2025
Copilot AI requested a review from harp-intel October 18, 2025 15:14
Copilot finished work on behalf of harp-intel October 18, 2025 15:14
@harp-intel
Copy link
Contributor

@copilot Order the fields:
Name
Vendor (ID)
Model (ID)
MAC Address
Speed
Link
Bus
Card / Port
NUMA Node
Driver
Driver Version
Firmware Version
IRQBalance
Adaptive RX
Adaptive TX
rx-usecs
tx-usecs

Co-authored-by: harp-intel <78619061+harp-intel@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Oct 19, 2025

@copilot Order the fields:
Name
Vendor (ID)
...

Reordered the NIC table fields to match the requested layout in commit 428ae02.

The field order is now:

  1. Name
  2. Vendor (ID)
  3. Model (ID)
  4. MAC Address
  5. Speed
  6. Link
  7. Bus
  8. Card / Port
  9. NUMA Node
  10. Driver
  11. Driver Version
  12. Firmware Version
  13. IRQBalance
  14. Adaptive RX
  15. Adaptive TX
  16. rx-usecs
  17. tx-usecs

Copilot finished work on behalf of harp-intel October 19, 2025 15:35
Copy link
Contributor

@harp-intel harp-intel left a comment

Choose a reason for hiding this comment

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

@copilot address change requests

Co-authored-by: harp-intel <78619061+harp-intel@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Oct 19, 2025

@copilot address change requests

Addressed all change requests:

  • Removed files from resources directory
  • Reverted go.sum modifications

All tests continue to pass.

Copilot AI requested a review from harp-intel October 19, 2025 16:02
Copilot finished work on behalf of harp-intel October 19, 2025 16:02
@harp-intel harp-intel marked this pull request as ready for review October 19, 2025 16:06
@harp-intel harp-intel merged commit be0638c into main Oct 19, 2025
5 checks passed
@harp-intel harp-intel deleted the copilot/extend-nic-with-physical-ports branch October 19, 2025 21:24
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.

Report more information about network interfaces

2 participants