Skip to content

Commit 6a8ff97

Browse files
authored
Merge pull request sonic-net#553 from r12f/code-sync-202412
[202412] Code sync sonic-net/sonic-buildimage:202411 => 202412
2 parents 77b75db + fd89a8f commit 6a8ff97

File tree

27 files changed

+281
-55
lines changed

27 files changed

+281
-55
lines changed

azure-pipelines.yml

+1
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ stages:
109109
- job:
110110
pool: sonictest
111111
displayName: "vstest"
112+
condition: false # agent pool don't work. disable this job to unblock PRs.
112113
timeoutInMinutes: 60
113114
steps:
114115
- template: .azure-pipelines/cleanup.yml
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="libata.force=noncq module_blacklist=mlx5_ib,mlx5_core ima_hash=sha384 amd_iommu=off"
1+
ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="libata.force=noncq module_blacklist=mlx5_ib,mlx5_core ima_hash=sha384 amd_iommu=off cpufreq.default_governor=performance"

device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-C256S1/buffers_defaults_t0.j2

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
limitations under the License.
1717
#}
1818
{% set default_cable = '40m' %}
19-
{% set ingress_lossless_pool_size = '115245056' %}
20-
{% set ingress_lossless_pool_xoff = '14826496' %}
19+
{% set ingress_lossless_pool_size = '142703616' %}
20+
{% set ingress_lossless_pool_xoff = '1024' %}
2121
{% set egress_lossless_pool_size = '158229504' %}
22-
{% set egress_lossy_pool_size = '115245056' %}
22+
{% set egress_lossy_pool_size = '142703616' %}
2323

2424
{% import 'buffers_defaults_objects.j2' as defs with context %}
2525

device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-C256S1/buffers_defaults_t1.j2

+11-4
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,18 @@
1515
See the License for the specific language governing permissions and
1616
limitations under the License.
1717
#}
18-
{% set default_cable = '300m' %}
19-
{% set ingress_lossless_pool_size = '137779200' %}
20-
{% set ingress_lossless_pool_xoff = '10092544' %}
18+
{% set default_cable = '250m' %}
19+
{% set ingress_lossless_pool_size = '142703616' %}
20+
{% set ingress_lossless_pool_xoff = '1024' %}
2121
{% set egress_lossless_pool_size = '158229504' %}
22-
{% set egress_lossy_pool_size = '137779200' %}
22+
{% set egress_lossy_pool_size = '142703616' %}
23+
24+
{%-set ports2cable = {
25+
'torrouter_server' : '40m',
26+
'leafrouter_torrouter' : '250m',
27+
'spinerouter_leafrouter' : '1000m'
28+
}
29+
-%}
2330

2431
{% import 'buffers_defaults_objects.j2' as defs with context %}
2532

device/mellanox/x86_64-nvidia_sn5600-r0/Mellanox-SN5600-C256S1/pg_profile_lookup.ini

+8
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,11 @@
4949
200000 300m 19456 19456 130048 0
5050
400000 300m 19456 19456 243712 0
5151
800000 300m 38912 38912 411648 0
52+
10000 1000m 19456 19456 24576 0
53+
25000 1000m 19456 19456 46080 0
54+
40000 1000m 19456 19456 68608 0
55+
50000 1000m 19456 19456 83968 0
56+
100000 1000m 19456 19456 168960 0
57+
200000 1000m 19456 19456 308224 0
58+
400000 1000m 19456 19456 610304 0
59+
800000 1000m 38912 38912 1153024 0

platform/broadcom/docker-syncd-brcm-rpc/Dockerfile.j2

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ RUN apt-get update \
2020
wget \
2121
cmake \
2222
libnanomsg5 \
23-
libnanomsg-dev
23+
libnanomsg-dev \
24+
libthrift-0.17.0
2425

2526
{% if docker_syncd_brcm_rpc_debs.strip() -%}
2627
# Copy locally-built Debian package dependencies

