From d06ef9a26655b3923c0477e687e0bb34273cd7df Mon Sep 17 00:00:00 2001 From: noaOrMlnx <58519608+noaOrMlnx@users.noreply.github.com> Date: Tue, 3 Dec 2024 18:54:21 +0200 Subject: [PATCH 1/3] [Mellanox] [SN5640] Add sensors.conf, pcie.yaml files, and update platform.json for simx (#20987) - Why I did it Add platform support for SN5640 under simulation - How I did it Added needed files to SN5640 SimX platform - How to verify it Run platform simulation tests --- .../x86_64-nvidia_sn5640_simx-r0/pcie.yaml | 91 ++++ .../platform.json | 18 +- .../x86_64-nvidia_sn5640_simx-r0/sensors.conf | 494 ++++++++++++++++++ 3 files changed, 602 insertions(+), 1 deletion(-) create mode 100644 device/mellanox/x86_64-nvidia_sn5640_simx-r0/pcie.yaml create mode 100644 device/mellanox/x86_64-nvidia_sn5640_simx-r0/sensors.conf diff --git a/device/mellanox/x86_64-nvidia_sn5640_simx-r0/pcie.yaml b/device/mellanox/x86_64-nvidia_sn5640_simx-r0/pcie.yaml new file mode 100644 index 000000000000..0c0e1241b16c --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5640_simx-r0/pcie.yaml @@ -0,0 +1,91 @@ +## +## SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES +## Copyright (c) 2023-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +## SPDX-License-Identifier: 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. +## + +- bus: '00' + dev: '00' + fn: '0' + id: '1237' + name: 'Host bridge: Intel Corporation 440FX - 82441FX PMC [Natoma] (rev 02)' +- bus: '00' + dev: '01' + fn: '0' + id: '7000' + name: 'ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II]' +- bus: '00' + dev: '01' + fn: '1' + id: '7010' + name: 'IDE interface: Intel Corporation 82371SB PIIX3 IDE [Natoma/Triton II]' +- bus: '00' + dev: '01' + fn: '2' + id: '7020' + name: 'USB controller: Intel Corporation 82371SB PIIX3 USB [Natoma/Triton II] (rev + 01)' +- bus: '00' + dev: '01' + fn: '3' + id: '7113' + name: 'Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 03)' +- bus: '00' + dev: '02' + fn: '0' + id: 00b8 + name: 'VGA compatible controller: Cirrus Logic GD 5446' +- bus: '00' + dev: '03' + fn: '0' + id: 100e + name: 'Ethernet controller: Intel Corporation 82540EM Gigabit Ethernet Controller + (rev 03)' +- bus: '00' + dev: '04' + fn: '0' + id: '1002' + name: 'Unclassified device [00ff]: Red Hat, Inc. Virtio memory balloon' +- bus: '00' + dev: '05' + fn: '0' + id: '1009' + name: 'Unclassified device [0002]: Red Hat, Inc. Virtio filesystem' +- bus: '00' + dev: '06' + fn: '0' + id: '2922' + name: 'SATA controller: Intel Corporation 82801IR/IO/IH (ICH9R/DO/DH) 6 port SATA + Controller [AHCI mode] (rev 02)' +- bus: '00' + dev: '07' + fn: '0' + id: '0001' + name: 'PCI bridge: Red Hat, Inc. QEMU PCI-PCI bridge' +- bus: '00' + dev: 0c + fn: '0' + id: '1009' + name: 'Unclassified device [0002]: Red Hat, Inc. Virtio filesystem' +- bus: '00' + dev: 0e + fn: '0' + id: '1001' + name: 'System peripheral: NVIDIA Corporation GK110B [GeForce GTX TITAN Z] (rev 01)' +- bus: '01' + dev: '10' + fn: '0' + id: cf82 + name: 'Ethernet controller: Mellanox Technologies Spectrum-4L' diff --git a/device/mellanox/x86_64-nvidia_sn5640_simx-r0/platform.json b/device/mellanox/x86_64-nvidia_sn5640_simx-r0/platform.json index d866c6a23ec2..755c7e03b629 100644 --- a/device/mellanox/x86_64-nvidia_sn5640_simx-r0/platform.json +++ b/device/mellanox/x86_64-nvidia_sn5640_simx-r0/platform.json @@ -1,6 +1,6 @@ { "chassis": { - "name": "SN5600_SIMX", + "name": "SN5640_SIMX", "components": [ { "name": "ONIE" @@ -634,6 +634,22 @@ "name": "xSFP module 64 Temp" } ] + }, + { + "name": "sfp65", + "thermals": [ + { + "name": "xSFP module 65 Temp" + } + ] + }, + { + "name": "sfp66", + "thermals": [ + { + "name": "xSFP module 66 Temp" + } + ] } ] }, diff --git a/device/mellanox/x86_64-nvidia_sn5640_simx-r0/sensors.conf b/device/mellanox/x86_64-nvidia_sn5640_simx-r0/sensors.conf new file mode 100644 index 000000000000..6ef2195aac57 --- /dev/null +++ b/device/mellanox/x86_64-nvidia_sn5640_simx-r0/sensors.conf @@ -0,0 +1,494 @@ +################################################################################## +# Copyright (c) 2019 - 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Platform specific sensors config for SN5600 +################################################################################## + +# Temperature sensors +chip "mlxsw-i2c-*-48" + label temp1 "Ambient ASIC Temp" + +chip "tmp102-i2c-6-49" + label temp1 "Ambient Fan Side Temp (air intake)" +chip "adt75-i2c-6-49" + label temp1 "Ambient Fan Side Temp (air intake)" +chip "stts751-i2c-6-49" + label temp1 "Ambient Fan Side Temp (air intake)" +chip "tmp102-i2c-7-4a" + label temp1 "Ambient Port Side Temp (air exhaust)" +chip "adt75-i2c-7-4a" + label temp1 "Ambient Port Side Temp (air exhaust)" +chip "stts751-i2c-7-4a" + label temp1 "Ambient Port Side Temp (air exhaust)" +chip "tmp411-i2c-7-4c" + label temp1 "Ambient External Temp" + +# Power controllers +chip "mp2891-i2c-*-62" + label in1 "PMIC-1 PSU 13V5 Rail (in1)" + label in2 "PMIC-1 VDD_M ADJ Rail (out1)" + ignore in3 + label temp1 "PMIC-1 VDD_M ADJ Temp 1" + ignore temp2 + label power1 "PMIC-1 13V5 VDD_M (in)" + label power2 "PMIC-1 VDD_M Rail Pwr (out1)" + ignore power3 + label curr1 "PMIC-1 13V5 VDD_M Rail Curr (in1)" + label curr2 "PMIC-1 VDD_M Rail Curr (out1)" + ignore curr3 + ignore curr4 + ignore curr5 + ignore curr6 + ignore curr7 + ignore curr8 + ignore curr9 + ignore curr10 +chip "xdpe1a2g7-i2c-*-62" + label in1 "PMIC-1 PSU 13V5 Rail (in1)" + label in2 "PMIC-1 VDD_M ADJ Rail (out1)" + ignore in3 + label temp1 "PMIC-1 VDD_M ADJ Temp 1" + ignore temp2 + label power1 "PMIC-1 13V5 VDD_M (in)" + label power2 "PMIC-1 VDD_M Rail Pwr (out1)" + ignore power3 + label curr1 "PMIC-1 13V5 VDD_M Rail Curr (in1)" + label curr2 "PMIC-1 VDD_M Rail Curr (out1)" + ignore curr3 + ignore curr4 + ignore curr5 + ignore curr6 + ignore curr7 + ignore curr8 + ignore curr9 + ignore curr10 + +chip "mp2891-i2c-*-63" + label in1 "PMIC-2 PSU 13V5 Rail (in1)" + label in2 "PMIC-2 VDD_T0 ADJ Rail (out1)" + label in3 "PMIC-2 VDD_T1 ADJ Rail (out2)" + label temp1 "PMIC-2 VDD_T0 ADJ Temp 1" + label temp2 "PMIC-2 VDD_T1 ADJ Temp 2" + label power1 "PMIC-2 13V5 VDD_T0 VDD_T1 (in)" + label power2 "PMIC-2 VDD_T0 Rail Pwr (out1)" + label power3 "PMIC-2 VDD_T1 Rail Pwr (out2)" + label curr1 "PMIC-2 13V5 VDD_T0 VDD_T1 Rail Curr (in1)" + label curr2 "PMIC-2 VDD_T0 Rail Curr (out1)" + label curr3 "PMIC-2 VDD_T1 Rail Curr (out2)" + ignore curr4 + ignore curr5 + ignore curr6 +chip "xdpe1a2g7-i2c-*-63" + label in1 "PMIC-2 PSU 13V5 Rail (in1)" + label in2 "PMIC-2 VDD_T0 ADJ Rail (out1)" + label in3 "PMIC-2 VDD_T1 ADJ Rail (out2)" + label temp1 "PMIC-2 VDD_T0 ADJ Temp 1" + label temp2 "PMIC-2 VDD_T1 ADJ Temp 2" + label power1 "PMIC-2 13V5 VDD_T0 VDD_T1 (in)" + label power2 "PMIC-2 VDD_T0 Rail Pwr (out1)" + label power3 "PMIC-2 VDD_T1 Rail Pwr (out2)" + label curr1 "PMIC-2 13V5 VDD_T0 VDD_T1 Rail Curr (in1)" + label curr2 "PMIC-2 VDD_T0 Rail Curr (out1)" + label curr3 "PMIC-2 VDD_T1 Rail Curr (out2)" + ignore curr4 + ignore curr5 + ignore curr6 + +chip "mp2891-i2c-*-64" + label in1 "PMIC-3 PSU 13V5 Rail (in1)" + label in2 "PMIC-3 VDD_T2 ADJ Rail (out1)" + label in3 "PMIC-3 VDD_T3 ADJ Rail (out2)" + label temp1 "PMIC-3 VDD_T2 ADJ Temp 1" + label temp2 "PMIC-3 VDD_T3 ADJ Temp 2" + label power1 "PMIC-3 13V5 VDD_T2 VDD_T3 (in)" + label power2 "PMIC-3 VDD_T2 Rail Pwr (out1)" + label power3 "PMIC-3 VDD_T3 Rail Pwr (out2)" + label curr1 "PMIC-3 13V5 VDD_T2 VDD_T3 Rail Curr (in1)" + label curr2 "PMIC-3 VDD_T2 Rail Curr (out1)" + label curr3 "PMIC-3 VDD_T3 Rail Curr (out2)" + ignore curr4 + ignore curr5 + ignore curr6 +chip "xdpe1a2g7-i2c-*-64" + label in1 "PMIC-3 PSU 13V5 Rail (in1)" + label in2 "PMIC-3 VDD_T2 ADJ Rail (out1)" + label in3 "PMIC-3 VDD_T3 ADJ Rail (out2)" + label temp1 "PMIC-3 VDD_T2 ADJ Temp 1" + label temp2 "PMIC-3 VDD_T3 ADJ Temp 2" + label power1 "PMIC-3 13V5 VDD_T2 VDD_T3 (in)" + label power2 "PMIC-3 VDD_T2 Rail Pwr (out1)" + label power3 "PMIC-3 VDD_T3 Rail Pwr (out2)" + label curr1 "PMIC-3 13V5 VDD_T2 VDD_T3 Rail Curr (in1)" + label curr2 "PMIC-3 VDD_T2 Rail Curr (out1)" + label curr3 "PMIC-3 VDD_T3 Rail Curr (out2)" + ignore curr4 + ignore curr5 + ignore curr6 + +chip "mp2891-i2c-*-65" + label in1 "PMIC-4 PSU 13V5 Rail (in1)" + label in2 "PMIC-4 VDD_T4 ADJ Rail (out1)" + label in3 "PMIC-4 VDD_T5 ADJ Rail (out2)" + label temp1 "PMIC-4 VDD_T4 ADJ Temp 1" + label temp2 "PMIC-4 VDD_T5 ADJ Temp 2" + label power1 "PMIC-4 13V5 VDD_T4 VDD_T5 (in)" + label power2 "PMIC-4 VDD_T4 Rail Pwr (out1)" + label power3 "PMIC-4 VDD_T5 Rail Pwr (out2)" + label curr1 "PMIC-4 13V5 VDD_T4 VDD_T5 Rail Curr (in1)" + label curr2 "PMIC-4 VDD_T4 Rail Curr (out1)" + label curr3 "PMIC-4 VDD_T5 Rail Curr (out2)" + ignore curr4 + ignore curr5 + ignore curr6 +chip "xdpe1a2g7-i2c-*-65" + label in1 "PMIC-4 PSU 13V5 Rail (in1)" + label in2 "PMIC-4 VDD_T4 ADJ Rail (out1)" + label in3 "PMIC-4 VDD_T5 ADJ Rail (out2)" + label temp1 "PMIC-4 VDD_T4 ADJ Temp 1" + label temp2 "PMIC-4 VDD_T5 ADJ Temp 2" + label power1 "PMIC-4 13V5 VDD_T4 VDD_T5 (in)" + label power2 "PMIC-4 VDD_T4 Rail Pwr (out1)" + label power3 "PMIC-4 VDD_T5 Rail Pwr (out2)" + label curr1 "PMIC-4 13V5 VDD_T4 VDD_T5 Rail Curr (in1)" + label curr2 "PMIC-4 VDD_T4 Rail Curr (out1)" + label curr3 "PMIC-4 VDD_T5 Rail Curr (out2)" + ignore curr4 + ignore curr5 + ignore curr6 + +chip "mp2891-i2c-*-66" + label in1 "PMIC-5 PSU 13V5 Rail (in1)" + label in2 "PMIC-5 VDD_T6 ADJ Rail (out1)" + label in3 "PMIC-5 VDD_T7 ADJ Rail (out2)" + label temp1 "PMIC-5 VDD_T6 ADJ Temp 1" + label temp2 "PMIC-5 VDD_T7 ADJ Temp 2" + label power1 "PMIC-5 13V5 VDD_T6 VDD_T7 (in)" + label power2 "PMIC-5 VDD_T6 Rail Pwr (out1)" + label power3 "PMIC-5 VDD_T7 Rail Pwr (out2)" + label curr1 "PMIC-5 13V5 VDD_T6 VDD_T7 Rail Curr (in1)" + label curr2 "PMIC-5 VDD_T6 Rail Curr (out1)" + label curr3 "PMIC-5 VDD_T7 Rail Curr (out2)" + ignore curr4 + ignore curr5 + ignore curr6 +chip "xdpe1a2g7-i2c-*-66" + label in1 "PMIC-5 PSU 13V5 Rail (in1)" + label in2 "PMIC-5 VDD_T6 ADJ Rail (out1)" + label in3 "PMIC-5 VDD_T7 ADJ Rail (out2)" + label temp1 "PMIC-5 VDD_T6 ADJ Temp 1" + label temp2 "PMIC-5 VDD_T7 ADJ Temp 2" + label power1 "PMIC-5 13V5 VDD_T6 VDD_T7 (in)" + label power2 "PMIC-5 VDD_T6 Rail Pwr (out1)" + label power3 "PMIC-5 VDD_T7 Rail Pwr (out2)" + label curr1 "PMIC-5 13V5 VDD_T6 VDD_T7 Rail Curr (in1)" + label curr2 "PMIC-5 VDD_T6 Rail Curr (out1)" + label curr3 "PMIC-5 VDD_T7 Rail Curr (out2)" + ignore curr4 + ignore curr5 + ignore curr6 + +chip "mp2891-i2c-*-67" + label in1 "PMIC-6 PSU 13V5 Rail (in1)" + label in2 "PMIC-6 DVDD_T0 ADJ Rail (out1)" + label in3 "PMIC-6 DVDD_T1 ADJ Rail (out2)" + label temp1 "PMIC-6 DVDD_T0 ADJ Temp 1" + label temp2 "PMIC-6 DVDD_T1 ADJ Temp 2" + label power1 "PMIC-6 13V5 DVDD_T0 DVDD_T1 (in)" + label power2 "PMIC-6 DVDD_T0 Rail Pwr (out1)" + label power3 "PMIC-6 DVDD_T1 Rail Pwr (out2)" + label curr1 "PMIC-6 13V5 DVDD_T0 DVDD_T1 Rail Curr (in1)" + label curr2 "PMIC-6 DVDD_T0 Rail Curr (out1)" + label curr3 "PMIC-6 DVDD_T1 Rail Curr (out2)" + ignore curr4 + ignore curr5 + ignore curr6 +chip "xdpe1a2g7-i2c-*-67" + label in1 "PMIC-6 PSU 13V5 Rail (in1)" + label in2 "PMIC-6 DVDD_T0 ADJ Rail (out1)" + label in3 "PMIC-6 DVDD_T1 ADJ Rail (out2)" + label temp1 "PMIC-6 DVDD_T0 ADJ Temp 1" + label temp2 "PMIC-6 DVDD_T1 ADJ Temp 2" + label power1 "PMIC-6 13V5 DVDD_T0 DVDD_T1 (in)" + label power2 "PMIC-6 DVDD_T0 Rail Pwr (out1)" + label power3 "PMIC-6 DVDD_T1 Rail Pwr (out2)" + label curr1 "PMIC-6 13V5 DVDD_T0 DVDD_T1 Rail Curr (in1)" + label curr2 "PMIC-6 DVDD_T0 Rail Curr (out1)" + label curr3 "PMIC-6 DVDD_T1 Rail Curr (out2)" + ignore curr4 + ignore curr5 + ignore curr6 + +chip "mp2891-i2c-*-68" + label in1 "PMIC-7 PSU 13V5 Rail (in1)" + label in2 "PMIC-7 DVDD_T2 ADJ Rail (out1)" + label in3 "PMIC-7 DVDD_T3 ADJ Rail (out2)" + label temp1 "PMIC-7 DVDD_T2 ADJ Temp 1" + label temp2 "PMIC-7 DVDD_T3 ADJ Temp 2" + label power1 "PMIC-7 13V5 DVDD_T2 DVDD_T3 (in)" + label power2 "PMIC-7 DVDD_T2 Rail Pwr (out1)" + label power3 "PMIC-7 DVDD_T3 Rail Pwr (out2)" + label curr1 "PMIC-7 13V5 DVDD_T2 DVDD_T3 Rail Curr (in1)" + label curr2 "PMIC-7 DVDD_T2 Rail Curr (out1)" + label curr3 "PMIC-7 DVDD_T3 Rail Curr (out2)" + ignore curr4 + ignore curr5 + ignore curr6 +chip "xdpe1a2g7-i2c-*-68" + label in1 "PMIC-7 PSU 13V5 Rail (in1)" + label in2 "PMIC-7 DVDD_T2 ADJ Rail (out1)" + label in3 "PMIC-7 DVDD_T3 ADJ Rail (out2)" + label temp1 "PMIC-7 DVDD_T2 ADJ Temp 1" + label temp2 "PMIC-7 DVDD_T3 ADJ Temp 2" + label power1 "PMIC-7 13V5 DVDD_T2 DVDD_T3 (in)" + label power2 "PMIC-7 DVDD_T2 Rail Pwr (out1)" + label power3 "PMIC-7 DVDD_T3 Rail Pwr (out2)" + label curr1 "PMIC-7 13V5 DVDD_T2 DVDD_T3 Rail Curr (in1)" + label curr2 "PMIC-7 DVDD_T2 Rail Curr (out1)" + label curr3 "PMIC-7 DVDD_T3 Rail Curr (out2)" + ignore curr4 + ignore curr5 + ignore curr6 + +chip "mp2891-i2c-*-69" + label in1 "PMIC-8 PSU 13V5 Rail (in1)" + label in2 "PMIC-8 DVDD_T4 ADJ Rail (out1)" + label in3 "PMIC-8 DVDD_T5 ADJ Rail (out2)" + label temp1 "PMIC-8 DVDD_T4 ADJ Temp 1" + label temp2 "PMIC-8 DVDD_T5 ADJ Temp 2" + label power1 "PMIC-8 13V5 DVDD_T4 DVDD_T5 (in)" + label power2 "PMIC-8 DVDD_T4 Rail Pwr (out1)" + label power3 "PMIC-8 DVDD_T5 Rail Pwr (out2)" + label curr1 "PMIC-8 13V5 DVDD_T4 DVDD_T5 Rail Curr (in1)" + label curr2 "PMIC-8 DVDD_T4 Rail Curr (out1)" + label curr3 "PMIC-8 DVDD_T5 Rail Curr (out2)" + ignore curr4 + ignore curr5 + ignore curr6 +chip "xdpe1a2g7-i2c-*-69" + label in1 "PMIC-8 PSU 13V5 Rail (in1)" + label in2 "PMIC-8 DVDD_T4 ADJ Rail (out1)" + label in3 "PMIC-8 DVDD_T5 ADJ Rail (out2)" + label temp1 "PMIC-8 DVDD_T4 ADJ Temp 1" + label temp2 "PMIC-8 DVDD_T5 ADJ Temp 2" + label power1 "PMIC-8 13V5 DVDD_T4 DVDD_T5 (in)" + label power2 "PMIC-8 DVDD_T4 Rail Pwr (out1)" + label power3 "PMIC-8 DVDD_T5 Rail Pwr (out2)" + label curr1 "PMIC-8 13V5 DVDD_T4 DVDD_T5 Rail Curr (in1)" + label curr2 "PMIC-8 DVDD_T4 Rail Curr (out1)" + label curr3 "PMIC-8 DVDD_T5 Rail Curr (out2)" + ignore curr4 + ignore curr5 + ignore curr6 + +chip "mp2891-i2c-*-6a" + label in1 "PMIC-9 PSU 13V5 Rail (in1)" + label in2 "PMIC-9 DVDD_T6 ADJ Rail (out1)" + label in3 "PMIC-9 DVDD_T7 ADJ Rail (out2)" + label temp1 "PMIC-9 DVDD_T6 ADJ Temp 1" + label temp2 "PMIC-9 DVDD_T7 ADJ Temp 2" + label power1 "PMIC-9 13V5 DVDD_T6 DVDD_T7 (in)" + label power2 "PMIC-9 DVDD_T6 Rail Pwr (out1)" + label power3 "PMIC-9 DVDD_T7 Rail Pwr (out2)" + label curr1 "PMIC-9 13V5 DVDD_T6 DVDD_T7 Rail Curr (in1)" + label curr2 "PMIC-9 DVDD_T6 Rail Curr (out1)" + label curr3 "PMIC-9 DVDD_T7 Rail Curr (out2)" + ignore curr4 + ignore curr5 + ignore curr6 +chip "xdpe1a2g7-i2c-*-6a" + label in1 "PMIC-9 PSU 13V5 Rail (in1)" + label in2 "PMIC-9 DVDD_T6 ADJ Rail (out1)" + label in3 "PMIC-9 DVDD_T7 ADJ Rail (out2)" + label temp1 "PMIC-9 DVDD_T6 ADJ Temp 1" + label temp2 "PMIC-9 DVDD_T7 ADJ Temp 2" + label power1 "PMIC-9 13V5 DVDD_T6 DVDD_T7 (in)" + label power2 "PMIC-9 DVDD_T6 Rail Pwr (out1)" + label power3 "PMIC-9 DVDD_T7 Rail Pwr (out2)" + label curr1 "PMIC-9 13V5 DVDD_T6 DVDD_T7 Rail Curr (in1)" + label curr2 "PMIC-9 DVDD_T6 Rail Curr (out1)" + label curr3 "PMIC-9 DVDD_T7 Rail Curr (out2)" + ignore curr4 + ignore curr5 + ignore curr6 + +chip "mp2891-i2c-*-6c" + label in1 "PMIC-10 PSU 13V5 Rail (in1)" + label in2 "PMIC-10 HVDD_T03 1V2 Rail (out1)" + label in3 "PMIC-10 HVDD_T47 1V2 Rail (out2)" + label temp1 "PMIC-10 HVDD_T03 1V2 Temp 1" + label temp2 "PMIC-10 HVDD_T47 1V2 Temp 2" + label power1 "PMIC-10 13V5 HVDD_T03 HVDD_T47 (in)" + label power2 "PMIC-10 HVDD_T03 Rail Pwr (out1)" + label power3 "PMIC-10 HVDD_T47 Rail Pwr (out2)" + label curr1 "PMIC-10 13V5 HVDD_T03 HVDD_T47 Rail Curr (in1)" + label curr2 "PMIC-10 HVDD_T03 Rail Curr (out1)" + label curr3 "PMIC-10 HVDD_T47 Rail Curr (out2)" + ignore curr4 + ignore curr5 + ignore curr6 + ignore curr7 + ignore curr8 + ignore curr9 + ignore curr10 + ignore curr11 +chip "xdpe1a2g7-i2c-*-6c" + label in1 "PMIC-10 PSU 13V5 Rail (in1)" + label in2 "PMIC-10 HVDD_T03 1V2 Rail (out1)" + label in3 "PMIC-10 HVDD_T47 1V2 Rail (out2)" + label temp1 "PMIC-10 HVDD_T03 1V2 Temp 1" + label temp2 "PMIC-10 HVDD_T47 1V2 Temp 2" + label power1 "PMIC-10 13V5 HVDD_T03 HVDD_T47 (in)" + label power2 "PMIC-10 HVDD_T03 Rail Pwr (out1)" + label power3 "PMIC-10 HVDD_T47 Rail Pwr (out2)" + label curr1 "PMIC-10 13V5 HVDD_T03 HVDD_T47 Rail Curr (in1)" + label curr2 "PMIC-10 HVDD_T03 Rail Curr (out1)" + label curr3 "PMIC-10 HVDD_T47 Rail Curr (out2)" + ignore curr4 + ignore curr5 + ignore curr6 + ignore curr7 + ignore curr8 + ignore curr9 + ignore curr10 + ignore curr11 + +chip "mp2891-i2c-*-6e" + label in1 "PMIC-11 PSU 13V5 Rail (in1)" + label in2 "PMIC-11 VDDSCC 0V75 Rail (out1)" + label in3 "PMIC-11 DVDD_M ADJ Rail (out2)" + label temp1 "PMIC-11 VDDSCC 1V2 Temp 1" + label temp2 "PMIC-11 DVDD_M 0V75 Temp 2" + label power1 "PMIC-11 13V5 VDDSCC DVDD_M (in)" + label power2 "PMIC-11 VDDSCC Rail Pwr (out1)" + label power3 "PMIC-11 DVDD_M Rail Pwr (out2)" + label curr1 "PMIC-11 13V5 VDDSCC DVDD_M Rail Curr (in1)" + label curr2 "PMIC-11 VDDSCC Rail Curr (out1)" + label curr3 "PMIC-11 DVDD_M Rail Curr (out2)" + ignore curr4 + ignore curr5 + ignore curr6 +chip "xdpe1a2g7-i2c-*-6e" + label in1 "PMIC-11 PSU 13V5 Rail (in1)" + label in2 "PMIC-11 VDDSCC 0V75 Rail (out1)" + label in3 "PMIC-11 DVDD_M ADJ Rail (out2)" + label temp1 "PMIC-11 VDDSCC 1V2 Temp 1" + label temp2 "PMIC-11 DVDD_M 0V75 Temp 2" + label power1 "PMIC-11 13V5 VDDSCC DVDD_M (in)" + label power2 "PMIC-11 VDDSCC Rail Pwr (out1)" + label power3 "PMIC-11 DVDD_M Rail Pwr (out2)" + label curr1 "PMIC-11 13V5 VDDSCC DVDD_M Rail Curr (in1)" + label curr2 "PMIC-11 VDDSCC Rail Curr (out1)" + label curr3 "PMIC-11 DVDD_M Rail Curr (out2)" + ignore curr4 + ignore curr5 + ignore curr6 + +# Power supplies +chip "dps460-i2c-*-59" + label in1 "PSU-1(L) 220V Rail (in)" + ignore in2 + label in3 "PSU-1(L) 54V Rail (out)" + ignore fan2 + ignore fan3 + label fan1 "PSU-1(L) Fan 1" + label temp1 "PSU-1(L) Temp 1" + label temp2 "PSU-1(L) Temp 2" + label temp3 "PSU-1(L) Temp 3" + label power1 "PSU-1(L) 220V Rail Pwr (in)" + label power2 "PSU-1(L) 54V Rail Pwr (out)" + label curr1 "PSU-1(L) 220V Rail Curr (in)" + label curr2 "PSU-1(L) 54V Rail Curr (out)" + set power2_cap 0 +chip "dps460-i2c-*-58" + label in1 "PSU-2(R) 220V Rail (in)" + ignore in2 + label in3 "PSU-2(R) 54V Rail (out)" + ignore fan2 + ignore fan3 + label fan1 "PSU-2(R) Fan 1" + label temp1 "PSU-2(R) Temp 1" + label temp2 "PSU-2(R) Temp 2" + label temp3 "PSU-2(R) Temp 3" + label power1 "PSU-2(R) 220V Rail Pwr (in)" + label power2 "PSU-2(R) 54V Rail Pwr (out)" + label curr1 "PSU-2(R) 220V Rail Curr (in)" + label curr2 "PSU-2(R) 54V Rail Curr (out)" + set power2_cap 0 +chip "dps460-i2c-*-5b" + label in1 "PSU-3(R) 220V Rail (in)" + ignore in2 + label in3 "PSU-3(R) 54V Rail (out)" + ignore fan2 + ignore fan3 + label fan1 "PSU-3(R) Fan 1" + label temp1 "PSU-3(R) Temp 1" + label temp2 "PSU-3(R) Temp 2" + label temp3 "PSU-3(R) Temp 3" + label power1 "PSU-3(R) 220V Rail Pwr (in)" + label power2 "PSU-3(R) 54V Rail Pwr (out)" + label curr1 "PSU-3(R) 220V Rail Curr (in)" + label curr2 "PSU-3(R) 54V Rail Curr (out)" + set power2_cap 0 +chip "dps460-i2c-*-5a" + label in1 "PSU-4(R) 220V Rail (in)" + ignore in2 + label in3 "PSU-4(R) 54V Rail (out)" + ignore fan2 + ignore fan3 + label fan1 "PSU-4(R) Fan 1" + label temp1 "PSU-4(R) Temp 1" + label temp2 "PSU-4(R) Temp 2" + label temp3 "PSU-4(R) Temp 3" + label power1 "PSU-4(R) 220V Rail Pwr (in)" + label power2 "PSU-4(R) 54V Rail Pwr (out)" + label curr1 "PSU-4(R) 220V Rail Curr (in)" + label curr2 "PSU-4(R) 54V Rail Curr (out)" + set power2_cap 0 + +# AMD Comex +bus "i2c-68" "i2c-9-mux (chan_id 6)" + chip "mp2855-i2c-*-69" + label in1 "PMIC-12 COMEX (in) VDDCR INPUT VOLT" + label in2 "PMIC-12 COMEX (out) VDDCR_CPU VOLT" + label in3 "PMIC-12 COMEX (out2) VDDCR_SOC VOLT" + label temp1 "PMIC-12 COMEX VDDCR_CPU PHASE TEMP" + label temp2 "PMIC-12 COMEX VDDCR_SOC PHASE TEMP" + label curr1 "PMIC-12 COMEX VDDCR_CPU CURR" + label curr2 "PMIC-12 COMEX VDDCR_SOC CURR" + +bus "i2c-69" "i2c-9-mux (chan_id 6)" + chip "mp2975-i2c-*-6a" + label in1 "PMIC-13 COMEX VDD_MEM INPUT VOLT" + label in2 "PMIC-13 COMEX VDD_MEM OUTPUT VOLT" + label temp1 "PMIC-13 COMEX VDD_MEM PHASE TEMP" + label curr1 "PMIC-13 COMEX VDD_MEM INPUT CURR" + label curr2 "PMIC-13 COMEX VDD_MEM OUTPUT CURR" + ignore curr3 + ignore curr4 + label power1 "PMIC-13 COMEX VDD_MEM INPUT POWER" + label power2 "PMIC-13 COMEX VDD_MEM OUTPUT POWER" + +#bus "i2c-0" "Synopsys DesignWare I2C adapter" +chip "jc42-i2c-*-1a" + label temp1 "SODIMM1 Temp" + +chip "jc42-i2c-*-1b" + label temp1 "SODIMM2 Temp" + +chip "jc42-i2c-*-1e" + label temp1 "SODIMM3 Temp" + +chip "jc42-i2c-*-1f" + label temp1 "SODIMM4 Temp" + +chip "k10temp-pci-*" + label temp1 "CPU PACKAGE TEMP" + label temp2 "CPU DIE0 TEMP" + +chip "nvme-pci-*" + label temp1 "SSD Temp" + ignore temp2 + ignore temp3 + +chip "00000500400-mdio-5" + label temp1 "PHY TEMP" From 9e64ebe9d0a6777ce6898f75235e19286568524d Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Wed, 4 Dec 2024 00:55:50 +0800 Subject: [PATCH 2/3] [Mellanox] [SFP API] Add support to the get_error_description function for when CMIS cable host management is enabled. (#20964) - Why I did it get_error_description is not supported when CMIS cable host mgmt. enabled, now enable this function and use the community common implementation. - How I did it When CMIS cable host mgmt. enabled, call the common platform API. Keep using original implementation in FW control mode. - How to verify it Test this API on different platforms in different modes. Run SFP related sonic-mgmt test cases Signed-off-by: Kebo Liu --- platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py | 6 ++++-- platform/mellanox/mlnx-platform-api/tests/test_sfp.py | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py index aa3e188ae5f7..0e76f947b839 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py @@ -1,5 +1,6 @@ # -# Copyright (c) 2019-2024 NVIDIA CORPORATION & AFFILIATES. +# SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES +# Copyright (c) 2019-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -675,7 +676,8 @@ def get_error_description(self): """ try: if self.is_sw_control(): - return 'Not supported' + api = self.get_xcvr_api() + return api.get_error_description() if api else None except: return self.SFP_STATUS_INITIALIZING diff --git a/platform/mellanox/mlnx-platform-api/tests/test_sfp.py b/platform/mellanox/mlnx-platform-api/tests/test_sfp.py index 092179f03fff..fecfadc1d93c 100644 --- a/platform/mellanox/mlnx-platform-api/tests/test_sfp.py +++ b/platform/mellanox/mlnx-platform-api/tests/test_sfp.py @@ -1,5 +1,6 @@ # -# Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. +# SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES +# Copyright (c) 2019-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -59,6 +60,7 @@ def test_sfp_index(self, mock_max_port): @mock.patch('sonic_platform.sfp.SFP._get_module_info') @mock.patch('sonic_platform.chassis.Chassis.get_num_sfps', mock.MagicMock(return_value=2)) @mock.patch('sonic_platform.chassis.extract_RJ45_ports_index', mock.MagicMock(return_value=[])) + @mock.patch('sonic_platform.sfp.SFP.get_xcvr_api', mock.MagicMock(return_value=None)) def test_sfp_get_error_status(self, mock_get_error_code, mock_control): sfp = SFP(1) mock_control.return_value = False @@ -87,7 +89,7 @@ def test_sfp_get_error_status(self, mock_get_error_code, mock_control): mock_control.return_value = True description = sfp.get_error_description() - assert description == 'Not supported' + assert description == None mock_control.side_effect = RuntimeError('') description = sfp.get_error_description() From e108423c4673fe588e909d546171a23ad1278c49 Mon Sep 17 00:00:00 2001 From: Arham-Nasir <100487254+Arham-Nasir@users.noreply.github.com> Date: Wed, 4 Dec 2024 00:17:38 +0500 Subject: [PATCH 3/3] Add YANG Model and Configuration Support for Memory Statistics (#20354) This PR introduces a new YANG model for configuring memory statistics in SONiC, along with necessary updates to the configuration database and test cases. The following changes have been made: YANG Model: Created a new YANG module sonic-memory-statistics.yang for managing memory statistics configuration parameters, including: enabled: Boolean flag to enable or disable memory statistics collection. sampling_interval: Configurable time interval for sampling memory statistics. retention_period: Configurable retention period for memory statistics data. Configuration Database: Updated sample_config_db.json to include default values for the memory statistics configuration, ensuring seamless integration with the existing configuration management. Test Cases: Added comprehensive test cases in memory_statistics.json to validate the configuration parameters, including valid configurations and error scenarios for invalid sampling intervals and retention periods. These changes aim to enhance the monitoring capabilities of SONiC by providing a structured way to configure memory statistics, thereby improving overall system performance and resource management. --- src/sonic-yang-models/doc/Configuration.md | 20 ++++++++ src/sonic-yang-models/setup.py | 2 + .../tests/files/sample_config_db.json | 7 +++ .../tests/memory_statistics.json | 18 +++++++ .../tests_config/memory_statistics.json | 47 +++++++++++++++++++ .../yang-models/sonic-memory-statistics.yang | 47 +++++++++++++++++++ 6 files changed, 141 insertions(+) create mode 100644 src/sonic-yang-models/tests/yang_model_tests/tests/memory_statistics.json create mode 100644 src/sonic-yang-models/tests/yang_model_tests/tests_config/memory_statistics.json create mode 100644 src/sonic-yang-models/yang-models/sonic-memory-statistics.yang diff --git a/src/sonic-yang-models/doc/Configuration.md b/src/sonic-yang-models/doc/Configuration.md index 1f45b32a3e83..60a4222721f0 100644 --- a/src/sonic-yang-models/doc/Configuration.md +++ b/src/sonic-yang-models/doc/Configuration.md @@ -50,6 +50,7 @@ Table of Contents * [L2 Neighbors](#l2-neighbors) * [Loopback Interface](#loopback-interface) * [LOSSLESS_TRAFFIC_PATTERN](#LOSSLESS_TRAFFIC_PATTERN) + * [Memory Statistics](#memory-statistics) * [Management Interface](#management-interface) * [Management port](#management-port) * [Management VRF](#management-vrf) @@ -1482,6 +1483,25 @@ lossless traffic for dynamic buffer calculation } ``` +### Memory Statistics +The memory statistics configuration is stored in the **MEMORY_STATISTICS** table. This table is used by the memory statistics daemon to manage memory monitoring settings. The configuration allows enabling or disabling memory collection, specifying how frequently memory statistics are sampled, and defining how long the memory data is retained. + +``` +{ + "MEMORY_STATISTICS": { + "memory_statistics": { + "enabled": "false", + "sampling_interval": "5", + "retention_period": "15" + } + } +} + +``` +- **enabled**: Defines whether the memory statistics collection is active (true or false). +- **sampling_interval**: Interval between data collection. +- **retention_period**: Time to retain collected data. + ### Management Interface Management interfaces are defined in **MGMT_INTERFACE** table. Object diff --git a/src/sonic-yang-models/setup.py b/src/sonic-yang-models/setup.py index 04b652208ec7..60dba6c410aa 100644 --- a/src/sonic-yang-models/setup.py +++ b/src/sonic-yang-models/setup.py @@ -137,6 +137,7 @@ def run(self): './yang-models/sonic-kubernetes_master.yang', './yang-models/sonic-loopback-interface.yang', './yang-models/sonic-lossless-traffic-pattern.yang', + './yang-models/sonic-memory-statistics.yang', './yang-models/sonic-mgmt_interface.yang', './yang-models/sonic-mgmt_port.yang', './yang-models/sonic-mgmt_vrf.yang', @@ -242,6 +243,7 @@ def run(self): './cvlyang-models/sonic-kubernetes_master.yang', './cvlyang-models/sonic-loopback-interface.yang', './cvlyang-models/sonic-mgmt_interface.yang', + './cvlyang-models/sonic-memory-statistics.yang', './cvlyang-models/sonic-mgmt_port.yang', './cvlyang-models/sonic-mgmt_vrf.yang', './cvlyang-models/sonic-ntp.yang', diff --git a/src/sonic-yang-models/tests/files/sample_config_db.json b/src/sonic-yang-models/tests/files/sample_config_db.json index 5d22bc3f81cc..4c76237ddb46 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -2782,6 +2782,13 @@ "motd": "Some message of the day", "logout": "Some logout message" } + }, + "MEMORY_STATISTICS": { + "memory_statistics": { + "enabled": "false", + "sampling_interval": "5", + "retention_period": "15" + } } }, "SAMPLE_CONFIG_DB_UNKNOWN": { diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/memory_statistics.json b/src/sonic-yang-models/tests/yang_model_tests/tests/memory_statistics.json new file mode 100644 index 000000000000..e466e9cf92c6 --- /dev/null +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/memory_statistics.json @@ -0,0 +1,18 @@ +{ + "MEMORY_STATISTICS_VALID_CONFIG": { + "desc": "Configuring memory statistics with valid values." + }, + "MEMORY_STATISTICS_WITH_INVALID_SAMPLING_INTERVAL": { + "desc": "Configuring memory statistics with an invalid sampling_interval ( out of acceptable range).", + "eStrKey": "Range", + "eStr": "3..15" + }, + "MEMORY_STATISTICS_WITH_INVALID_RETENTION_PERIOD": { + "desc": "Configuring memory statistics with an invalid retention_period (out of acceptable range).", + "eStrKey": "Range", + "eStr": "1..30" + }, + "MEMORY_STATISTICS_WITH_ENABLE_FEATURE": { + "desc": "Enabling memory statistics feature with valid values." + } +} \ No newline at end of file diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/memory_statistics.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/memory_statistics.json new file mode 100644 index 000000000000..22529187c958 --- /dev/null +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/memory_statistics.json @@ -0,0 +1,47 @@ +{ + "MEMORY_STATISTICS_VALID_CONFIG": { + "sonic-memory-statistics:sonic-memory-statistics": { + "sonic-memory-statistics:MEMORY_STATISTICS": { + "memory_statistics":{ + "enabled": "false", + "sampling_interval": "5", + "retention_period": "15" + } + } + } + }, + "MEMORY_STATISTICS_WITH_INVALID_SAMPLING_INTERVAL": { + "sonic-memory-statistics:sonic-memory-statistics": { + "sonic-memory-statistics:MEMORY_STATISTICS": { + "memory_statistics":{ + "enabled": "true", + "sampling_interval": "45", + "retention_period": "20" + } + } + } + }, + "MEMORY_STATISTICS_WITH_INVALID_RETENTION_PERIOD": { + "sonic-memory-statistics:sonic-memory-statistics": { + "sonic-memory-statistics:MEMORY_STATISTICS": { + "memory_statistics":{ + "enabled": "true", + "sampling_interval": "5", + "retention_period": "45" + } + } + } + }, + "MEMORY_STATISTICS_WITH_ENABLE_FEATURE": { + "sonic-memory-statistics:sonic-memory-statistics": { + "sonic-memory-statistics:MEMORY_STATISTICS": { + "memory_statistics":{ + "enabled": "true", + "sampling_interval": "5", + "retention_period": "30" + } + } + } + } + +} \ No newline at end of file diff --git a/src/sonic-yang-models/yang-models/sonic-memory-statistics.yang b/src/sonic-yang-models/yang-models/sonic-memory-statistics.yang new file mode 100644 index 000000000000..f69344db53b5 --- /dev/null +++ b/src/sonic-yang-models/yang-models/sonic-memory-statistics.yang @@ -0,0 +1,47 @@ +module sonic-memory-statistics { + yang-version 1.1; + + namespace "http://github.com/sonic-net/sonic-memory-statistics"; + prefix memstats; + + import sonic-types { + prefix stypes; + } + + description "YANG module for configuring memory statistics in SONiC-based OS."; + + revision 2024-07-22 { + description "First Revision"; + } + + container sonic-memory-statistics { + container MEMORY_STATISTICS { + description "Memory statistics configuration parameters."; + container memory_statistics{ + leaf enabled { + type boolean; + default false; + description "Flag to enable or disable memory statistics collection. If set to false, the memory statistics collection will stop."; + } + + leaf sampling_interval { + type uint8 { + range "3..15"; + } + units "minutes"; + default 5; + description "Time interval in minutes for sampling memory statistics. Valid range, is between 3 minutes to 30 minutes."; + } + + leaf retention_period { + type uint8 { + range "1..30"; + } + units "days"; + default 15; + description "Retention period for memory statistics data, defined in days. Valid range is from 1 day to 30 days."; + } + } + } + } +} \ No newline at end of file