Skip to content

Commit

Permalink
Fix Innovium build for SONIC 202211 (sonic-net#17613)
Browse files Browse the repository at this point in the history
* Add platform files for Marvell Innovium platform

Add platform files for critical processes and default
qos config for Innovium platforms

* Fix Marvell innovium build for SONiC202211

* Add debug shell packages for Marvell Innovium platforms
  • Loading branch information
Keshavg-marvell authored Aug 8, 2024
1 parent d264b5e commit 2ca494d
Show file tree
Hide file tree
Showing 9 changed files with 70 additions and 23 deletions.
3 changes: 2 additions & 1 deletion platform/innovium/docker-syncd-invm-rpc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

DOCKER_SYNCD_INVM_RPC = docker-syncd-invm-rpc.gz
$(DOCKER_SYNCD_INVM_RPC)_PATH = $(PLATFORM_PATH)/docker-syncd-invm-rpc
$(DOCKER_SYNCD_INVM_RPC)_DEPENDS += $(SYNCD_RPC) $(LIBTHRIFT) $(INVM_LIBSAI) $(PTF)
$(DOCKER_SYNCD_INVM_RPC)_DEPENDS += $(SYNCD_RPC) $(LIBTHRIFT) $(INVM_LIBSAI) $(PTF) $(INVM_SHELL)
$(DOCKER_SYNCD_INVM_RPC)_FILES += $(SUPERVISOR_PROC_EXIT_LISTENER_SCRIPT)
$(DOCKER_SYNCD_INVM_RPC)_LOAD_DOCKERS += $(DOCKER_SYNCD_BASE)
SONIC_DOCKER_IMAGES += $(DOCKER_SYNCD_INVM_RPC)
ifeq ($(ENABLE_SYNCD_RPC),y)
Expand Down
18 changes: 8 additions & 10 deletions platform/innovium/docker-syncd-invm-rpc/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,25 @@ debs/{{ deb }}{{' '}}
{%- endfor -%}
debs/

RUN dpkg -P syncd
RUN apt-get purge -y syncd

## Pre-install the fundamental packages
RUN apt-get update \
&& apt-get -y install \
net-tools \
python-pip \
python3-pip \
python-setuptools \
build-essential \
libssl-dev \
libffi-dev \
python-dev \
libpython2.7 \
libjansson4 \
libyaml-dev \
wget \
cmake \
libqt5core5a \
libqt5network5 \
libboost-atomic1.71.0
libboost-atomic1.74.0

RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; } ; \
{% for deb in docker_syncd_invm_rpc_debs.split(' ') -%}
Expand All @@ -43,12 +44,9 @@ RUN wget https://github.com/nanomsg/nanomsg/archive/1.0.0.tar.gz \
&& cd .. \
&& rm -fr nanomsg-1.0.0 \
&& rm -f 1.0.0.tar.gz \
&& pip install cffi==1.7.0 \
&& pip install --upgrade cffi==1.7.0 \
&& pip install nnpy \
&& pip install numpy \
&& pip install scipy \
&& pip install setuptools \
&& pip3 install numpy \
&& pip3 install scipy \
&& pip3 install setuptools \
&& mkdir -p /opt \
&& cd /opt \
&& wget https://raw.githubusercontent.com/p4lang/ptf/master/ptf_nn/ptf_nn_agent.py \
Expand Down
8 changes: 3 additions & 5 deletions platform/innovium/docker-syncd-invm.mk
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
# docker image for innovium syncd

DOCKER_SYNCD_PLATFORM_CODE = invm
include $(PLATFORM_PATH)/../template/docker-syncd-base.mk
include $(PLATFORM_PATH)/../template/docker-syncd-bullseye.mk

$(DOCKER_SYNCD_BASE)_DEPENDS += $(SYNCD) $(PYTHON_SDK_API) $(INVM_LIBSAI)
$(DOCKER_SYNCD_BASE)_DEPENDS += $(SYNCD) $(PYTHON_SDK_API) $(INVM_LIBSAI) $(INVM_SHELL)

