From 7c0301d4a776b9d279a3f4c309ef6f42eaf58e49 Mon Sep 17 00:00:00 2001 From: mprabhu-nokia <66807480+mprabhu-nokia@users.noreply.github.com> Date: Wed, 2 Dec 2020 14:44:41 -0500 Subject: [PATCH] Modular Chassis - APIs for midplane monitoring (#148) - 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 --- sonic_platform_base/chassis_base.py | 14 ++++++++++++++ sonic_platform_base/module_base.py | 26 ++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/sonic_platform_base/chassis_base.py b/sonic_platform_base/chassis_base.py index 864d6541bb75..d5097c76fdbe 100644 --- a/sonic_platform_base/chassis_base.py +++ b/sonic_platform_base/chassis_base.py @@ -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 ############################################## diff --git a/sonic_platform_base/module_base.py b/sonic_platform_base/module_base.py index 88011dc07cda..45c0068cb291 100644 --- a/sonic_platform_base/module_base.py +++ b/sonic_platform_base/module_base.py @@ -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