Skip to content

Commit 439aa5e

Browse files
authored
[Mellanox] Add a query in MDF to make copper-active modules be FW control (#22665)
- Why I did it Nvidia doesn't support Copper Active modules to be SW control. In case we use this kind of module, it should be classified as FW control. - How I did it Checked the media interface technology for the module. If it is Copper cable, linear active equalizers, it should be classified as FW control. - How to verify it Run this code on Mellanox switch with Copper cable, linear active equalizers module. check control sysfs to make sure it is classified as FW control. (control = 0).
1 parent c19ece7 commit 439aa5e

File tree

1 file changed

+17
-3
lines changed
  • platform/mellanox/mlnx-platform-api/sonic_platform

1 file changed

+17
-3
lines changed

platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@
186186
SFP_FW_CONTROL = 0
187187

188188
CMIS_MAX_POWER_OFFSET = 201
189+
CMIS_MEDIA_INTERFACE_TECH_OFFSET = 212
189190

190191
SFF_POWER_CLASS_MASK = 0xE3
191192
SFF_POWER_CLASS_MAPPING = {
@@ -1105,6 +1106,16 @@ def is_sff_api(self, xcvr_api):
11051106
"""
11061107
return isinstance(xcvr_api, sff8636.Sff8636Api) or isinstance(xcvr_api, sff8436.Sff8436Api)
11071108

1109+
def check_media_interface_technology(self, xcvr_api):
1110+
"""Check media interface technology
1111+
0x0F in offset 212, means the module is 'Copper cable, linear active equalizers'.
1112+
Nvidia doesn't support it to be SW control, so we set it to FW control
1113+
Args:
1114+
xcvr_api (object): xcvr api object
1115+
"""
1116+
media_interface = self.read_eeprom(CMIS_MEDIA_INTERFACE_TECH_OFFSET, 1)
1117+
return media_interface[0] == 0x0F if media_interface else False
1118+
11081119
def is_supported_for_software_control(self, xcvr_api):
11091120
"""Check if the api object supports software control
11101121
@@ -1115,9 +1126,12 @@ def is_supported_for_software_control(self, xcvr_api):
11151126
bool: True if the api object supports software control
11161127
"""
11171128
if xcvr_api.is_flat_memory():
1118-
return self.is_cmis_api(xcvr_api) or self.is_sff_api(xcvr_api)
1119-
else:
1120-
return self.is_cmis_api(xcvr_api)
1129+
if self.is_cmis_api(xcvr_api):
1130+
# For Copper active modules, Nvidia doesn't support SW control
1131+
return self.check_media_interface_technology(xcvr_api)
1132+
return self.is_sff_api(xcvr_api)
1133+
1134+
return self.is_cmis_api(xcvr_api)
11211135

11221136
def check_power_capability(self):
11231137
"""Check module max power with cage power limit

0 commit comments

Comments
 (0)