Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
f70c259
[master_RC] update submodule(s): sonic-utilities
keboliu Mar 10, 2025
9f43aed
[202412_RC] Setting default build rules (%1)
dgsudharsan Mar 6, 2025
ff45cd0
[master_RC] update submodule(s): sonic-utilities
keboliu Mar 26, 2025
06491e0
[master_RC] update submodule(s): sonic-swss, sonic-sairedis
keboliu Mar 31, 2025
7ede772
[master_RC] update submodule(s): sonic-swss-common
keboliu Mar 31, 2025
0b4e2b6
Merge commit '6fd8e017e5ea1a9e0b52853c3cf4b6889513fff1' into master_R…
keboliu Apr 7, 2025
f4ac0ed
Revert "[202412_RC] Setting default build rules (%1)"
keboliu Apr 8, 2025
249db74
[smart-switch-master] [nvidia-bluefield] Fix the issue with the SDK c…
oleksandrivantsiv Apr 9, 2025
7dc570a
Merge branch 'master' into master_RC_19
keboliu Apr 12, 2025
b0eb6f3
[master_RC_19] update submodule(s): sonic-utilities, sonic-swss, soni…
keboliu Apr 12, 2025
0b46bf6
[master_RC_19] [nvidia-bluefield] Add additional SDK dependencies.(%2…
keboliu Apr 12, 2025
5f6597f
[master_RC] update submodule(s): sonic-utilities
keboliu Apr 16, 2025
0b40817
[master_RC] Update submodule(s): sonic-utilities
keboliu Apr 17, 2025
d9d741c
Merge remote-tracking branch 'community/master' into master_RC
keboliu Apr 18, 2025
5a0fde1
[master_RC] update submodule(s): sonic-utilities
keboliu Apr 18, 2025
18ba76a
[master_RC] update submodule(s): sonic-utilities
keboliu Apr 19, 2025
8661b11
Merge branch 'master' into master_RC_26
keboliu Apr 24, 2025
0d5e482
Revert "[anchor] Add as path manager for anchor (#22332)"
keboliu Apr 24, 2025
25c4e85
[master_RC] [Mellanox] Add KVM image target
keboliu Apr 25, 2025
bfa4856
[master_RC] Add WA for chrony issue
keboliu Apr 25, 2025
6acb70d
[master_RC] update submodule(s): sonic-utilities
keboliu Apr 29, 2025
21c39ed
Merge branch 'master' into master_RC_merge_test_05_06
keboliu May 6, 2025
06f6f80
[master_RC] [mellanox] Use the PF interface for the midplane communic…
keboliu May 6, 2025
e5476ce
[master_RC] [DPU] Update SAI to SAIBuild0.0.41.0, FW to v45.0322 (%22…
keboliu May 6, 2025
98dce85
[master_RC] [Mellanox] Upgrade rshim package version to 2.3.2. (%22499)
keboliu May 6, 2025
de23b8f
[master_RC] [nvidia-bluefield] Add firmware configuration reset suppo…
keboliu May 6, 2025
44f278b
[master_RC][Mellanox] remove mlnx specific condition for the ipinip t…
keboliu May 6, 2025
8b868cd
[master_RC][Mellanox] Remove redundant patch which blocks some module…
keboliu May 6, 2025
d757118
Revert "[build] Fix command docker images missing name and tag issue.…
keboliu May 7, 2025
1319081
[master_RC] update submodule(s): sonic-platform-common, sonic-platfor…
keboliu May 9, 2025
99368c6
[master_RC] update submodule(s): sonic-utilities
keboliu May 9, 2025
2086795
[master_RC] [Mellanox] Add SPC5 FW support (%22066)
keboliu May 14, 2025
703fa6d
[master_RC][build][device-data][simx] add KV for simx in sai.profile …
keboliu May 14, 2025
82c0790
[master_RC] update SDK version to be aligned with the FW version
keboliu May 15, 2025
cc8c9d6
[master_RC] Update FW version to be aligned
keboliu May 15, 2025
9cff213
Reapply "[anchor] Add as path manager for anchor (#22332)"
keboliu May 16, 2025
2b3bd82
Merge branch 'master' into master_RC
keboliu May 16, 2025
4c23e22
[master_RC] change chrony_smartswitch.conf to align with the patch fo…
keboliu May 17, 2025
878aeef
Revert "Update dockerfiles to do staged builds (#19952)"
keboliu May 17, 2025
6d8f0d4
[master_RC] update submodule(s): sonic-swss
keboliu May 20, 2025
a75dc4e
[master_RC] fix the submodule link of sonic-swss
keboliu May 20, 2025
0215940
Merge branch 'master' into master_RC_46_test
keboliu May 23, 2025
a08d4a9
[master_RC] [Mellanox] remove mlnx specific condition for the ipinip …
keboliu May 23, 2025
38b18c1
[master_RC] [Mellanox] Update media interface to return the right val…
keboliu May 29, 2025
878accf
[master_RC] [Mellanox] thermal updater only update temperature inform…
keboliu May 29, 2025
61085d7
Merge branch 'master' into master_RC_merge_test_49
keboliu May 30, 2025
4f13824
Revert "[master_RC] Add WA for chrony issue"
keboliu May 30, 2025
fe8fbdf
Revert "[master_RC] change chrony_smartswitch.conf to align with the …
keboliu May 30, 2025
0eeae2e
Revert "[master_RC] [Mellanox] thermal updater only update temperatur…
keboliu Jun 3, 2025
b877e3a
[master_RC][Mellanox] thermal updater only update temperature informa…
keboliu Jun 4, 2025
8c3ec18
Revert "Revert "[build] Fix command docker images missing name and ta…
DavidZagury Jun 16, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
url = https://github.com/sonic-net/sonic-sairedis
[submodule "sonic-swss"]
path = src/sonic-swss
url = https://github.com/sonic-net/sonic-swss
url = https://github.com/nvidia-sonic/sonic-swss
[submodule "src/p4c-bm/p4c-bm"]
path = platform/p4/p4c-bm/p4c-bm
url = https://github.com/krambn/p4c-bm
Expand All @@ -30,7 +30,7 @@
url = https://github.com/p4lang/ptf.git
[submodule "src/sonic-utilities"]
path = src/sonic-utilities
url = https://github.com/sonic-net/sonic-utilities
url = https://github.com/nvidia-sonic/sonic-utilities
[submodule "platform/broadcom/sonic-platform-modules-arista"]
path = platform/broadcom/sonic-platform-modules-arista
url = https://github.com/aristanetworks/sonic
Expand Down
4 changes: 4 additions & 0 deletions build_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,10 @@ elif [ "$IMAGE_TYPE" = "raw" ]; then
echo "The raw image is in $OUTPUT_RAW_IMAGE"

elif [ "$IMAGE_TYPE" = "kvm" ]; then
if [ "$TARGET_MACHINE" = "mellanox" ]; then
echo "Enable Mellanox KVM build"
export MLNX_KVM_IMAGE="yes"
fi

generate_device_list "./installer/platforms_asic"

Expand Down
1 change: 1 addition & 0 deletions files/build_templates/sonic_debian_extension.j2
Original file line number Diff line number Diff line change
Expand Up @@ -1070,6 +1070,7 @@ declare -rA FW_FILE_MAP=( \
[$MLNX_SPC2_FW_FILE]="fw-SPC2.mfa" \
[$MLNX_SPC3_FW_FILE]="fw-SPC3.mfa" \
[$MLNX_SPC4_FW_FILE]="fw-SPC4.mfa" \
[$MLNX_SPC5_FW_FILE]="fw-SPC5.mfa" \
)
sudo mkdir -p $FILESYSTEM_ROOT/$PLATFORM_DIR/fw/asic/
sudo mkdir -p $FILESYSTEM_ROOT_ETC/mlnx/
Expand Down
70 changes: 57 additions & 13 deletions install_sonic.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,66 @@
import sys
import time

class OnieInterface:
"""ONiE Telnet Interface"""

#KEY_UP = '\x1b[A'
KEY_DOWN = '\x1b[B'
#KEY_RIGHT = '\x1b[C'
#KEY_LEFT = '\x1b[D'

ONIE_INSTALL_OS = 'ONIE: Install OS'
ONIE_CONSOLE = 'Please press Enter to activate this console'
ONIE_RESCUE = 'Rescue Mode Enabled'
ONIE_SHELL = 'ONIE:/ #'
ONIE_PROMPT = 'Do you still wish to install this image?'

GRUB_SELECTION = 'The highlighted entry will be executed'

INSTALL_CMD = [
'tmpdir=$(mktemp -d)',
'mount LABEL=INSTALLER $tmpdir',
'onie-nos-install $tmpdir/onie-installer.bin'
]

def __init__(self, telnet_session, arg_list):
self.args = arg_list
self.onie = telnet_session

def wait_grub(self):
self.onie.expect([self.GRUB_SELECTION])

def embed_onie(self):
self.wait_grub()
self.onie.sendline(self.KEY_DOWN)

def install_os(self):
self.onie.expect([self.ONIE_INSTALL_OS])
self.wait_grub()
if self.args.f: # manual installation
# enable rescue mode
self.onie.sendline(self.KEY_DOWN)
self.onie.expect([self.ONIE_CONSOLE])
self.onie.sendline()
self.onie.expect([self.ONIE_RESCUE])
self.onie.expect([self.ONIE_SHELL])
# install image
self.onie.sendline(' ; '.join(self.INSTALL_CMD))
# handle unsupported platform
self.onie.expect([self.ONIE_PROMPT])
self.onie.sendline('y')
else: # automatic discovery installation
self.onie.sendline()


def main():

parser = argparse.ArgumentParser(description='test_login cmdline parser')
parser.add_argument('-p', type=int, default=9000, help='local port')
parser.add_argument('-f', action='store_true', help='force image installation')

args = parser.parse_args()

#KEY_UP = '\x1b[A'
KEY_DOWN = '\x1b[B'
#KEY_RIGHT = '\x1b[C'
#KEY_LEFT = '\x1b[D'

grub_selection = "The highlighted entry will be executed"

i = 0
while True:
try:
Expand All @@ -32,17 +77,16 @@ def main():
raise
time.sleep(1)

onie = OnieInterface(p, args)

# select ONIE embed
p.expect(grub_selection)
p.sendline(KEY_DOWN)
onie.embed_onie()

# select ONIE install
p.expect(['ONIE: Install OS'])
p.expect([grub_selection])
p.sendline()
onie.install_os()

# wait for grub, and exit
p.expect([grub_selection])
onie.wait_grub()


if __name__ == '__main__':
Expand Down
4 changes: 4 additions & 0 deletions platform/mellanox/fw.dep
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@ $(MLNX_SPC3_FW_FILE)_DEP_FILES := $(DEP_FILES)
$(MLNX_SPC4_FW_FILE)_CACHE_MODE := GIT_CONTENT_SHA
$(MLNX_SPC4_FW_FILE)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST)
$(MLNX_SPC4_FW_FILE)_DEP_FILES := $(DEP_FILES)

$(MLNX_SPC5_FW_FILE)_CACHE_MODE := GIT_CONTENT_SHA
$(MLNX_SPC5_FW_FILE)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST)
$(MLNX_SPC5_FW_FILE)_DEP_FILES := $(DEP_FILES)
17 changes: 14 additions & 3 deletions platform/mellanox/fw.mk
Original file line number Diff line number Diff line change
Expand Up @@ -21,38 +21,48 @@ MLNX_FW_BASE_PATH = $(MLNX_SDK_BASE_PATH)
# Place an URL here to FW if you want to download FW instead
MLNX_FW_BASE_URL =

