Skip to content
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

Merged
merged 20 commits into from
Sep 29, 2023

Conversation

abdosi
Copy link
Contributor

@abdosi abdosi commented Sep 13, 2023

What I did:

Updated the API get_platform_info() to return running/detected ASIC's count for given system

ADO: 25158825

Why I did:

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 asic.conf file eg:

. However in supervisor max_asic represnt number of asic where all Fabric cards are populated. However most of the time we have less than that inserted. get_asic_presence_list() returns how many Fabric asics are detected on Supervisor and for LC/Multi-asic system it still return max asic count as per asic.conf file

How I Verify:
Verified below commands on Chassis setup (multi-asic) and Pizza box with Single Asic

show version
show platform summary

@gechiang
Copy link
Collaborator

What kind of issue does this fix? Is this in particular to address issues such as some fabric card may not be present, so we need the running count instead of the max possible count?

@abdosi
Copy link
Contributor Author

abdosi commented Sep 14, 2023

What kind of issue does this fix? Is this in particular to address issues such as some fabric card may not be present, so we need the running count instead of the max possible count?

yes that is the case. Also it's posssible some outside service can use the o/p from above commands to detect number of asic's on the system


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()
hw_info_dict['asic_count'] = len(get_asic_presence_list())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we put this change in try/catch to ensure show version when chassis_db is not up?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arlakshm thanks. have updated accordingly.

Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>
Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>
@gechiang
Copy link
Collaborator

@arlakshm , can you re-review with the latest change that Abhishek committed?
Thanks!

@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202205: #16828

mssonicbld pushed a commit to mssonicbld/sonic-buildimage that referenced this pull request Oct 10, 2023
…ected ASIC's count (sonic-net#16539)

previously, get_num_asics() returns the maximum number of asics. however, the asic_count 
should be actual number of asics populated which can be get from get_asic_presence_list().

ADO: 25158825

Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202211: #16829

mssonicbld pushed a commit that referenced this pull request Oct 11, 2023
…ected ASIC's count (#16539)

previously, get_num_asics() returns the maximum number of asics. however, the asic_count 
should be actual number of asics populated which can be get from get_asic_presence_list().

ADO: 25158825

Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>
@mssonicbld
Copy link
Collaborator

@abdosi cherry pick PR didn't pass PR checker. Please check!!!
#16829

2 similar comments
@mssonicbld
Copy link
Collaborator

@abdosi cherry pick PR didn't pass PR checker. Please check!!!
#16829

@mssonicbld
Copy link
Collaborator

@abdosi cherry pick PR didn't pass PR checker. Please check!!!
#16829

mssonicbld pushed a commit to mssonicbld/sonic-buildimage that referenced this pull request Oct 16, 2023
…ected ASIC's count (sonic-net#16539)

previously, get_num_asics() returns the maximum number of asics. however, the asic_count 
should be actual number of asics populated which can be get from get_asic_presence_list().

ADO: 25158825

Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202305: #16890

mssonicbld pushed a commit that referenced this pull request Oct 16, 2023
…ected ASIC's count (#16539)

previously, get_num_asics() returns the maximum number of asics. however, the asic_count 
should be actual number of asics populated which can be get from get_asic_presence_list().

ADO: 25158825

Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>
@mssonicbld
Copy link
Collaborator

@abdosi cherry pick PR didn't pass PR checker. Please check!!!
#16829

3 similar comments
@mssonicbld
Copy link
Collaborator

@abdosi cherry pick PR didn't pass PR checker. Please check!!!
#16829

@mssonicbld
Copy link
Collaborator

@abdosi cherry pick PR didn't pass PR checker. Please check!!!
#16829

@mssonicbld
Copy link
Collaborator

@abdosi cherry pick PR didn't pass PR checker. Please check!!!
#16829

mssonicbld pushed a commit that referenced this pull request Oct 20, 2023
…ected ASIC's count (#16539)

previously, get_num_asics() returns the maximum number of asics. however, the asic_count 
should be actual number of asics populated which can be get from get_asic_presence_list().

ADO: 25158825

Signed-off-by: Abhishek Dosi <abdosi@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

7 participants