platform/broadcom/sai.mk

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
LIBSAIBCM_XGS_VERSION = 12.1.0.2
1+
LIBSAIBCM_XGS_VERSION = 12.3.0.3
22
LIBSAIBCM_DNX_VERSION = 11.2.13.1-1
3-
LIBSAIBCM_XGS_BRANCH_NAME = SAI_12.1.0_GA
3+
LIBSAIBCM_XGS_BRANCH_NAME = SAI_12.3.0_GA
44
LIBSAIBCM_DNX_BRANCH_NAME = SAI_11.2.0_GA
55
LIBSAIBCM_XGS_URL_PREFIX = "https://sonicstorage.blob.core.windows.net/public/sai/sai-broadcom/$(LIBSAIBCM_XGS_BRANCH_NAME)/$(LIBSAIBCM_XGS_VERSION)/xgs"
66
LIBSAIBCM_DNX_URL_PREFIX = "https://sonicstorage.blob.core.windows.net/public/sai/sai-broadcom/$(LIBSAIBCM_DNX_BRANCH_NAME)/$(LIBSAIBCM_DNX_VERSION)/dnx"

platform/mellanox/fw.mk

+5-5
Original file line numberDiff line numberDiff line change
@@ -25,29 +25,29 @@ SIMX_VERSION = 25.1-1070
2525

2626
FW_FROM_URL = y
2727

28-
MLNX_FW_ASSETS_RELEASE_TAG = fw-2014.2152
28+
MLNX_FW_ASSETS_RELEASE_TAG = fw-2014.2166
2929
MLNX_FW_ASSETS_URL = $(MLNX_ASSETS_GITHUB_URL)/releases/download/$(MLNX_FW_ASSETS_RELEASE_TAG)
3030

3131
ifeq ($(MLNX_FW_BASE_URL), )
3232
MLNX_FW_BASE_URL = $(MLNX_FW_ASSETS_URL)
3333
endif
3434

35-
MLNX_SPC_FW_VERSION = 13.2014.2152
35+
MLNX_SPC_FW_VERSION = 13.2014.2166
3636
MLNX_SPC_FW_FILE = fw-SPC-rel-$(subst .,_,$(MLNX_SPC_FW_VERSION))-EVB.mfa
3737
$(MLNX_SPC_FW_FILE)_PATH = $(MLNX_FW_BASE_PATH)
3838
$(MLNX_SPC_FW_FILE)_URL = $(MLNX_FW_BASE_URL)/$(MLNX_SPC_FW_FILE)
3939

40-
MLNX_SPC2_FW_VERSION = 29.2014.2152
40+
MLNX_SPC2_FW_VERSION = 29.2014.2166
4141
MLNX_SPC2_FW_FILE = fw-SPC2-rel-$(subst .,_,$(MLNX_SPC2_FW_VERSION))-EVB.mfa
4242
$(MLNX_SPC2_FW_FILE)_PATH = $(MLNX_FW_BASE_PATH)
4343
$(MLNX_SPC2_FW_FILE)_URL = $(MLNX_FW_BASE_URL)/$(MLNX_SPC2_FW_FILE)
4444

45-
MLNX_SPC3_FW_VERSION = 30.2014.2152
45+
MLNX_SPC3_FW_VERSION = 30.2014.2166
4646
MLNX_SPC3_FW_FILE = fw-SPC3-rel-$(subst .,_,$(MLNX_SPC3_FW_VERSION))-EVB.mfa
4747
$(MLNX_SPC3_FW_FILE)_PATH = $(MLNX_FW_BASE_PATH)
4848
$(MLNX_SPC3_FW_FILE)_URL = $(MLNX_FW_BASE_URL)/$(MLNX_SPC3_FW_FILE)
4949

50-
MLNX_SPC4_FW_VERSION = 34.2014.2152
50+
MLNX_SPC4_FW_VERSION = 34.2014.2166
5151
MLNX_SPC4_FW_FILE = fw-SPC4-rel-$(subst .,_,$(MLNX_SPC4_FW_VERSION))-EVB.mfa
5252
$(MLNX_SPC4_FW_FILE)_PATH = $(MLNX_FW_BASE_PATH)
5353
$(MLNX_SPC4_FW_FILE)_URL = $(MLNX_FW_BASE_URL)/$(MLNX_SPC4_FW_FILE)

