-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add pensando platform #15978
Add pensando platform #15978
Changes from all commits
31f5822
f32fc26
7190c62
4e8ee73
9c67332
e43b1fb
23ce5f4
986c566
1ace1b4
4c19e51
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# name lanes alias speed autoneg fec | ||
Ethernet1 0,1,2,3 Ethernet1 100000 on rs | ||
Ethernet2 4,5,6,7 Ethernet2 100000 on rs |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Pensando-elba t1 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pensando |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
# | ||
# ssd_generic.py | ||
# | ||
# Generic implementation of the SSD health API | ||
# SSD models supported: | ||
# - InnoDisk | ||
# - StorFly | ||
# - Virtium | ||
|
||
try: | ||
import re | ||
import subprocess | ||
from sonic_platform_base.sonic_ssd.ssd_base import SsdBase | ||
except ImportError as e: | ||
raise ImportError (str(e) + "- required module not found") | ||
|
||
NOT_AVAILABLE = "N/A" | ||
MMC_DATA_PATH = "/sys/class/mmc_host/mmc0/mmc0:0001/{}" | ||
|
||
class SsdUtil(SsdBase): | ||
""" | ||
Generic implementation of the SSD health API | ||
""" | ||
model = NOT_AVAILABLE | ||
serial = NOT_AVAILABLE | ||
firmware = NOT_AVAILABLE | ||
temperature = NOT_AVAILABLE | ||
health = NOT_AVAILABLE | ||
ssd_info = NOT_AVAILABLE | ||
vendor_ssd_info = NOT_AVAILABLE | ||
|
||
def __init__(self, diskdev): | ||
|
||
self.dev = diskdev | ||
try: | ||
self.model = ("emmc {}".format(open(MMC_DATA_PATH.format("name")).read())).replace("\n", "") | ||
self.serial = open(MMC_DATA_PATH.format("serial")).read().replace("\n", "") | ||
self.firmware = open(MMC_DATA_PATH.format("fwrev")).read().replace("\n", "") | ||
value = open(MMC_DATA_PATH.format("life_time")).read().replace("\n", "") | ||
[lifetime_a, lifetime_b] = [int(val, 16) for val in value.split()] | ||
lifetime = lifetime_a if lifetime_a >= lifetime_b else lifetime_b | ||
self.health = float(100 - (lifetime*10)) | ||
Comment on lines
+32
to
+42
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
@shanshri - did this (above) get used per @prgeor 's request? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We will address these things in the when will enable pmon in upstream There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @shanshri noted |
||
except: | ||
pass | ||
|
||
def get_health(self): | ||
""" | ||
Retrieves current disk health in percentages | ||
|
||
Returns: | ||
A float number of current ssd health | ||
e.g. 83.5 | ||
""" | ||
return self.health | ||
|
||
def get_temperature(self): | ||
""" | ||
Retrieves current disk temperature in Celsius | ||
|
||
Returns: | ||
A float number of current temperature in Celsius | ||
e.g. 40.1 | ||
""" | ||
return self.temperature | ||
|
||
def get_model(self): | ||
""" | ||
Retrieves model for the given disk device | ||
|
||
Returns: | ||
A string holding disk model as provided by the manufacturer | ||
""" | ||
return self.model | ||
|
||
def get_firmware(self): | ||
""" | ||
Retrieves firmware version for the given disk device | ||
|
||
Returns: | ||
A string holding disk firmware version as provided by the manufacturer | ||
""" | ||
return self.firmware | ||
|
||
def get_serial(self): | ||
""" | ||
Retrieves serial number for the given disk device | ||
|
||
Returns: | ||
A string holding disk serial number as provided by the manufacturer | ||
""" | ||
return self.serial | ||
|
||
def get_vendor_output(self): | ||
""" | ||
Retrieves vendor specific data for the given disk device | ||
|
||
Returns: | ||
A string holding some vendor specific disk information | ||
""" | ||
return self.vendor_ssd_info |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"skip_thermalctld": true, | ||
"skip_fancontrol": true, | ||
"skip_ledd": true, | ||
"skip_psud": true, | ||
"skip_syseepromd": false, | ||
"skip_xcvrd": true, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i do not knw why we skip xcrvd and pcied There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is still work in progress and will be enabled later. |
||
"skip_chassis_db_init": false, | ||
"skip_pcied": true | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,6 +31,7 @@ IMAGE_DISTRO=$3 | |
set -x -e | ||
|
||
CONFIGURED_ARCH=$([ -f .arch ] && cat .arch || echo amd64) | ||
CONFIGURED_PLATFORM=$([ -f .platform ] && cat .platform || echo generic) | ||
|
||
. functions.sh | ||
BUILD_SCRIPTS_DIR=files/build_scripts | ||
|
@@ -762,6 +763,14 @@ sudo LANG=C DOCKER_HOST="$DOCKER_HOST" chroot $FILESYSTEM_ROOT docker tag {{imag | |
fi | ||
{% endfor %} | ||
|
||
if [[ $CONFIGURED_PLATFORM == pensando ]]; then | ||
#Disable rc.local | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why do we need to disable rc.local here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We are seeing multiple errors on console with rc.local enabled. Also we don't need most of the functionality done in that script. We will disable in this initial change and revisit this later. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We are seeing continuous error messages as below. So disabled it for now. It can be enabled later
|
||
sudo LANG=C chroot $FILESYSTEM_ROOT chmod -x /etc/rc.local | ||
sudo cp files/dsc/dpu.service $FILESYSTEM_ROOT_USR_LIB_SYSTEMD_SYSTEM/ | ||
sudo cp files/dsc/dpu.init $FILESYSTEM_ROOT/etc/init.d/dpu | ||
sudo LANG=C chroot $FILESYSTEM_ROOT systemctl enable dpu.service | ||
fi | ||
|
||
SONIC_PACKAGE_MANAGER_FOLDER="/var/lib/sonic-package-manager/" | ||
sudo mkdir -p $FILESYSTEM_ROOT/$SONIC_PACKAGE_MANAGER_FOLDER | ||
target_machine="$TARGET_MACHINE" j2 $BUILD_TEMPLATES/packages.json.j2 | sudo tee $FILESYSTEM_ROOT/$SONIC_PACKAGE_MANAGER_FOLDER/packages.json | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"metadata_version": 1, | ||
"package_version": 2, | ||
"asic_compat": "elba", | ||
"build_date": "{{ build_date }}", | ||
"build_user": "{{ build_user }}", | ||
"installer": { | ||
"name": "install_debian", | ||
"verify": { | ||
"algorithm": "sha512", | ||
"hash": "{{ installer_sha }}" | ||
} | ||
}, | ||
"shas": { | ||
"fs.zip": "{{ installer_payload_sha }}" | ||
}, | ||
"package_compat": { | ||
"board_policy": "accept" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
#!/bin/bash | ||
|
||
# {C} Copyright 2023 AMD Systems Inc. All rights reserved | ||
|
||
# This script starts/stops dpu sw | ||
|
||
|
||
### BEGIN INIT INFO | ||
# Provides: load-dpu | ||
# Required-Start: | ||
# Required-Stop: | ||
# Should-Start: | ||
# Should-Stop: | ||
# Default-Start: S | ||
# Default-Stop: 0 6 | ||
# Short-Description: Load dpu sw | ||
### END INIT INFO | ||
ACTIVE_FILE="/boot/active.txt" | ||
NIC_MOUNT="" | ||
LOG_FILE="/tmp/active_nic" | ||
TAG="latest" | ||
HOST_DIR=/host/dpu | ||
|
||
function start_dpu() | ||
{ | ||
modprobe ionic_mnic | ||
modprobe mnet_uio_pdrv_genirq | ||
modprobe mdev | ||
|
||
mkdir -p $HOST_DIR/update | ||
mkdir -p $HOST_DIR/sysconfig/config0 | ||
mkdir -p $HOST_DIR/sysconfig/config1 | ||
mkdir -p $HOST_DIR/obfl | ||
mkdir -p $HOST_DIR/data | ||
mkdir -p $HOST_DIR/tmpfsshare | ||
mkdir -p $HOST_DIR/runfs | ||
mkdir -p $HOST_DIR/logfs | ||
mount -t tmpfs -o size=20M,mode=1777 tmpfs $HOST_DIR/tmpfsshare | ||
mount -t tmpfs -o size=20M,mode=0755 runs $HOST_DIR/runfs | ||
mount -t tmpfs -o size=20M,mode=0755 logfs $HOST_DIR/logfs | ||
|
||
if [ -f "$ACTIVE_FILE" ]; then | ||
ACTIVE_CONTENTS=$(cat "$ACTIVE_FILE") | ||
ACTIVE_NIC=$(echo "$ACTIVE_CONTENTS" | cut -d " " -f 8-) | ||
if [ "$ACTIVE_NIC" = "/boot/nicA" ]; then | ||
NIC_MOUNT="-v /dev/shm:/dev/shm -v /boot/nicA/nic_core:/nic -v /boot/nicA/shared/conf/gen:/nic/conf/gen" | ||
elif [ "$ACTIVE_NIC" = "/boot/nicB" ]; then | ||
NIC_MOUNT="-v /dev/shm:/dev/shm -v /boot/nicB/nic_core:/nic -v /boot/nicB/shared/conf/gen:/nic/conf/gen" | ||
fi | ||
else | ||
echo "/boot/active.txt not present" > $LOG_FILE | ||
fi | ||
echo "Active Nic: $ACTIVE_NIC" >> $LOG_FILE | ||
echo "NIC_MOUNT: $NIC_MOUNT" >> $LOG_FILE | ||
|
||
docker ps -a --format "{{.ID}}\t{{.Image}}" | grep "docker-dpu:latest" | awk '{print $1}' | xargs -I {} docker rm {} | ||
|
||
docker run -v $HOST_DIR/update:/update -v $HOST_DIR/sysconfig/config0:/sysconfig/config0 -v $HOST_DIR/sysconfig/config1:/sysconfig/config1 -v $HOST_DIR/obfl:/obfl -v $HOST_DIR/data:/data -v $HOST_DIR/tmpfsshare:/tmp -v $HOST_DIR/runfs:/run -v $HOST_DIR/logfs:/var/log -v /sys:/sys $NIC_MOUNT --net=host --name=dpu --privileged docker-dpu:$TAG | ||
} | ||
|
||
case "$1" in | ||
start) | ||
echo -n "Start dpu... " | ||
|
||
start_dpu | ||
|
||
echo "done." | ||
;; | ||
|
||
stop) | ||
echo "Not supported" | ||
;; | ||
|
||
force-reload|restart) | ||
echo "Not supported" | ||
;; | ||
|
||
*) | ||
echo "Usage: /etc/init.d/dpu.init {start}" | ||
exit 1 | ||
;; | ||
esac | ||
|
||
exit 0 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@prgeor , can you check what else plugins are missing from platform side?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ashwin-h please add support for thermalctld, psud, pcied, system eeprom, chassis.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will enable all the plugins when we enable pmon functionality later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@prgeor has this been answered satisfactorily for you?