-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Updated the API get_platform_info() to return running/detected ASIC's count #16539
Changes from all commits
7a3d7e5
b5b08cf
8d9dbb6
d04bc54
264d912
957cd71
4e8b101
05ec92a
fcbd38d
76019a7
311c639
2109e03
ced57e2
3cf4697
8ee1472
b1b8013
ac0bfcb
84cf43f
a0bee0e
661b971
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -479,15 +479,18 @@ def get_platform_info(config_db=None): | |
if hw_info_dict: | ||
return hw_info_dict | ||
|
||
from .multi_asic import get_num_asics | ||
from .multi_asic import get_asic_presence_list | ||
|
||
version_info = get_sonic_version_info() | ||
|
||
hw_info_dict['platform'] = get_platform() | ||
hw_info_dict['hwsku'] = get_hwsku() | ||
if version_info: | ||
hw_info_dict['asic_type'] = version_info.get('asic_type') | ||
hw_info_dict['asic_count'] = get_num_asics() | ||
try: | ||
hw_info_dict['asic_count'] = len(get_asic_presence_list()) | ||
except: | ||
hw_info_dict['asic_count'] = 'N/A' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this compatiable with single asic? previously for single asic, the get_num_asics() return 1, in this case, it returns There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @lguohan yes this change was breaking single asic as it was returning 0. Have fixed API There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. in the multi-asic case, what is in the asics_list? is that 0,1,2 or something else? @abdosi There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @lguohan : yes it 0,1,2 |
||
|
||
try: | ||
# TODO: enforce caller to provide config_db explicitly and remove its default value | ||
|
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.
can you explain the reason for this change? why get_num_asics does not work, but get_asic_presence_list?
what is the scenario that was broken?
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.
@lguohan
In Chassis for supervisor running asic count can be <= max asic possible.
get_num_asics()
return max asic count that can be present based on static file eg:sonic-buildimage/device/nokia/x86_64-nokia_ixr7250e_sup-r0/asic.conf
Line 1 in fe24c26
get_asic_presence_list()
returns how many asics are detected on Supervisor and for LC/Multi-asic system it still return max asic count