Repository navigation
DRA: publish PCIe roots on topology-aware devices - #831
Merged
Merged
Conversation
bart0sh
added this pull request to stack #807
October 12, 2026 12:54
bart0sh
force-pushed
the
stacked/bart0sh/DRA/009-pcie-roots
branch
from
October 12, 2026 13:20
a26dc21 to
9824ab5
Compare
There was a problem hiding this comment.
🟢 Approval recommended
Discovery, compatibility probing, publication, and slice sizing are consistently implemented and well tested.
0 open findings
What changed in this PR
Adds PCIe-root topology attributes to topology-aware DRA devices while remaining compatible with clusters lacking list-attribute support.
Changes:
- Discovers and maps PCIe roots to CPU packages.
- Probes API-server support for list attributes and publishes roots conditionally.
- Adds unit, recorded-sysfs, and end-to-end coverage.
| File | Description |
|---|---|
pkg/sysfs/system.go |
Discovers package-local PCIe roots. |
pkg/sysfs/pcie_test.go |
Tests PCIe-root discovery edge cases. |
pkg/sysfs/system_test.go |
Verifies recorded root topology. |
pkg/sysfs/test-setup.sh |
Extracts the new sample. |
pkg/sysfs/test-data-sample3.tar.xz |
Provides recorded SNC topology. |
pkg/resmgr/dra/plugin.go |
Probes list support and limits slice size. |
pkg/resmgr/dra/plugin_test.go |
Tests probing and slice splitting. |
pkg/resmgr/dra.go |
Exposes probe results to policies. |
pkg/resmgr/policy/policy.go |
Extends the policy-owner contract. |
cmd/plugins/topology-aware/policy/dra.go |
Publishes PCIe-root attributes. |
cmd/plugins/topology-aware/policy/dra_test.go |
Tests conditional root publication. |
cmd/plugins/topology-aware/policy/mocks_test.go |
Updates package mocks. |
cmd/plugins/topology-aware/policy/coldstart_test.go |
Updates the test owner interface. |
test/e2e/policies.test-suite/topology-aware/n4c16/test43-dra-pcie-roots/code.var.sh |
Verifies cluster-level publication behavior. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
askervin
force-pushed
the
stacked/bart0sh/DRA/009-pcie-roots
branch
from
October 12, 2026 14:53
9824ab5 to
dd98db0
Compare
bart0sh
force-pushed
the
stacked/bart0sh/DRA/009-pcie-roots
branch
from
October 13, 2026 08:51
dd98db0 to
63c26de
Compare
bart0sh
force-pushed
the
stacked/bart0sh/DRA/009-pcie-roots
branch
from
October 13, 2026 12:54
63c26de to
ea97aab
Compare
bart0sh
marked this pull request as ready for review
October 15, 2026 10:46
bart0sh
force-pushed
the
stacked/bart0sh/DRA/009-pcie-roots
branch
from
October 15, 2026 11:34
ea97aab to
ca3923d
Compare
klihub
force-pushed
the
stacked/bart0sh/DRA/009-pcie-roots
branch
from
October 15, 2026 11:41
ca3923d to
3a39d5f
Compare
bart0sh
force-pushed
the
stacked/bart0sh/DRA/009-pcie-roots
branch
2 times, most recently
from
October 15, 2026 12:14
e1c6b26 to
ca3923d
Compare
bart0sh
force-pushed
the
stacked/bart0sh/DRA/009-pcie-roots
branch
from
October 15, 2026 12:55
ca3923d to
45867e9
Compare
This was referenced Oct 16, 2026
Base automatically changed from
stacked/bart0sh/DRA/008-resmgr-refresh-node-resources
to
main
October 16, 2026 09:05
The kernel reports the CPUs local to a PCIe root from the root's NUMA node. With sub-NUMA clustering that is one zone of the socket, but the root is equally close to all zones of the socket. Give each root to every package its local CPUs are in. Add a recorded sample of a two-socket machine with sub-NUMA clustering. Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
List attributes need the DRAListTypeAttributes feature gate, and the API server rejects a slice using them without it. Probe with a dry run when the plugin is created and let policies ask for the result. Slices with list attributes hold at most 64 devices, so always split the devices into slices of that size. Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
klihub
force-pushed
the
stacked/bart0sh/DRA/009-pcie-roots
branch
from
October 16, 2026 09:05
45867e9 to
f74d9fe
Compare
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.
Publishing PCIe roots on topology-aware DRA devices
Ninth PR of the DRA series, on top of #829. Four commits.
Each topology-aware DRA device now has the standard
resource.kubernetes.io/pcieRootattribute: the PCIe roots of the device's CPU socket. With it, a claim can usematchAttributeto get CPUs and a device of another driver, such as a NIC, under the same PCIe root.Which roots a device lists
The kernel reports the CPUs local to a PCIe root in
/sys/devices/pciDDDD:BB/pci_bus/DDDD:BB/cpulistaffinity. It computes them from the NUMA node of the root. With sub-NUMA clustering, this is one zone of the socket, but the root is equally close to all zones of the socket. So sysfs discovery gives a root to every package that its local CPUs are in. Every NUMA device of a package lists all the roots of that package.For example, on a two-socket machine with SNC2, so four NUMA nodes, root
pci0000:5dreports only the CPUs of node 2. Nodes 0 and 2 both listpci0000:00,pci0000:17,pci0000:3aandpci0000:5d.CPUPackage.PCIeRoots()returns the roots of a package, sorted. A root whosecpulistaffinitycannot be read is skipped.Clusters without list attributes
pcieRootis a list attribute. List attributes need theDRAListTypeAttributesfeature gate (KEP-5491), which is alpha and off by default. Without the gate, the API server rejects the whole ResourceSlice, so no devices would be published at all.A driver cannot read the gate, so the DRA plugin asks the API server. When the plugin is created, it does a server-side dry run of a slice with a list attribute. Any failure counts as no support. Policies get the result from
Owner.DRAListAttributesSupported(), and topology-aware leavespcieRootout without support. The driver itself still does not look at device attributes.A slice with list attributes holds at most 64 devices, not 128. The plugin now always splits the devices into slices of 64.
What is not here
DeviceClassships yet, as in the earlier PRs of the series.Verification
go test -racepasses for sysfs, resmgr, the DRA plugin and the template, balloons and topology-aware policies, and golangci-lint finds no issues.TestRecordedPCIeRootschecks the roots of each package in the recorded sample.TestDiscoverPCIeRootsalso covers a root reporting CPUs of both sockets, a root in no package, and roots that cannot be read.TestProbeListAttributescovers an accepted, a rejected and a failed probe, and checks that the probe is a dry run.TestDRAPCIeRootschecks that no roots are published without support, and that the roots of package 0 appear on its two NUMA nodes once there is support.test43-dra-pcie-rootsandtest42-dra-devicespass on n4c16 with Kubernetes 1.37 and containerd v2.4.1, with and withoutDRAListTypeAttributes. With the gate, every device lists the only root of the VM,pci0000:00. Without it, the devices are published withoutpcieRoot.