sysfs: add InfiniBandDevice API#839
Open
happysnaker wants to merge 1 commit into
Open
Conversation
Signed-off-by: Shirong Lu <73147033+happysnaker@users.noreply.github.com>
30463d4 to
222aac8
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.
Summary
FS.InfiniBandDevice(name)as a public per-device parserInfiniBandClass()unchangedInfiniBandClass()entryWhy
Issue #823 describes environments where callers need to filter InfiniBand devices before reading per-port counters. Today
InfiniBandClass()eagerly parses every device, so callers have no way to skip known-problematic devices before counter reads happen.This patch takes the additive route proposed in the issue: expose the existing per-device parser as a small public API. Existing callers keep using
InfiniBandClass()unchanged, while new callers can now:/sys/class/infinibandthemselvesfs.InfiniBandDevice(name)only for devices they actually want parsedThat keeps the change narrow and avoids adding filter semantics to
InfiniBandClass()itself.Fixes #823