SIMX_VERSION = 25.5-1026
SIMX_VERSION = 25.5-1028

FW_FROM_URL = y

MLNX_FW_ASSETS_RELEASE_TAG = fw-2014.4040
MLNX_FW_ASSETS_RELEASE_TAG = fw-2014.4040
MLNX_FW_ASSETS_URL = $(MLNX_ASSETS_GITHUB_URL)/releases/download/$(MLNX_FW_ASSETS_RELEASE_TAG)

ifeq ($(MLNX_FW_BASE_URL), )
MLNX_FW_BASE_URL = $(MLNX_FW_ASSETS_URL)
endif

MLNX_SPC_FW_VERSION = 13.2014.4040
MLNX_SPC_FW_VERSION = 13.2014.4040
MLNX_SPC_FW_FILE = fw-SPC-rel-$(subst .,_,$(MLNX_SPC_FW_VERSION))-EVB.mfa
$(MLNX_SPC_FW_FILE)_PATH = $(MLNX_FW_BASE_PATH)
$(MLNX_SPC_FW_FILE)_URL = $(MLNX_FW_BASE_URL)/$(MLNX_SPC_FW_FILE)

MLNX_SPC2_FW_VERSION = 29.2014.4040
MLNX_SPC2_FW_VERSION = 29.2014.4040
MLNX_SPC2_FW_FILE = fw-SPC2-rel-$(subst .,_,$(MLNX_SPC2_FW_VERSION))-EVB.mfa
$(MLNX_SPC2_FW_FILE)_PATH = $(MLNX_FW_BASE_PATH)
$(MLNX_SPC2_FW_FILE)_URL = $(MLNX_FW_BASE_URL)/$(MLNX_SPC2_FW_FILE)

