[action] [PR:15297] Fix asic identification#15522
Merged
mssonicbld merged 1 commit intosonic-net:202405from Nov 15, 2024
Merged
[action] [PR:15297] Fix asic identification#15522mssonicbld merged 1 commit intosonic-net:202405from
mssonicbld merged 1 commit intosonic-net:202405from
Conversation
Collaborator
Author
|
Original PR: #15297 |
* sonic-mgmt: improve asic identification Device ASIC identification is achieved by whole line matches from the output of lspci, which is excessive and subject to fail due to unforeseeable changes in such output. This change reduces the string matching to specific unique differentiators in the output from lspci, while also future-proofing against similar changes in the lspci that could foreseeably occur. * sonic-mgmt: add th4/th5 asic identification Add token matches for identifying the TH4 and TH5 ASICs from the output of lspci. * sonic-mgmt: fix pre-commit issue Fix pre-commit error introduced within the prior two commits.
db777b5 to
ddd954f
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.
Description of PR
ASIC identification is (mostly) done by matching entire lines from the output of the lspci command. This is prone to failure over time, if the output lines change for whatever reason. A more robust approach is to match only those tokens which can
be considered reliable in identifying and distinguishing the ASICs, as opposed to matching whole lines of output. This change implements the token-based approach.
Additionally, this PR introduces the token matching for the TH4 and TH5 asics.
Summary:
Fixes # (issue)
Type of change
Back port request
Approach
What is the motivation for this PR?
test_everflow_per_interface.pywas failing due to misidentified asic (i.e. asic was "unknown"), causing the test to execute a different code path than intended.How did you do it?
Updated the matching logic to compare on the pertinent information returned from the lspci command, rather than entire portions of the returned lines.
How did you verify/test it?
Ran the
test_everflow_per_interface.pyagainst TH2, TH4, and TH5-based Arista DUTs and confirmed that the tests passed.