$(DOCKER_SYNCD_BASE)_DBG_DEPENDS += $(SYNCD_DBG) \
$(LIBSWSSCOMMON_DBG) \
$(LIBSAIMETADATA_DBG) \
$(LIBSAIREDIS_DBG)

SONIC_STRETCH_DOCKERS += $(DOCKER_SYNCD_BASE)
SONIC_STRETCH_DBG_DOCKERS += $(DOCKER_SYNCD_BASE_DBG)

$(DOCKER_SYNCD_BASE)_VERSION = 1.0.0
$(DOCKER_SYNCD_BASE)_PACKAGE_NAME = syncd
$(DOCKER_SYNCD_BASE)_MACHINE = innovium

$(DOCKER_SYNCD_BASE)_RUN_OPT += -v /host/warmboot:/var/warmboot
6 changes: 4 additions & 2 deletions platform/innovium/docker-syncd-invm/Dockerfile.j2
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM docker-config-engine-stretch-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}
{% from "dockers/dockerfile-macros.j2" import install_debian_packages %}
FROM docker-config-engine-bullseye-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}}

ARG docker_container_name

Expand All @@ -15,8 +16,9 @@ debs/

# Needed for Innovium Debug Shell
RUN apt-get install -y net-tools
RUN apt-get install -y libpython2.7
RUN apt-get install -y libjansson4
RUN apt-get install -y libyaml-dev
RUN pip3 install numpy

RUN dpkg -i \
{% for deb in docker_syncd_invm_debs.split(' ') -%}
Expand Down
1 change: 1 addition & 0 deletions platform/innovium/docker-syncd-invm/critical_processes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
program:syncd
39 changes: 39 additions & 0 deletions platform/innovium/docker-syncd-invm/ivm_start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/usr/bin/env bash

TOPO_CONF=/usr/share/sonic/platform/topo.conf
if [ -f ${TOPO_CONF} ]; then
topo=`cat ${TOPO_CONF}`
else
topo="none"
fi

if [ ${topo} != "none" ]; then
BUFFER_CONFIG=/usr/share/sonic/hwsku/buffers_defaults_${topo}.j2
QOS_CONFIG=/usr/share/sonic/hwsku/qos_defaults_${topo}.j2

if [ "$(/usr/local/bin/sonic-cfggen -d -v TC_TO_PRIORITY_GROUP_MAP)" ] || \
[ "$(/usr/local/bin/sonic-cfggen -d -v MAP_PFC_PRIORITY_TO_QUEUE)" ] || \
[ "$(/usr/local/bin/sonic-cfggen -d -v TC_TO_QUEUE_MAP)" ] || \
[ "$(/usr/local/bin/sonic-cfggen -d -v DSCP_TO_TC_MAP)" ] || \
[ "$(/usr/local/bin/sonic-cfggen -d -v SCHEDULER)" ] || \
[ "$(/usr/local/bin/sonic-cfggen -d -v PFC_PRIORITY_TO_PRIORITY_GROUP_MAP)" ] || \
[ "$(/usr/local/bin/sonic-cfggen -d -v PORT_QOS_MAP)" ] || \
[ "$(/usr/local/bin/sonic-cfggen -d -v WRED_PROFILE)" ] || \
[ "$(/usr/local/bin/sonic-cfggen -d -v QUEUE)" ] || \
[ "$(/usr/local/bin/sonic-cfggen -d -v CABLE_LENGTH)" ] || \
[ "$(/usr/local/bin/sonic-cfggen -d -v BUFFER_POOL)" ] || \
[ "$(/usr/local/bin/sonic-cfggen -d -v BUFFER_PROFILE)" ] || \
[ "$(/usr/local/bin/sonic-cfggen -d -v BUFFER_PG)" ] || \
[ "$(/usr/local/bin/sonic-cfggen -d -v BUFFER_QUEUE)" ]; then
echo "Database has QoS settings, skip loading defaults"
elif [ -f "$BUFFER_CONFIG" ] && [ -f "$QOS_CONFIG" ]; then
/usr/local/bin/sonic-cfggen -d -t $BUFFER_CONFIG >/tmp/buffers.json
/usr/local/bin/sonic-cfggen -d -t $QOS_CONFIG -y /etc/sonic/sonic_version.yml >/tmp/qos.json
/usr/local/bin/sonic-cfggen -j /tmp/buffers.json --write-to-db
/usr/local/bin/sonic-cfggen -j /tmp/qos.json --write-to-db
else
echo "File not found (${BUFFER_CONFIG} and/or ${QOS_CONFIG})"
fi
else
echo "Skip QoS config"
fi
6 changes: 6 additions & 0 deletions platform/innovium/docker-syncd-invm/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

