topology: add PCIe chain and IRQ info to device hints - #761
Open
kad wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Adds PCIe ancestry and IRQ metadata to device topology hints.
Changes:
- Introduces PCIe hop types and ancestor-chain discovery.
- Collects legacy and MSI IRQs and displays them in hints.
- Adds topology tests and corrects hint logging.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
pkg/topology/topology.go |
Adds PCIe and IRQ hint collection. |
pkg/topology/topology_test.go |
Tests PCIe chains and device IRQs. |
cmd/plugins/topology-aware/policy/resources.go |
Logs formatted topology hints. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 5 changed files in this pull request and generated no new comments.
Suppressed comments (1)
pkg/topology/topology.go:219
- These values are still discarded when a device has no CPU/NUMA/socket affinity:
NewTopologyHintsonly retains a hint under the legacy-field predicate at lines 321-323. Thus PCI devices without those affinity files (and IRQ-only devices) still return an emptyHints, so callers cannot access the new metadata. Treat a non-emptyPCIeChainorIRQsas sufficient to retain the hint, and cover that case in the integration test.
hint.PCIeChain = pcieChain(sysFSPath)
hint.IRQs = deviceIRQs(sysFSPath)
Device topology hints only exposed CPU/NUMA/socket affinity. Add PCIeChain and IRQs fields to Hint so callers can see the PCIe bridge/root hierarchy above a device and which interrupts it uses. - Add a PCIeHopType enum (PCIeHopBridge, PCIeHopRoot) and a PCIeHop struct for each ancestor in the chain. - Walk the device's ancestor directories in sysfs to build the chain: a class 0x0604 device is a bridge, and the top-level pci<domain>:<bus> directory is the root. - Read a device's legacy irq file and its msi_irqs/ entries to collect IRQ numbers. - Extend Hint.String() to print the new IRQs. - Update the test-data.tar.gz fixture with a bridge-to-endpoint PCI chain and legacy/MSI IRQ entries; add TestPcieChain and TestDeviceIRQs. Signed-off-by: Alexander Kanevskiy <alexander.kanevskiy@intel.com>
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.
Device topology hints only exposed CPU/NUMA/socket affinity. Add PCIeChain and IRQs fields to Hint so callers can see the PCIe bridge/root hierarchy above a device and which interrupts it uses.