Skip to content

Commit

Permalink
[Mellanox] Enable get_rx_los API support in CMIS cable host mgmt mode (
Browse files Browse the repository at this point in the history
…#20743)

- Why I did it
The show int transceiver status PORT CLI always displays Rx LOS as False for all the lanes.

- How I did it
The current platform implementation assigns Rx LOS as False for all the lanes (irrespective of the actual status on the module) which in turn causes the show int transceiver status PORT CLI to display the Rx LOS as False for all the lanes.

Hence, removing the overriding part to ensure that the API is not overridden by the platform.

- How to verify it
Verified the CLI on first 2 lanes which are in admin disabled state from the peer side.

---------
Signed-off-by: Mihir Patel <[email protected]>
  • Loading branch information
mihirpat1 authored and mssonicbld committed Nov 14, 2024
1 parent 06f733c commit 444ce37
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py
Original file line number Diff line number Diff line change
Expand Up @@ -1074,6 +1074,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):
Expand Down Expand Up @@ -1186,8 +1191,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):
Expand Down

0 comments on commit 444ce37

Please sign in to comment.