Repository navigation
Conversation
There was a problem hiding this comment.
Pull request overview
This PR stabilizes Windows network interface indexing by sorting the returned adapter list by PCI address, aligning Windows behavior with Linux (where lspci ordering is deterministic) so interface_index in topology/config maps consistently to the same physical port.
Changes:
- Sort Windows
_get_all_interfaces_info()results bypci_address(withNoneplaced last). - Add a unit test asserting deterministic ordering based on PCI address.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
mfd_network_adapter/network_adapter_owner/windows.py |
Sorts returned Windows NIC list by PCI address for deterministic interface indexing. |
tests/unit/test_mfd_network_adapter/test_network_adapter_owner/test_windows_network_owner.py |
Adds a unit test to validate sorting behavior of _get_all_interfaces_info(). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Kevin J Hudson <kevin.j.hudson@intel.com>
khudson2
force-pushed
the
win-net-iface-index
branch
from
July 29, 2026 00:36
2b0eedf to
a68518c
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In the mfd-config README, this is listed as a valid configuration:
network_interfaces: # optional
pci_device: 8086:1572:0000:001a # long PCIDevice: vid:did:subvid:subdid
interface_index: 2 # list index
However, which interface this returns varies from run to run.
In Linux, the adapter list comes from lspci, which is sorted by PCI ID, and therefore by port index.
In windows, the adapter list comes from Win32_NetworkAdapter which is in no particular order. That means the adapter index is basically random for windows. In order to make it behave like other operating systems, it should be sorted by PCI address before being returned.
I ran my failing test 10 times and got the same test adapter on SUT and client consistently with this fix.