MLNX_SPC3_FW_VERSION = 30.2014.4040
MLNX_SPC3_FW_VERSION = 30.2014.4040
MLNX_SPC3_FW_FILE = fw-SPC3-rel-$(subst .,_,$(MLNX_SPC3_FW_VERSION))-EVB.mfa
$(MLNX_SPC3_FW_FILE)_PATH = $(MLNX_FW_BASE_PATH)
$(MLNX_SPC3_FW_FILE)_URL = $(MLNX_FW_BASE_URL)/$(MLNX_SPC3_FW_FILE)

MLNX_SPC4_FW_VERSION = 34.2014.4040
MLNX_SPC4_FW_VERSION = 34.2014.4040
MLNX_SPC4_FW_FILE = fw-SPC4-rel-$(subst .,_,$(MLNX_SPC4_FW_VERSION))-EVB.mfa
$(MLNX_SPC4_FW_FILE)_PATH = $(MLNX_FW_BASE_PATH)
$(MLNX_SPC4_FW_FILE)_URL = $(MLNX_FW_BASE_URL)/$(MLNX_SPC4_FW_FILE)

MLNX_FW_FILES = $(MLNX_SPC_FW_FILE) $(MLNX_SPC2_FW_FILE) $(MLNX_SPC3_FW_FILE) $(MLNX_SPC4_FW_FILE)
MLNX_SPC5_FW_VERSION = 37.2014.4040
MLNX_SPC5_FW_FILE = fw-SPC5-rel-$(subst .,_,$(MLNX_SPC5_FW_VERSION))-EVB.mfa
$(MLNX_SPC5_FW_FILE)_PATH = $(MLNX_FW_BASE_PATH)
$(MLNX_SPC5_FW_FILE)_URL = $(MLNX_FW_BASE_URL)/$(MLNX_SPC5_FW_FILE)

