Skip to content

Commit

Permalink
Merge pull request #572 from r12f/code-sync-202412
Browse files Browse the repository at this point in the history
[202412] Code sync sonic-net/sonic-buildimage:202411 => 202412
  • Loading branch information
r12f authored Feb 1, 2025
2 parents 13dc12d + b7d9326 commit b20b2dd
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_5640.xml
SAI_KEY_SPC5_LOSSY_SCHEDULING=1
SAI_DEFAULT_SWITCHING_MODE_STORE_FORWARD=1

4 changes: 2 additions & 2 deletions platform/mellanox/mft.mk
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
#
# Mellanox SAI

MFT_VERSION = 4.30.0
MFT_REVISION = 136
MFT_VERSION = 4.30.2
MFT_REVISION = 23

MLNX_MFT_INTERNAL_SOURCE_BASE_URL =

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,15 @@

try:
from sonic_platform_base.platform_base import PlatformBase
from .chassis import Chassis, ModularChassis, SmartSwitchChassis
from .chassis import Chassis, ModularChassis
from .device_data import DeviceDataManager
except ImportError as e:
raise ImportError(str(e) + "- required module not found")

class Platform(PlatformBase):
def __init__(self):
PlatformBase.__init__(self)
if DeviceDataManager.get_dpu_count():
self._chassis = SmartSwitchChassis()
elif DeviceDataManager.get_linecard_count() == 0:
if DeviceDataManager.get_linecard_count() == 0:
self._chassis = Chassis()
else:
self._chassis = ModularChassis()
6 changes: 4 additions & 2 deletions platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ def get_error_info_from_sdk_error_type(self):
Returns:
tuple: (error state, error description)
"""
error_type = utils.read_int_from_file(f'/sys/module/sx_core/asic0/module{self.sdk_index}/temperature/statuserror', default=-1)
error_type = utils.read_int_from_file(f'/sys/module/sx_core/asic0/module{self.sdk_index}/statuserror', default=-1)
sfp_state_bits = NvidiaSFPCommon.SDK_ERRORS_TO_ERROR_BITS.get(error_type)
if sfp_state_bits is None:
logger.log_error(f"Unrecognized error {error_type} detected on SFP {self.sdk_index}")
Expand Down Expand Up @@ -678,7 +678,9 @@ def get_error_description(self):
if self.is_sw_control():
api = self.get_xcvr_api()
return api.get_error_description() if api else None
except:
except NotImplementedError:
return 'Not supported'
except Exception:
return self.SFP_STATUS_INITIALIZING

oper_status, error_code = self._get_module_info(self.sdk_index)
Expand Down
4 changes: 4 additions & 0 deletions platform/mellanox/mlnx-platform-api/tests/test_sfp.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ def test_sfp_get_error_status(self, mock_get_error_code, mock_control):
mock_control.side_effect = RuntimeError('')
description = sfp.get_error_description()
assert description == 'Initializing'

mock_control.side_effect = NotImplementedError('')
description = sfp.get_error_description()
assert description == 'Not supported'

@mock.patch('sonic_platform.sfp.SFP._get_page_and_page_offset')
@mock.patch('sonic_platform.sfp.SFP._is_write_protected')
Expand Down

0 comments on commit b20b2dd

Please sign in to comment.