Skip to content

Commit

Permalink
Modular Chassis - APIs for midplane monitoring (sonic-net#148)
Browse files Browse the repository at this point in the history
- Enhance ModuleBase with new APIs to get midplane-ip-address and check-reachability
- Enhance ChassisBase with new API to initialize the midplane for modular chassis
  • Loading branch information
mprabhu-nokia committed Dec 2, 2020
1 parent 6f7d8a0 commit 7c0301d
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
14 changes: 14 additions & 0 deletions sonic_platform_base/chassis_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,20 @@ def is_modular_chassis(self):
"""
return False

def init_midplane_switch(self):
"""
Initializes the midplane functionality of the modular chassis. For
example, any validation of midplane, populating any lookup tables etc
can be done here. The expectation is that the required kernel modules,
ip-address assignment etc are done before the pmon, database dockers
are up.
Returns:
A bool value, should return True if the midplane initialized
successfully.
"""
return NotImplementedError

##############################################
# Component methods
##############################################
Expand Down
26 changes: 26 additions & 0 deletions sonic_platform_base/module_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,3 +442,29 @@ def get_change_event(self, timeout=0):
"""
raise NotImplementedError

##############################################
# Midplane methods for modular chassis
##############################################
def get_midplane_ip(self):
"""
Retrieves the midplane IP-address of the module in a modular chassis
When called from the Supervisor, the module could represent the
line-card and return the midplane IP-address of the line-card.
When called from the line-card, the module will represent the
Supervisor and return its midplane IP-address.
Returns:
A string, the IP-address of the module reachable over the midplane
"""
return NotImplementedError

def is_midplane_reachable(self):
"""
Retrieves the reachability status of the module from the Supervisor or
of the Supervisor from the module via the midplane of the modular chassis
Returns:
A bool value, should return True if module is reachable via midplane
"""
return NotImplementedError

0 comments on commit 7c0301d

Please sign in to comment.