MLNX_FW_FILES = $(MLNX_SPC_FW_FILE) $(MLNX_SPC2_FW_FILE) $(MLNX_SPC3_FW_FILE) $(MLNX_SPC4_FW_FILE) $(MLNX_SPC5_FW_FILE)

ifeq ($(FW_FROM_URL),n)
SONIC_COPY_FILES += $(MLNX_FW_FILES)
Expand All @@ -62,9 +72,10 @@ endif

MLNX_FILES += $(MLNX_FW_FILES)

export MLNX_SPC_FW_VERSION MLNX_SPC2_FW_VERSION MLNX_SPC3_FW_VERSION MLNX_SPC4_FW_VERSION
export MLNX_SPC_FW_VERSION MLNX_SPC2_FW_VERSION MLNX_SPC3_FW_VERSION MLNX_SPC4_FW_VERSION MLNX_SPC5_FW_VERSION
export SIMX_VERSION
export MLNX_SPC_FW_FILE
export MLNX_SPC2_FW_FILE
export MLNX_SPC3_FW_FILE
export MLNX_SPC4_FW_FILE
export MLNX_SPC5_FW_FILE
2 changes: 2 additions & 0 deletions platform/mellanox/kvm-image.dep
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# DPKG FRK
$(SONIC_KVM_IMAGE)_CACHE_MODE := none
32 changes: 32 additions & 0 deletions platform/mellanox/kvm-image.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#
# SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
# Copyright (c) 2017-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# sonic mellanox kvm image

