-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Mellanox][Smartswitch] Add no_wait option for dpu reboot and add pla…
…tform information parsing (#20943) - Why I did it Changes for dpuctlplat.py: 1. Added option to invoke systemctl rshim start/stop from the pmon container (Using dbus) 2. Added no_wait option for reboot (Since we do not need to wait for the dpu to be ready if NPU+DPU reboot is ongoing) 3. Added platform JSON parsing for rshim and pcie information - How I did it Changed dpuctlplat.py to support systemctl commands from pmon container using the dbus-send command
- Loading branch information
1 parent
335f40a
commit 3cc4c11
Showing
5 changed files
with
401 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
platform/mellanox/mlnx-platform-api/sonic_platform/dpu_vpd_parser.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# | ||
# SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES | ||
# Copyright (c) 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. | ||
# | ||
|
||
from .vpd_parser import VpdParser | ||
|
||
|
||
class DpuVpdParser(VpdParser): | ||
"""DPU Specific VPD parser""" | ||
def __init__(self, file_path, dpu_name): | ||
super(DpuVpdParser, self).__init__(file_path=file_path) | ||
self.dpu_name = dpu_name | ||
|
||
def get_dpu_data(self, key=None): | ||
"""Retrieves VPD Entry for DPU Specific Key""" | ||
return self.get_entry_value(f"{self.dpu_name}_{key}") | ||
|
||
def get_dpu_base_mac(self): | ||
"""Retrieves VPD Entry for DPU Specific Mac Address""" | ||
return self.get_dpu_data("BASE_MAC") | ||
|
||
def get_dpu_serial(self): | ||
"""Retrieves VPD Entry for DPU Specific Serial Number""" | ||
return self.get_dpu_data("SN") | ||
|
||
def get_dpu_revision(self): | ||
"""Retrieves VPD Entry for DPU Specific Revision""" | ||
return self.get_dpu_data("REV") | ||
|
||
def get_dpu_model(self): | ||
"""Retrieves VPD Entry for DPU Specific Model Number""" | ||
return self.get_dpu_data("PN") |
Oops, something went wrong.