diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py index e2c6d63dc7a3..aa3e188ae5f7 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py @@ -815,6 +815,11 @@ def get_rx_los(self): list: [False] * channels """ api = self.get_xcvr_api() + try: + if self.is_sw_control(): + return api.get_rx_los() if api else None + except Exception as e: + print(e) return [False] * api.NUM_CHANNELS if api else None def get_tx_fault(self): @@ -927,8 +932,6 @@ def get_xcvr_api(self): """ if self._xcvr_api is None: self.refresh_xcvr_api() - if self._xcvr_api is not None: - self._xcvr_api.get_rx_los = self.get_rx_los return self._xcvr_api def is_sw_control(self):