SONIC_KVM_IMAGE = sonic-mellanox.img.gz
$(SONIC_KVM_IMAGE)_MACHINE = mellanox
$(SONIC_KVM_IMAGE)_IMAGE_TYPE = kvm
$(SONIC_KVM_IMAGE)_INSTALLS += $(SX_KERNEL) $(KERNEL_MFT) $(MFT_OEM) $(MFT) $(MFT_FWTRACE_CFG) $(MLNX_HW_MANAGEMENT) $(MLNX_RSHIM)
$(SONIC_KVM_IMAGE)_INSTALLS += $(SYSTEMD_SONIC_GENERATOR)
ifeq ($(INSTALL_DEBUG_TOOLS),y)
$(SONIC_KVM_IMAGE)_DOCKERS += $(SONIC_INSTALL_DOCKER_DBG_IMAGES)
$(SONIC_KVM_IMAGE)_DOCKERS += $(filter-out $(patsubst %-$(DBG_IMAGE_MARK).gz,%.gz, $(SONIC_INSTALL_DOCKER_DBG_IMAGES)), $(SONIC_INSTALL_DOCKER_IMAGES))
else
$(SONIC_KVM_IMAGE)_DOCKERS = $(SONIC_INSTALL_DOCKER_IMAGES)
endif
$(SONIC_KVM_IMAGE)_FILES = $(MLNX_FILES) $(MLNX_CPLD_ARCHIVES) $(ONIE_RECOVERY_IMAGE)
SONIC_INSTALLERS += $(SONIC_KVM_IMAGE)
8 changes: 7 additions & 1 deletion platform/mellanox/mlnx-fw-upgrade.j2
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ declare -r SPC1_ASIC="spc1"
declare -r SPC2_ASIC="spc2"
declare -r SPC3_ASIC="spc3"
declare -r SPC4_ASIC="spc4"
declare -r SPC5_ASIC="spc5"
declare -r BF3_NIC="bf3"
declare -r UNKN_ASIC="unknown"
declare -r UNKN_MST="unknown"
Expand All @@ -59,6 +60,7 @@ declare -rA FW_FILE_MAP=( \
[$SPC2_ASIC]="fw-SPC2.mfa" \
[$SPC3_ASIC]="fw-SPC3.mfa" \
[$SPC4_ASIC]="fw-SPC4.mfa" \
[$SPC5_ASIC]="fw-SPC5.mfa" \
[$BF3_NIC]="fw-BF3.mfa" \
)