if [ -f /usr/bin/ivm_start.sh ];
then
/usr/bin/ivm_start.sh
fi
6 changes: 4 additions & 2 deletions platform/innovium/invm-sai.mk
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
# INVM SAI

INVM_SAI_ONLINE = https://github.com/Innovium/SONiC/raw/master/debian/master
INVM_SAI_ONLINE = https://github.com/Innovium/SONiC/raw/master/debian/202211

INVM_LIBSAI = isai.deb
INVM_HSAI = saihdr.deb
INVM_DRV = ipd.deb
INVM_SHELL = ishell.deb

$(INVM_LIBSAI)_URL = $(INVM_SAI_ONLINE)/$(INVM_LIBSAI)
$(INVM_HSAI)_URL = $(INVM_SAI_ONLINE)/$(INVM_HSAI)
$(INVM_DRV)_URL = $(INVM_SAI_ONLINE)/$(INVM_DRV)
$(INVM_SHELL)_URL = $(INVM_SAI_ONLINE)/$(INVM_SHELL)

$(eval $(call add_conflict_package,$(INVM_HSAI),$(LIBSAIVS_DEV)))

SONIC_ONLINE_DEBS += $(INVM_LIBSAI) $(INVM_HSAI) $(INVM_DRV)
SONIC_ONLINE_DEBS += $(INVM_LIBSAI) $(INVM_HSAI) $(INVM_DRV) $(INVM_SHELL)
6 changes: 3 additions & 3 deletions platform/innovium/rules.mk
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
include $(PLATFORM_PATH)/invm-sai.mk
include $(PLATFORM_PATH)/platform-modules-cel.mk
include $(PLATFORM_PATH)/platform-modules-delta.mk
#include $(PLATFORM_PATH)/platform-modules-delta.mk
include $(PLATFORM_PATH)/platform-modules-wistron.mk
include $(PLATFORM_PATH)/platform-modules-netberg.mk
#include $(PLATFORM_PATH)/platform-modules-netberg.mk
include $(PLATFORM_PATH)/docker-syncd-invm.mk
include $(PLATFORM_PATH)/docker-syncd-invm-rpc.mk
include $(PLATFORM_PATH)/one-image.mk
Expand All @@ -15,7 +15,7 @@ SONIC_ALL += $(SONIC_INVM_ONE_IMAGE) \
$(DOCKER_SYNCD_INVM_RPC)

# Inject invm sai into syncd
$(SYNCD)_DEPENDS += $(INVM_HSAI) $(INVM_LIBSAI) $(LIBSAITHRIFT_DEV_INVM)
$(SYNCD)_DEPENDS += $(INVM_HSAI) $(INVM_LIBSAI) $(LIBSAITHRIFT_DEV_INVM) $(INVM_SHELL)
$(SYNCD)_UNINSTALLS += $(INVM_HSAI)

# Runtime dependency on invm sai is set only for syncd
Expand Down

0 comments on commit 2ca494d

Please sign in to comment.