ada7c6a72e
This commit adds support for pensando asic called ELBA. ELBA is used in pci based cards and in smartswitches. #### Why I did it This commit introduces pensando platform which is based on ELBA ASIC. ##### Work item tracking - Microsoft ADO **(number only)**: #### How I did it Created platform/pensando folder and created makefiles specific to pensando. This mainly creates pensando docker (which OEM's need to download before building an image) which has all the userspace to initialize and use the DPU (ELBA ASIC). Output of the build process creates two images which can be used from ONIE and goldfw. Recommendation is use to use ONIE. #### How to verify it Load the SONiC image via ONIE or goldfw and make sure the interfaces are UP. ##### Description for the changelog Add pensando platform support.
82 lines
2.7 KiB
Bash
Executable File
82 lines
2.7 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
SWSS_VARS_FILE=/usr/share/sonic/templates/swss_vars.j2
|
|
|
|
# Retrieve SWSS vars from sonic-cfggen
|
|
SWSS_VARS=$(sonic-cfggen -d -y /etc/sonic/sonic_version.yml -t $SWSS_VARS_FILE) || exit 1
|
|
export platform=$(echo $SWSS_VARS | jq -r '.asic_type')
|
|
export sub_platform=$(echo $SWSS_VARS | jq -r '.asic_subtype')
|
|
|
|
MAC_ADDRESS=$(echo $SWSS_VARS | jq -r '.mac')
|
|
if [ "$MAC_ADDRESS" == "None" ] || [ -z "$MAC_ADDRESS" ]; then
|
|
MAC_ADDRESS=$(ip link show eth0 | grep ether | awk '{print $2}')
|
|
logger "Mac address not found in Device Metadata, Falling back to eth0"
|
|
fi
|
|
|
|
# Create a folder for SwSS record files
|
|
mkdir -p /var/log/swss
|
|
ORCHAGENT_ARGS="-d /var/log/swss "
|
|
|
|
# Set orchagent pop batch size to 1024
|
|
ORCHAGENT_ARGS+="-b 1024 "
|
|
|
|
# Set synchronous mode if it is enabled in CONFIG_DB
|
|
SYNC_MODE=$(echo $SWSS_VARS | jq -r '.synchronous_mode')
|
|
if [ "$SYNC_MODE" == "enable" ]; then
|
|
ORCHAGENT_ARGS+="-s "
|
|
fi
|
|
|
|
# Check if there is an "asic_id field" in the DEVICE_METADATA in configDB.
|
|
#"DEVICE_METADATA": {
|
|
# "localhost": {
|
|
# ....
|
|
# "asic_id": "0",
|
|
# }
|
|
#},
|
|
# ID field could be integers just to denote the asic instance like 0,1,2...
|
|
# OR could be PCI device ID's which will be strings like "03:00.0"
|
|
# depending on what the SAI/SDK expects.
|
|
asic_id=$(echo $SWSS_VARS | jq -r '.asic_id')
|
|
if [ -n "$asic_id" ]
|
|
then
|
|
ORCHAGENT_ARGS+="-i $asic_id "
|
|
fi
|
|
|
|
# for multi asic platforms add the asic name to the record file names
|
|
if [[ "$NAMESPACE_ID" ]]; then
|
|
ORCHAGENT_ARGS+="-f swss.asic$NAMESPACE_ID.rec -j sairedis.asic$NAMESPACE_ID.rec "
|
|
fi
|
|
|
|
# Add platform specific arguments if necessary
|
|
if [ "$platform" == "broadcom" ]; then
|
|
ORCHAGENT_ARGS+="-m $MAC_ADDRESS"
|
|
elif [ "$platform" == "cavium" ]; then
|
|
ORCHAGENT_ARGS+="-m $MAC_ADDRESS"
|
|
elif [ "$platform" == "nephos" ]; then
|
|
ORCHAGENT_ARGS+="-m $MAC_ADDRESS"
|
|
elif [ "$platform" == "centec" ]; then
|
|
ORCHAGENT_ARGS+="-m $MAC_ADDRESS"
|
|
elif [ "$platform" == "barefoot" ]; then
|
|
ORCHAGENT_ARGS+="-m $MAC_ADDRESS"
|
|
elif [ "$platform" == "vs" ]; then
|
|
ORCHAGENT_ARGS+="-m $MAC_ADDRESS"
|
|
elif [ "$platform" == "mellanox" ]; then
|
|
ORCHAGENT_ARGS+=""
|
|
elif [ "$platform" == "innovium" ]; then
|
|
ORCHAGENT_ARGS+="-m $MAC_ADDRESS"
|
|
elif [ "$platform" == "pensando" ]; then
|
|
MAC_ADDRESS=$(ip link property add dev oob_mnic0 altname eth0; ip link show oob_mnic0 | grep ether | awk '{print $2}')
|
|
ORCHAGENT_ARGS+="-m $MAC_ADDRESS"
|
|
else
|
|
# Should we use the fallback MAC in case it is not found in Device.Metadata
|
|
ORCHAGENT_ARGS+="-m $MAC_ADDRESS"
|
|
fi
|
|
|
|
# Enable ZMQ for SmartSwitch
|
|
LOCALHOST_SUBTYPE=`sonic-db-cli CONFIG_DB hget localhost "subtype"`
|
|
if [[ x"${LOCALHOST_SUBTYPE}" == x"SmartSwitch" ]]; then
|
|
ORCHAGENT_ARGS+=" -q tcp://127.0.0.1:8100"
|
|
fi
|
|
|
|
exec /usr/bin/orchagent ${ORCHAGENT_ARGS}
|