platform/mellanox/mlnx-platform-api/sonic_platform/chassis.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#
22
# SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
3-
# Copyright (c) 2019-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3+
# Copyright (c) 2019-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
44
# Apache-2.0
55
#
66
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -447,7 +447,7 @@ def get_change_event_for_module_host_management_mode(self, timeout):
447447
timeout = 1000.0 if timeout >= 1000 else float(timeout)
448448
port_dict = {}
449449
error_dict = {}
450-
begin = time.time()
450+
begin = time.monotonic()
451451
wait_ready_task = sfp.SFP.get_wait_ready_task()
452452

453453
while True:
@@ -524,7 +524,7 @@ def get_change_event_for_module_host_management_mode(self, timeout):
524524
}
525525
else:
526526
if not wait_forever:
527-
elapse = time.time() - begin
527+
elapse = time.monotonic() - begin
528528
if elapse * 1000 >= timeout:
529529
return True, {'sfp': {}}
530530

@@ -569,7 +569,7 @@ def get_change_event_legacy(self, timeout):
569569
timeout = 1000.0 if timeout >= 1000 else float(timeout)
570570
port_dict = {}
571571
error_dict = {}
572-
begin = time.time()
572+
begin = time.monotonic()
573573

574574
while True:
575575
fds_events = self.poll_obj.poll(timeout)
@@ -619,7 +619,7 @@ def get_change_event_legacy(self, timeout):
619619
}
620620
else:
621621
if not wait_forever:
622-
elapse = time.time() - begin
622+
elapse = time.monotonic() - begin
623623
if elapse * 1000 >= timeout:
624624
return True, {'sfp': {}}
625625

platform/mellanox/mlnx-platform-api/sonic_platform/dpuctlplat.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#
22
# SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
3-
# Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3+
# Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
44
# Apache-2.0
55
#
66
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -206,8 +206,8 @@ def wait_for_pci(self):
206206
return True
207207
poll_obj = poll()
208208
poll_obj.register(dir_fd, POLLIN)
209-
start = time.time()
210-
while (time.time() - start) < WAIT_FOR_PCI_DEV:
209+
start = time.monotonic()
210+
while (time.monotonic() - start) < WAIT_FOR_PCI_DEV:
211211
events = poll_obj.poll(WAIT_FOR_PCI_DEV * 1000)
212212
if events:
213213
if os.path.exists(os.path.dirname(self.get_pci_dev_path())):
@@ -473,9 +473,9 @@ def boot_prog_context(self):
473473
@contextmanager
474474
def time_check_context(self, msg):
475475
if self.verbosity:
476-
start_time = time.time()
476+
start_time = time.monotonic()
477477
yield
478-
end_time = time.time()
478+
end_time = time.monotonic()
479479
self.log_info(f"Total time taken = {end_time - start_time} for {msg}")
480480
return
481481
yield

platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#
22
# SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
3-
# Copyright (c) 2019-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3+
# Copyright (c) 2019-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
44
# Apache-2.0
55
#
66
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -1475,14 +1475,14 @@ def initialize_sfp_modules(cls, sfp_list):
14751475
# Resetting SFP requires a reloading of module firmware, it takes up to 3 seconds
14761476
# according to standard
14771477
max_wait_time = 3.5
1478-
begin = time.time()
1478+
begin = time.monotonic()
14791479
while True:
14801480
ready_sfp_set = wait_ready_task.get_ready_set()
14811481
for sfp_index in ready_sfp_set:
14821482
s = sfp_list[sfp_index]
14831483
logger.log_debug(f'SFP {sfp_index} is recovered from resetting state')
14841484
s.on_event(EVENT_RESET_DONE)
1485-
elapse = time.time() - begin
1485+
elapse = time.monotonic() - begin
14861486
if elapse < max_wait_time:
14871487
time.sleep(0.5)
14881488
else:

platform/mellanox/mlnx-platform-api/sonic_platform/thermal.py

