Skip to content

Commit

Permalink
[Mellanox] Enable get_tx_fault support in CMIS cable host mgmt mode (s…
Browse files Browse the repository at this point in the history
…onic-net#18984)

- Why I did it
Enable get_tx_fault support in CMIS cable host mgmt mode on Mellanox platforms

- How I did it
Use community get_tx_fault implementation instead of the dummy one

- How to verify it
API call and run API Test

Signed-off-by: Yuanzhe, Liu <yualiu@nvidia.com>
  • Loading branch information
yuazhe authored and mssonicbld committed Jun 20, 2024
1 parent 8fb3fde commit ca5743d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py
Original file line number Diff line number Diff line change
Expand Up @@ -1055,6 +1055,11 @@ def get_tx_fault(self):
list: [False] * channels
"""
api = self.get_xcvr_api()
try:
if self.is_sw_control():
return api.get_tx_fault() if api else None
except Exception as e:
print(e)
return [False] * api.NUM_CHANNELS if api else None

def get_temperature(self):
Expand Down Expand Up @@ -1155,7 +1160,6 @@ def get_xcvr_api(self):
self.refresh_xcvr_api()
if self._xcvr_api is not None:
self._xcvr_api.get_rx_los = self.get_rx_los
self._xcvr_api.get_tx_fault = self.get_tx_fault
return self._xcvr_api

def is_sw_control(self):
Expand Down

0 comments on commit ca5743d

Please sign in to comment.