From 881bb40c62192e1a12752ed538a8a763391cbd2c Mon Sep 17 00:00:00 2001 From: Yuanzhe <150663541+yuazhe@users.noreply.github.com> Date: Wed, 19 Jun 2024 14:33:40 +0800 Subject: [PATCH] [Mellanox] Enable get_tx_fault support in CMIS cable host mgmt mode (#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 --- platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py index 58fe71b84c87..a457b7458072 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py @@ -1054,6 +1054,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): @@ -1154,7 +1159,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):