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

Add a template function that returns list of asics on module #185

Merged
merged 3 commits into from
Jun 21, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
36 changes: 35 additions & 1 deletion sonic_platform_base/module_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ def __init__(self):
# available on the module
self._sfp_list = []

# List of ASIC-derived objects representing all ASICs
# visibile in PCI domain on the module
self._asic_list = []

def get_base_mac(self):
"""
Retrieves the base MAC address for the module
Expand Down Expand Up @@ -461,4 +465,34 @@ def is_midplane_reachable(self):
Returns:
A bool value, should return True if module is reachable via midplane
"""
raise NotImplementedError
return NotImplementedError

##############################################
# ASIC methods
##############################################
def get_all_asics(self):
"""
Retrieves the list of all ASICs on the module that are visible in PCI domain.
When called from the Supervisor of modular system, the module could be
fabric card, and the function returns all fabric ASICs on this module that
appear in PCI domain of the Supervisor.

Returns:
A list of ASICs. Index of an ASIC in the list is the index of the ASIC
on the module. Index is 0 based.

An item in the list is a tuple that includes:
- ASIC instance number (indexed globally across all modules of
the chassis). This number is used to find settings for the ASIC
from /usr/share/sonic/device/platform/hwsku/asic_instance_number/.
- ASIC PCI address: It is used by syncd to attach the correct ASIC.

For example: [('4', '0000:05:00.0'), ('5', '0000:07:00.0')]
In this example, from the output, we know the module has 2 ASICs.
Item ('4', '0000:05:00.0') describes information about the first ASIC
in the module.
'4' means it is asic4 in the chassis. Settings for this ASIC is at
/usr/share/sonic/device/platform/hwsku/4/.
And '0000:05:00.0' is its PCI address.
"""
return self._asic_list