-
Notifications
You must be signed in to change notification settings - Fork 746
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix asic identification #15297
Fix asic identification #15297
Conversation
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.
Add token matches for identifying the TH4 and TH5 ASICs from the output of lspci.
The pre-commit check detected issues in the files touched by this pull request. Detailed pre-commit check results: To run the pre-commit checks locally, you can follow below steps:
|
Fix pre-commit error introduced within the prior two commits.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* 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.
Cherry-pick PR to 202405: #15522 |
* 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.
* 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.
* 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.
* 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.
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.py
was 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.py
against TH2, TH4, and TH5-based Arista DUTs and confirmed that the tests passed.