+28-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#
2-
# Copyright (c) 2019-2024 NVIDIA CORPORATION & AFFILIATES.
2+
# SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
3+
# Copyright (c) 2019-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
34
# Apache-2.0
45
#
56
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -26,7 +27,9 @@
2627
from sonic_platform_base.thermal_base import ThermalBase
2728
from sonic_py_common.logger import Logger
2829
import copy
30+
import glob
2931
import os
32+
import re
3033

3134
from .device_data import DeviceDataManager
3235
from . import utils
@@ -133,7 +136,9 @@
133136
"temperature": "sodimm{}_temp_input",
134137
"high_threshold": "sodimm{}_temp_max",
135138
"high_critical_threshold": "sodimm{}_temp_crit",
136-
"type": "indexable",
139+
"search_pattern": '/run/hw-management/thermal/sodimm*_temp_input',
140+
'index_pattern': r'sodimm(\d+)_temp_input',
141+
"type": "discrete",
137142
}
138143
],
139144
'linecard thermals': {
@@ -153,21 +158,22 @@ def initialize_chassis_thermals():
153158
rules = THERMAL_NAMING_RULE['chassis thermals']
154159
position = 1
155160
for rule in rules:
156-
if 'type' in rule and rule['type'] == 'indexable':
161+
thermal_type = rule.get('type')
162+
if thermal_type == 'indexable':
157163
count = 0
158164
if 'Gearbox' in rule['name']:
159165
count = DeviceDataManager.get_gearbox_count('/run/hw-management/config')
160166
elif 'CPU Core' in rule['name']:
161167
count = DeviceDataManager.get_cpu_thermal_count()
162-
elif 'SODIMM' in rule['name']:
163-
count = DeviceDataManager.get_sodimm_thermal_count()
164168
if count == 0:
165169
logger.log_debug('Failed to get thermal object count for {}'.format(rule['name']))
166170
continue
167171

168172
for index in range(count):
169173
thermal_list.append(create_indexable_thermal(rule, index, CHASSIS_THERMAL_SYSFS_FOLDER, position))
170174
position += 1
175+
elif thermal_type == 'discrete':
176+
thermal_list.extend(create_discrete_thermal(rule))
171177
else:
172178
thermal_object = create_single_thermal(rule, CHASSIS_THERMAL_SYSFS_FOLDER, position)
173179
if thermal_object:
@@ -274,6 +280,23 @@ def create_single_thermal(rule, sysfs_folder, position, presence_cb=None):
274280
return RemovableThermal(name, temp_file, high_th_file, high_crit_th_file, high_th_default, high_crit_th_default, scale, position, presence_cb)
275281

276282

283+
def create_discrete_thermal(rule):
284+
search_pattern = rule.get('search_pattern')
285+
index_pattern = rule.get('index_pattern')
286+
position = 1
287+
thermal_list = []
288+
for file_path in glob.iglob(search_pattern):
289+
file_name = os.path.basename(file_path)
290+
match = re.search(index_pattern, file_name)
291+
if not match:
292+
logger.log_error(f'Failed to extract index from {file_name} using pattern {index_pattern}')
293+
continue
294+
index = int(match.group(1))
295+
thermal_list.append(create_indexable_thermal(rule, index - 1, CHASSIS_THERMAL_SYSFS_FOLDER, position))
296+
position += 1
297+
return thermal_list
298+
299+
277300
def _check_thermal_sysfs_existence(file_path, presence_cb):
278301
if presence_cb:
279302
status, _ = presence_cb()

platform/mellanox/mlnx-platform-api/sonic_platform/utils.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#
22
# SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
3-
# Copyright (c) 2020-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3+
# Copyright (c) 2020-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
44
# SPDX-License-Identifier: Apache-2.0
55
#
66
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -340,7 +340,7 @@ def schedule(self, interval, cb, repeat=True, run_now=True):
340340
self.add_timer_event(timer_event, run_now)
341341

342342
def add_timer_event(self, timer_event, run_now=True):
343-
timestamp = time.time()
343+
timestamp = time.monotonic()
344344
if not run_now:
345345
timestamp += timer_event.interval
346346

@@ -356,7 +356,7 @@ def stop(self):
356356

357357
def run(self):
358358
while not self._stop_event.is_set():
359-
now = time.time()
359+
now = time.monotonic()
360360
item = self._timestamp_queue.get()
361361
self._min_timestamp = item[0]
362362
if self._min_timestamp > now:

platform/mellanox/mlnx-platform-api/sonic_platform/wait_sfp_ready_task.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#
2-
# Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES.
2+
# SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
3+
# Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
34
# Apache-2.0
45
#
56
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -65,7 +66,7 @@ def schedule_wait(self, sfp_index):
6566
is_empty = len(self._wait_dict) == 0
6667

6768
# The item will be expired in 3 seconds
68-
self._wait_dict[sfp_index] = time.time() + self.WAIT_TIME
69+
self._wait_dict[sfp_index] = time.monotonic() + self.WAIT_TIME
6970

7071
if is_empty:
7172
logger.log_debug('An item arrives, wake up WaitSfpReadyTask')
@@ -120,7 +121,7 @@ def run(self):
120121
self.event.wait()
121122
self.event.clear()
122123

123-
now = time.time()
124+
now = time.monotonic()
124125
with self.lock:
125126
logger.log_debug(f'Processing wait SFP dict: {self._wait_dict}, now={now}')
126127
for sfp_index, expire_time in self._wait_dict.items():

platform/mellanox/mlnx-platform-api/sonic_platform/watchdog.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#
2-
# Copyright (c) 2019-2024 NVIDIA CORPORATION & AFFILIATES.
2+
# SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
3+
# Copyright (c) 2019-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
34
# Apache-2.0
45
#
56
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -229,7 +230,7 @@ def arm(self, seconds):
229230
# Save the watchdog arm timestamp
230231
# requiered for get_remaining_time()
231232
os.makedirs('/tmp/nvidia', exist_ok=True)
232-
utils.write_file(self.TIMESTAMP_FILE, str(time.time()))
233+
utils.write_file(self.TIMESTAMP_FILE, str(time.monotonic()))
233234

234235
return ret
235236

@@ -244,7 +245,7 @@ def get_remaining_time(self):
244245

245246
if self.is_armed():
246247
arm_timestamp = utils.read_float_from_file(self.TIMESTAMP_FILE)
247-
timeleft = int(self.timeout - (time.time() - arm_timestamp))
248+
timeleft = int(self.timeout - (time.monotonic() - arm_timestamp))
248249

249250
return timeleft
250251

platform/mellanox/mlnx-platform-api/tests/test_change_event.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#
2-
# Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES.
2+
# SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
3+
# Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
34
# Apache-2.0
45
#
56
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -34,7 +35,7 @@
3435
class TestChangeEvent:
3536
@mock.patch('sonic_platform.sfp.SFP.get_fd_for_polling_legacy')
3637
@mock.patch('select.poll')
37-
@mock.patch('time.time')
38+
@mock.patch('time.monotonic')
3839
@mock.patch('sonic_platform.device_data.DeviceDataManager.is_module_host_management_mode', mock.MagicMock(return_value=False))
3940
@mock.patch('sonic_platform.device_data.DeviceDataManager.get_sfp_count', mock.MagicMock(return_value=1))
4041
@mock.patch('sonic_platform.chassis.extract_RJ45_ports_index', mock.MagicMock(return_value=[]))
@@ -87,7 +88,7 @@ def test_get_change_event_legacy(self, mock_status, mock_time, mock_create_poll,
8788
@mock.patch('sonic_platform.wait_sfp_ready_task.WaitSfpReadyTask.get_ready_set')
8889
@mock.patch('sonic_platform.sfp.SFP.get_fd')
8990
@mock.patch('select.poll')
90-
@mock.patch('time.time')
91+
@mock.patch('time.monotonic')
9192
@mock.patch('sonic_platform.device_data.DeviceDataManager.is_module_host_management_mode', mock.MagicMock(return_value=True))
9293
@mock.patch('sonic_platform.device_data.DeviceDataManager.get_sfp_count', mock.MagicMock(return_value=1))
9394
@mock.patch('sonic_platform.chassis.extract_RJ45_ports_index', mock.MagicMock(return_value=[]))

0 commit comments

Comments
 (0)