sysfs: add InfiniBand device listing and per-device parsing - #854
Open
rafal-szypulka wants to merge 1 commit into
Open
sysfs: add InfiniBand device listing and per-device parsing#854rafal-szypulka wants to merge 1 commit into
rafal-szypulka wants to merge 1 commit into
Conversation
Signed-off-by: Rafal Szypulka <rafal@datacrunch.io>
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.
Summary
Add APIs that allow callers to enumerate InfiniBand device names without
reading device attributes or counters, and then parse selected devices
individually:
FS.InfiniBandClassDevices()lists device names under/sys/class/infinibandwithout parsing them.FS.InfiniBandDevice(name)parses one selected device.FS.InfiniBandClass()is refactored to compose these APIs while preservingits existing behavior.
Motivation
InfiniBandClass()currently parses every device eagerly. This preventscallers such as node_exporter from applying device filters before sysfs
counter reads occur.
On NVIDIA systems with Fabric Manager-managed or otherwise restricted
Mellanox PFs, merely reading some counters can trigger repeated
ACCESS_REG(0x805)firmware errors. Filtering the returnedInfiniBandClassis too late because the reads have already happened.Separating enumeration from parsing lets callers:
The existing
InfiniBandClass()API and default behavior remain unchanged.Tests
do not contain readable attributes or counters.
InfiniBandDevice(name)returns the same data as thecorresponding
InfiniBandClass()entry.Related to #823 and prometheus/node_exporter#3434.
Existing work
#839 already proposes the additive
InfiniBandDevice(name)API. This changeincludes that capability and additionally provides list-only enumeration so
callers do not need to reproduce procfs sysfs path handling outside this
package.