Skip to content

Commit

Permalink
[Mellanox] Fix timing issue in lpmode change
Browse files Browse the repository at this point in the history
  • Loading branch information
noaOrMlnx committed Feb 26, 2024
1 parent 54c1a49 commit 022a787
Showing 1 changed file with 4 additions and 2 deletions.
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
@@ -1,5 +1,5 @@
#
# Copyright (c) 2019-2023 NVIDIA CORPORATION & AFFILIATES.
# Copyright (c) 2019-2024 NVIDIA CORPORATION & AFFILIATES.
# Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -26,6 +26,7 @@
import ctypes
import subprocess
import os
import time
import threading
from sonic_py_common.logger import Logger
from sonic_py_common.general import check_output_pipe
Expand Down Expand Up @@ -640,7 +641,8 @@ def set_lpmode(self, lpmode):
if api.get_lpmode() == lpmode:
return True
api.set_lpmode(lpmode)
return api.get_lpmode() == lpmode
check_lpmode = lambda api, lpmode: api.get_lpmode() == lpmode
return utils.wait_until(check_lpmode, 2, 1, api=api, lpmode=lpmode)
elif DeviceDataManager.is_independent_mode():
# FW control under CMIS host management mode.
# Currently, we don't support set LPM under this mode.
Expand Down

0 comments on commit 022a787

Please sign in to comment.