Expand Down Expand Up @@ -207,7 +209,7 @@ function GetMstDeviceType() {
local -r asic_type=$(GetAsicType)

case $asic_type in
${SPC1_ASIC}|${SPC2_ASIC}|${SPC3_ASIC}|${SPC4_ASIC})
${SPC1_ASIC}|${SPC2_ASIC}|${SPC3_ASIC}|${SPC4_ASIC}|${SPC5_ASIC})
echo "Spectrum"
return ${EXIT_SUCCESS}
;;
Expand Down Expand Up @@ -256,6 +258,7 @@ function GetAsicType() {
local -r SPC2_PRODUCT_ID="cf6c"
local -r SPC3_PRODUCT_ID="cf70"
local -r SPC4_PRODUCT_ID="cf80"
local -r SPC5_PRODUCT_ID="cf82"
local -r BF3_PRODUCT_ID="a2dc"

local -i QUERY_RETRY_COUNT="0"
Expand All @@ -282,6 +285,9 @@ function GetAsicType() {
elif echo $pcitree | grep "${VENDOR_ID}:${SPC4_PRODUCT_ID}" &>/dev/null; then
echo "${SPC4_ASIC}"
exit "${EXIT_SUCCESS}"
elif echo $pcitree | grep "${VENDOR_ID}:${SPC5_PRODUCT_ID}" &>/dev/null; then
echo "${SPC5_ASIC}"
exit "${EXIT_SUCCESS}"
elif echo $pcitree | grep "${VENDOR_ID}:${BF3_PRODUCT_ID}" &>/dev/null; then
echo "${BF3_NIC}"
exit "${EXIT_SUCCESS}"
Expand Down
35 changes: 14 additions & 21 deletions platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py
Original file line number Diff line number Diff line change
Expand Up @@ -861,47 +861,40 @@ def get_temperature_info(self):
tuple: (temperature, warning_threshold, critical_threshold)
"""
try:
sw_control = self.is_sw_control()
if not sw_control:
return sw_control, None, None, None

sn_changed = self.reinit_if_sn_changed()
if not self.is_sw_control():
# firmware control, read from sysfs
temp_file = f'/sys/module/sx_core/asic0/module{self.sdk_index}/temperature/input'
if not os.path.exists(temp_file):
logger.log_error(f'Failed to read from file {temp_file} - not exists')
temperature = None
else:
temperature = utils.read_int_from_file(temp_file,
log_func=None)
temperature = temperature / SFP_TEMPERATURE_SCALE if temperature is not None else None
else:
# software control, read from EEPROM
temperature = super().get_temperature()
# software control, read from EEPROM
temperature = super().get_temperature()
if temperature is None:
# Failed to read temperature, no need read threshold
return None, None, None
return sw_control, None, None, None
elif temperature == 0.0:
# Temperature is not supported, no need read threshold
return 0.0, 0.0, 0.0
return sw_control, 0.0, 0.0, 0.0
else:
if not sn_changed and self.temp_high_threshold is not None and self.temp_critical_threshold is not None:
return temperature, self.temp_high_threshold, self.temp_critical_threshold
return sw_control, temperature, self.temp_high_threshold, self.temp_critical_threshold
else:
# Read threshold from EEPROM
api = self.get_xcvr_api()
thresh_support = api.get_transceiver_thresholds_support()
if thresh_support is None:
# Failed to read threshold support field, no need read threshold
return temperature, None, None
return sw_control, temperature, None, None
if thresh_support:
# Read threshold from EEPROM
self.temp_high_threshold = api.xcvr_eeprom.read(consts.TEMP_HIGH_WARNING_FIELD)
self.temp_critical_threshold = api.xcvr_eeprom.read(consts.TEMP_HIGH_ALARM_FIELD)
return temperature, self.temp_high_threshold, self.temp_critical_threshold
return sw_control, temperature, self.temp_high_threshold, self.temp_critical_threshold
else:
# No threshold support, use default threshold
return temperature, 0.0, 0.0
return sw_control, temperature, 0.0, 0.0
except:
# module under initialization, return as temperature not supported
return 0.0, 0.0, 0.0
return False, None, None, None

def get_temperature(self):
"""Get SFP temperature
Expand Down Expand Up @@ -1114,7 +1107,7 @@ def check_media_interface_technology(self, xcvr_api):
xcvr_api (object): xcvr api object
"""
media_interface = self.read_eeprom(CMIS_MEDIA_INTERFACE_TECH_OFFSET, 1)
return media_interface[0] == 0x0F if media_interface else False
return media_interface[0] != 0x0F if media_interface else False

def is_supported_for_software_control(self, xcvr_api):
"""Check if the api object supports software control
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def initialize(cls):
if not dpus_present and host_mgmt_mode:
# Non smart switch behaviour has highest priority
from .chassis import Chassis
cls.thermal_updater_task = thermal_updater.ThermalUpdater(sfp_list=Chassis.chassis_instance.get_all_sfps())
cls.thermal_updater_task = thermal_updater.ThermalUpdater(sfp_list=Chassis.chassis_instance.get_all_sfps(), update_asic=False)
elif dpus_present:
from .chassis import Chassis
dpus = Chassis.chassis_instance.get_all_modules()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,11 @@


class ThermalUpdater:
def __init__(self, sfp_list):
def __init__(self, sfp_list, update_asic=True):
self._sfp_list = sfp_list
self._sfp_status = {}
self._timer = utils.Timer()
self._update_asic = update_asic

def load_tc_config(self):
asic_poll_interval = 1
Expand All @@ -75,8 +76,9 @@ def load_tc_config(self):
if sfp_poll_interval_config:
sfp_poll_interval = int(sfp_poll_interval_config) / 2

logger.log_notice(f'ASIC polling interval: {asic_poll_interval}')
self._timer.schedule(asic_poll_interval, self.update_asic)
if self._update_asic:
logger.log_notice(f'ASIC polling interval: {asic_poll_interval}')
self._timer.schedule(asic_poll_interval, self.update_asic)
logger.log_notice(f'Module polling interval: {sfp_poll_interval}')
self._timer.schedule(sfp_poll_interval, self.update_module)

Expand Down Expand Up @@ -120,7 +122,9 @@ def update_single_module(self, sfp):
presence = sfp.get_presence()
pre_presence = self._sfp_status.get(sfp.sdk_index)
if presence:
temperature, warning_thresh, critical_thresh = sfp.get_temperature_info()
sw_control, temperature, warning_thresh, critical_thresh = sfp.get_temperature_info()
if not sw_control:
return
fault = ERROR_READ_THERMAL_DATA if (temperature is None or warning_thresh is None or critical_thresh is None) else 0
temperature = 0 if temperature is None else temperature * SFP_TEMPERATURE_SCALE
warning_thresh = 0 if warning_thresh is None else warning_thresh * SFP_TEMPERATURE_SCALE
Expand Down
Loading