Repository navigation
pci: expose more sysfs metadata on Device for tree walks - #463
Merged
Merged
Conversation
Owner
|
Well hello there @dims! :) thanks very much for the contribution, sir! |
Contributor
Author
Hello my dear friend :) |
jaypipes
requested changes
May 13, 2026
Contributor
Author
|
Done @jaypipes ! |
jaypipes
reviewed
May 13, 2026
Adds the per-device information callers need to walk the PCI tree
and inspect each node beyond vendor / product / class identifiers:
* Modalias - raw modalias string from sysfs
* Parent/Children - resolved *Device pointers, built after
enumeration; ParentAddress remains the
serialized form
* VPD() - lazy reader for /sys/.../vpd with a TLV parser
handling the 0x82 / 0x90 / 0x91 / 0x78 large
resource tags and PN / EC / SN / V0-VZ
keywords
* DeviceNamesByLinuxSystem(ctx, dev) - free function returning
a map of linux system kind (drm / infiniband /
net / nvme) to the device names registered
under that kind, with a non-Linux stub
The Linux-specific reader and parser live in vpd_linux.go; pci_stub.go
carries minimal type and method stubs so non-Linux still compiles
against the same Device struct.
Tests cover the VPD parser via in-memory byte fixtures, and exercise
Modalias / Parent pointer / DeviceNamesByLinuxSystem against the
existing linux-amd64-intel-i7-1270P snapshot.
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
Contributor
Author
|
@jaypipes tested in a couple of boxes. please trigger workflows again |
dims
added a commit
to dims/rdma_topo
that referenced
this pull request
May 13, 2026
PR jaypipes/ghw#463 ("pci: expose more sysfs metadata on Device for tree walks") has landed, so the local replace directive pointing at ~/go/src/github.com/jaypipes/ghw-rdma-topo is no longer needed. Pin ghw to the pseudo-version for merge commit ea9e990; switch to a tagged release once one is cut that contains the merge. Signed-off-by: Davanum Srinivas <davanum@gmail.com>
Contributor
Author
|
thanks @jaypipes ! FYI, was prototyping something https://github.com/dims/rdma_topo context: kubernetes-sigs/dra-driver-nvidia-gpu#1123 (comment) |
Owner
I think that might be a private repo? :) |
Contributor
Author
public now! |
Contributor
Author
|
@jaypipes if you see something that can belong to this repo from there, please let me know and i'll open another PR |
dims
added a commit
to dims/ghw
that referenced
this pull request
May 14, 2026
PR jaypipes#463 exposed Parent and Children pointers on pci.Device so callers can walk the tree. Anything non-trivial consuming those fields ends up reinventing the same three traversals. Signed-off-by: Davanum Srinivas <davanum@gmail.com>
dims
added a commit
to dims/rdma_topo
that referenced
this pull request
May 14, 2026
PR jaypipes/ghw#463 ("pci: expose more sysfs metadata on Device for tree walks") has landed, so the local replace directive pointing at ~/go/src/github.com/jaypipes/ghw-rdma-topo is no longer needed. Pin ghw to the pseudo-version for merge commit ea9e990; switch to a tagged release once one is cut that contains the merge. Signed-off-by: Davanum Srinivas <davanum@gmail.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.
Adds the per-device information callers need to walk the PCI tree and inspect each node beyond vendor / product / class identifiers:
enumeration; ParentAddress remains the
serialized form
handling the 0x82 / 0x90 / 0x91 / 0x78 large
resource tags and PN / EC / SN / V0-VZ
keywords
registered device names for
drm / infiniband / net / nvme
Tests cover the VPD parser via in-memory byte fixtures, and exercise Modalias / Parent pointer / NVMe Subsystems against the existing linux-amd64-intel-i7-1270P snapshot.