Skip to content

Commit

Permalink
Addressing review comments: 1. removed module type "SWITCH"
Browse files Browse the repository at this point in the history
  • Loading branch information
rameshraghupathy committed Jun 12, 2024
1 parent 33ca01a commit d38f264
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
8 changes: 4 additions & 4 deletions sonic_platform_base/chassis_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,15 +242,15 @@ def get_all_modules(self):
def get_module(self, index):
"""
Retrieves module represented by (0-based) index <index>
On a SmartSwitch index:0 will fetch switch, index:1 will fetch
On a SmartSwitch index:0 is not used, index:1 will fetch
DPU0 and so on
Args:
index: An integer, the index (0-based) of the module to
retrieve
Returns:
An object dervied from ModuleBase representing the specified
An object derived from ModuleBase representing the specified
module
"""
module = None
Expand All @@ -270,7 +270,7 @@ def get_module_index(self, module_name):
Args:
module_name: A string, prefixed by SUPERVISOR, LINE-CARD or FABRIC-CARD
Ex. SUPERVISOR0, LINE-CARD1, FABRIC-CARD5
SmartSwitch Example: SWITCH, DPU1, DPU2 ... DPUX
SmartSwitch Example: DPU0, DPU1, DPU2 ... DPUX
Returns:
An integer, the index of the ModuleBase object in the module_list
Expand Down Expand Up @@ -313,7 +313,7 @@ def get_module_dpu_data_port(self, index):
Returns:
A string giving the NPU-DPU port association:
Ex: For index: 1 will return the dup0 port association which is
"Ethernet-BP0: Ethernet0" where the string left of ":" (Ethernet-BP0)
"Ethernet192: Ethernet0" where the string left of ":" (Ethernet192)
is the NPU port and the string right of ":" (Ethernet0) is the DPU port
"""
raise NotImplementedError
Expand Down
16 changes: 7 additions & 9 deletions sonic_platform_base/module_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ class ModuleBase(device_base.DeviceBase):
MODULE_TYPE_LINE = "LINE-CARD"
MODULE_TYPE_FABRIC = "FABRIC-CARD"
MODULE_TYPE_DPU = "DPU"
MODULE_TYPE_SWITCH = "SWITCH"

# Possible card status for modular chassis
# Module state is Empty if no module is inserted in the slot
Expand Down Expand Up @@ -120,18 +119,17 @@ def get_system_eeprom_info(self):
def get_name(self):
"""
Retrieves the name of the module prefixed by SUPERVISOR, LINE-CARD,
FABRIC-CARD, SWITCH, DPU0, DPUX
FABRIC-CARD, DPU0, DPUX
Returns:
A string, the module name prefixed by one of MODULE_TYPE_SUPERVISOR,
MODULE_TYPE_LINE or MODULE_TYPE_FABRIC or MODULE_TYPE_DPU or
MODULE_TYPE_SWITCH and followed by a 0-based index.
MODULE_TYPE_LINE or MODULE_TYPE_FABRIC or MODULE_TYPE_DPU and followed
by a 0-based index.
Ex. A Chassis having 1 supervisor, 4 line-cards and 6 fabric-cards
can provide names SUPERVISOR0, LINE-CARD0 to LINE-CARD3,
FABRIC-CARD0 to FABRIC-CARD5.
A SmartSwitch having 4 DPUs and 1 Switch can provide names DPU0 to
DPU3 and SWITCH
A SmartSwitch having 4 DPUs names DPU0 to DPU3
"""
raise NotImplementedError

Expand Down Expand Up @@ -160,7 +158,7 @@ def get_type(self):
Returns:
A string, the module-type from one of the predefined types:
MODULE_TYPE_SUPERVISOR, MODULE_TYPE_LINE or MODULE_TYPE_FABRIC
or MODULE_TYPE_DPU or MODULE_TYPE_SWITCH
or MODULE_TYPE_DPU
"""
raise NotImplementedError

Expand All @@ -175,7 +173,8 @@ def get_oper_status(self):
The SmartSwitch platforms will have these additional status
MODULE_STATUS_MIDPLANE_OFFLINE, MODULE_STATUS_MIDPLANE_ONLINE,
MODULE_STATUS_CONTROLPLANE_OFFLINE, MODULE_STATUS_CONTROLPLANE_ONLINE,
MODULE_STATUS_DATAPLANE_OFFLINE, MODULE_STATUS_DATAPLANE_ONLINE
MODULE_STATUS_CONTROLPLANE_PARTIAL_ONLINE, MODULE_STATUS_DATAPLANE_OFFLINE,
MODULE_STATUS_DATAPLANE_ONLINE, MODULE_STATUS_DATAPLANE_PARTIAL_ONLINE
"""
raise NotImplementedError

Expand Down Expand Up @@ -230,7 +229,6 @@ def get_dpu_id(self):
Returns:
An integer, indicating the DPU ID. DPU0 returns 1, DPUX returns X+1
Returns '0' on switch module
"""
raise NotImplementedError

Expand Down

0 comments on commit d38f264

Please sign in to comment.