forked from sonic-net/sonic-buildimage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New sonic-buildimage images for Broadcom DNX ASIC family. (sonic-net#…
…7598) Introduce new sonic-buildimage images for Broadcom DNX ASIC family. sonic-broadcom-dnx.bin sonic-aboot-broadcom-dnx.swi How I did it NO CHANGE to existing make commands make init; make configure PLATFORM=broadcom; make target/sonic-aboot-broadcom.swi; make target/sonic-broadcom.bin The difference now is that it will result in new broadcom images for DNX asic family as well. sonic-broadcom.bin, sonic-broadcom-dnx.bin sonic-aboot-broadcom.swi, sonic-aboot-broadcom-dnx.swi Note: This PR also adds support for Broadcom SAI 5.0 (based on 1.8 SAI ) for DNX based platform + changes in platform x86_64-arista_7280cr3_32p4 bcm config files and platform_env.conf files
- Loading branch information
1 parent
8b3fabe
commit 3ad830e
Showing
40 changed files
with
577 additions
and
47 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
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
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 @@ | ||
usemsi=1 |
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
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
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
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
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
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,10 @@ | ||
|
||
DPATH := $($(DOCKER_SYNCD_BRCM_DNX_RPC)_PATH) | ||
DEP_FILES := $(SONIC_COMMON_FILES_LIST) $(PLATFORM_PATH)/docker-syncd-brcm-dnx-rpc.mk $(PLATFORM_PATH)/docker-syncd-brcm-dnx-rpc.dep | ||
DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) | ||
DEP_FILES += $(shell git ls-files $(DPATH)) | ||
|
||
$(DOCKER_SYNCD_BRCM_DNX_RPC)_CACHE_MODE := GIT_CONTENT_SHA | ||
$(DOCKER_SYNCD_BRCM_DNX_RPC)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) | ||
$(DOCKER_SYNCD_BRCM_DNX_RPC)_DEP_FILES := $(DEP_FILES) | ||
|
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,31 @@ | ||
# docker image for brcm syncd with rpc | ||
|
||
DOCKER_SYNCD_BRCM_DNX_RPC = docker-syncd-brcm-dnx-rpc.gz | ||
DOCKER_SYNCD_DNX_BASE = docker-syncd-brcm-dnx.gz | ||
$(DOCKER_SYNCD_BRCM_DNX_RPC)_PATH = $(PLATFORM_PATH)/docker-syncd-brcm-dnx-rpc | ||
$(DOCKER_SYNCD_BRCM_DNX_RPC)_DEPENDS += $(SYNCD_RPC) $(LIBTHRIFT) $(PTF) | ||
ifeq ($(INSTALL_DEBUG_TOOLS), y) | ||
$(DOCKER_SYNCD_BRCM_DNX_RPC)_DEPENDS += $(SYNCD_RPC_DBG) \ | ||
$(LIBSWSSCOMMON_DBG) \ | ||
$(LIBSAIMETADATA_DBG) \ | ||
$(LIBSAIREDIS_DBG) | ||
endif | ||
$(DOCKER_SYNCD_BRCM_DNX_RPC)_FILES += $(DSSERVE) $(BCMCMD) $(SUPERVISOR_PROC_EXIT_LISTENER_SCRIPT) | ||
$(DOCKER_SYNCD_BRCM_DNX_RPC)_LOAD_DOCKERS += $(DOCKER_SYNCD_DNX_BASE) | ||
SONIC_DOCKER_IMAGES += $(DOCKER_SYNCD_BRCM_DNX_RPC) | ||
ifeq ($(ENABLE_SYNCD_RPC),y) | ||
SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_SYNCD_BRCM_DNX_RPC) | ||
endif | ||
|
||
$(DOCKER_SYNCD_BRCM_DNX_RPC)_CONTAINER_NAME = syncd | ||
$(DOCKER_SYNCD_BRCM_DNX_RPC)_VERSION = 1.0.0-rpc | ||
$(DOCKER_SYNCD_BRCM_DNX_RPC)_PACKAGE_NAME = syncd-dnx | ||
$(DOCKER_SYNCD_BRCM_DNX_RPC)_RUN_OPT += --privileged -t | ||
$(DOCKER_SYNCD_BRCM_DNX_RPC)_RUN_OPT += -v /host/machine.conf:/etc/machine.conf | ||
$(DOCKER_SYNCD_BRCM_DNX_RPC)_RUN_OPT += -v /host/warmboot:/var/warmboot | ||
$(DOCKER_SYNCD_BRCM_DNX_RPC)_RUN_OPT += -v /var/run/docker-syncd:/var/run/sswsyncd | ||
$(DOCKER_SYNCD_BRCM_DNX_RPC)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro | ||
|
||
$(DOCKER_SYNCD_BRCM_DNX_RPC)_BASE_IMAGE_FILES += bcmcmd:/usr/bin/bcmcmd | ||
$(DOCKER_SYNCD_BRCM_DNX_RPC)_BASE_IMAGE_FILES += bcmsh:/usr/bin/bcmsh | ||
$(DOCKER_SYNCD_BRCM_DNX_RPC)_MACHINE = broadcom-dnx |
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,57 @@ | ||
FROM docker-syncd-brcm-dnx | ||
|
||
## Make apt-get non-interactive | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
COPY \ | ||
{% for deb in docker_syncd_brcm_dnx_rpc_debs.split(' ') -%} | ||
debs/{{ deb }}{{' '}} | ||
{%- endfor -%} | ||
debs/ | ||
|
||
RUN apt-get purge -y syncd | ||
|
||
## Pre-install the fundamental packages | ||
RUN apt-get update \ | ||
&& apt-get -y install \ | ||
net-tools \ | ||
python-pip \ | ||
python-setuptools \ | ||
build-essential \ | ||
libssl-dev \ | ||
libffi-dev \ | ||
python-dev \ | ||
wget \ | ||
cmake \ | ||
libqt5core5a \ | ||
libqt5network5 \ | ||
libboost-atomic1.71.0 | ||
|
||
RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; } ; \ | ||
{% for deb in docker_syncd_brcm_dnx_rpc_debs.split(' ') -%} | ||
dpkg_apt debs/{{ deb }}{{'; '}} | ||
{%- endfor %} | ||
|
||
RUN wget https://github.com/nanomsg/nanomsg/archive/1.0.0.tar.gz \ | ||
&& tar xvfz 1.0.0.tar.gz \ | ||
&& cd nanomsg-1.0.0 \ | ||
&& mkdir -p build \ | ||
&& cmake . \ | ||
&& make install \ | ||
&& ldconfig \ | ||
&& cd .. \ | ||
&& rm -fr nanomsg-1.0.0 \ | ||
&& rm -f 1.0.0.tar.gz \ | ||
&& pip2 install cffi==1.7.0 \ | ||
&& pip2 install --upgrade cffi==1.7.0 \ | ||
&& pip2 install wheel \ | ||
&& pip2 install nnpy \ | ||
&& mkdir -p /opt \ | ||
&& cd /opt \ | ||
&& wget https://raw.githubusercontent.com/p4lang/ptf/master/ptf_nn/ptf_nn_agent.py \ | ||
&& apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y \ | ||
&& rm -rf /root/deps | ||
|
||
COPY ["ptf_nn_agent.conf", "/etc/supervisor/conf.d/"] | ||
|
||
ENTRYPOINT ["/usr/local/bin/supervisord"] |
3 changes: 3 additions & 0 deletions
3
platform/broadcom/docker-syncd-brcm-dnx-rpc/base_image_files/bcmcmd
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,3 @@ | ||
#!/bin/bash | ||
|
||
docker exec -i syncd bcmcmd "$@" |
3 changes: 3 additions & 0 deletions
3
platform/broadcom/docker-syncd-brcm-dnx-rpc/base_image_files/bcmsh
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,3 @@ | ||
#!/bin/bash | ||
|
||
docker exec -it syncd bcmsh "$@" |
10 changes: 10 additions & 0 deletions
10
platform/broadcom/docker-syncd-brcm-dnx-rpc/ptf_nn_agent.conf
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,10 @@ | ||
[program:ptf_nn_agent] | ||
command=/usr/bin/python /opt/ptf_nn_agent.py --device-socket 1@tcp://0.0.0.0:10900 -i 1-3@Ethernet12 --set-iface-rcv-buffer=109430400 | ||
process_name=ptf_nn_agent | ||
stdout_logfile=/tmp/ptf_nn_agent.out.log | ||
stderr_logfile=/tmp/ptf_nn_agent.err.log | ||
redirect_stderr=false | ||
autostart=true | ||
autorestart=true | ||
startsecs=1 | ||
numprocs=1 |
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,13 @@ | ||
#DPKG FRK | ||
DOCKER_SYNCD_DNX_BASE = docker-syncd-brcm-dnx.gz | ||
DOCKER_SYNCD_DNX_BASE_DBG = docker-syncd-brcm-dnx-$(DBG_IMAGE_MARK).gz | ||
DPATH := $($(DOCKER_SYNCD_DNX_BASE)_PATH) | ||
DEP_FILES := $(SONIC_COMMON_FILES_LIST) platform/broadcom/docker-syncd-brcm-dnx.mk platform/broadcom/docker-syncd-brcm-dnx.dep platform/broadcom/sai.mk | ||
DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) | ||
DEP_FILES += $(shell git ls-files $(DPATH)) | ||
|
||
$(DOCKER_SYNCD_DNX_BASE)_CACHE_MODE := GIT_CONTENT_SHA | ||
$(DOCKER_SYNCD_DNX_BASE)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) | ||
$(DOCKER_SYNCD_DNX_BASE)_DEP_FILES := $(DEP_FILES) | ||
|
||
$(eval $(call add_dbg_docker,$(DOCKER_SYNCD_DNX_BASE),$(DOCKER_SYNCD_DNX_BASE_DBG))) |
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,49 @@ | ||
# docker image for brcm-dnx syncd | ||
|
||
DOCKER_SYNCD_DNX_BASE = docker-syncd-brcm-dnx.gz | ||
DOCKER_SYNCD_DNX_BASE_DBG = docker-syncd-brcm-dnx-$(DBG_IMAGE_MARK).gz | ||
DOCKER_SYNCD_DNX_PLATFORM_CODE = brcm-dnx | ||
|
||
$(DOCKER_SYNCD_DNX_BASE)_PATH = $(PLATFORM_PATH)/docker-syncd-$(DOCKER_SYNCD_DNX_PLATFORM_CODE) | ||
$(DOCKER_SYNCD_DNX_BASE)_FILES += $(SUPERVISOR_PROC_EXIT_LISTENER_SCRIPT) | ||
|
||
$(DOCKER_SYNCD_DNX_BASE)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_BUSTER) | ||
$(DOCKER_SYNCD_DNX_BASE)_DBG_DEPENDS += $($(DOCKER_CONFIG_ENGINE_BUSTER)_DBG_DEPENDS) | ||
$(DOCKER_SYNCD_DNX_BASE)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_BUSTER)_DBG_IMAGE_PACKAGES) | ||
|
||
SONIC_DOCKER_IMAGES += $(DOCKER_SYNCD_DNX_BASE) | ||
ifneq ($(ENABLE_SYNCD_RPC),y) | ||
SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_SYNCD_DNX_BASE) | ||
endif | ||
|
||
SONIC_DOCKER_DBG_IMAGES += $(DOCKER_SYNCD_DNX_BASE_DBG) | ||
ifneq ($(ENABLE_SYNCD_RPC),y) | ||
SONIC_INSTALL_DOCKER_DBG_IMAGES += $(DOCKER_SYNCD_DNX_BASE_DBG) | ||
endif | ||
|
||
|
||
$(DOCKER_SYNCD_DNX_BASE)_DEPENDS += $(SYNCD) | ||
$(DOCKER_SYNCD_DNX_BASE)_DEPENDS += $(BRCM_DNX_SAI) | ||
$(DOCKER_SYNCD_DNX_BASE)_FILES += $(DSSERVE) $(BCMCMD) | ||
|
||
ifeq ($(INSTALL_DEBUG_TOOLS), y) | ||
$(DOCKER_SYNCD_DNX_BASE)_DBG_DEPENDS += $(SYNCD_DBG) \ | ||
$(LIBSWSSCOMMON_DBG) \ | ||
$(LIBSAIMETADATA_DBG) \ | ||
$(LIBSAIREDIS_DBG) | ||
endif | ||
|
||
$(DOCKER_SYNCD_DNX_BASE)_VERSION = 1.0.0 | ||
$(DOCKER_SYNCD_DNX_BASE)_PACKAGE_NAME = syncd-dnx | ||
$(DOCKER_SYNCD_DNX_BASE)_MACHINE = broadcom-dnx | ||
$(DOCKER_SYNCD_DNX_BASE)_AFTER = $(DOCKER_SYNCD_BASE) | ||
$(DOCKER_SYNCD_DNX_BASE)_CONTAINER_NAME = syncd | ||
$(DOCKER_SYNCD_DNX_BASE)_RUN_OPT += --privileged -t | ||
$(DOCKER_SYNCD_DNX_BASE)_RUN_OPT += -v /host/machine.conf:/etc/machine.conf | ||
$(DOCKER_SYNCD_DNX_BASE)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro | ||
$(DOCKER_SYNCD_DNX_BASE)_RUN_OPT += -v /host/warmboot:/var/warmboot | ||
|
||
$(DOCKER_SYNCD_DNX_BASE)_BASE_IMAGE_FILES += bcmcmd:/usr/bin/bcmcmd | ||
$(DOCKER_SYNCD_DNX_BASE)_BASE_IMAGE_FILES += bcmsh:/usr/bin/bcmsh | ||
$(DOCKER_SYNCD_DNX_BASE)_BASE_IMAGE_FILES += bcm_common:/usr/bin/bcm_common | ||
$(DOCKER_SYNCD_DNX_BASE)_BASE_IMAGE_FILES += monit_syncd:/etc/monit/conf.d |
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,39 @@ | ||
{% from "dockers/dockerfile-macros.j2" import install_debian_packages %} | ||
FROM docker-config-engine-buster | ||
|
||
ARG docker_container_name | ||
|
||
RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%syslogtag%/;" /etc/rsyslog.conf | ||
|
||
## Make apt-get non-interactive | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
RUN apt-get update | ||
|
||
COPY \ | ||
{% for deb in docker_syncd_brcm_dnx_debs.split(' ') -%} | ||
debs/{{ deb }}{{' '}} | ||
{%- endfor -%} | ||
debs/ | ||
|
||
# Install locally-built Debian packages and implicitly install their dependencies | ||
{{ install_debian_packages(docker_syncd_brcm_dnx_debs.split(' ')) }} | ||
|
||
## TODO: add kmod into Depends | ||
RUN apt-get install -yf kmod | ||
|
||
## BRCM uses ethtool to set host interface speed | ||
RUN apt-get install -y ethtool | ||
|
||
COPY ["files/dsserve", "files/bcmcmd", "start.sh", "start_led.sh", "bcmsh", "/usr/bin/"] | ||
RUN chmod +x /usr/bin/dsserve /usr/bin/bcmcmd | ||
|
||
COPY ["supervisord.conf", "/etc/supervisor/conf.d/"] | ||
COPY ["files/supervisor-proc-exit-listener", "/usr/bin"] | ||
COPY ["critical_processes", "/etc/supervisor/"] | ||
|
||
## Clean up | ||
RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y | ||
RUN rm -rf /debs | ||
|
||
ENTRYPOINT ["/usr/local/bin/supervisord"] |
40 changes: 40 additions & 0 deletions
40
platform/broadcom/docker-syncd-brcm-dnx/base_image_files/bcm_common
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,40 @@ | ||
#!/bin/bash | ||
|
||
function help() | ||
{ | ||
echo "Usage: $0 -n [0 to $(($NUM_ASIC-1))]" 1>&2; exit 1; | ||
|
||
} | ||
|
||
|
||
DEV="" | ||
|
||
PLATFORM=`sonic-cfggen -H -v DEVICE_METADATA.localhost.platform` | ||
|
||
# Parse the device specific asic conf file, if it exists | ||
|
||
ASIC_CONF=/usr/share/sonic/device/$PLATFORM/asic.conf | ||
if [ -f "$ASIC_CONF" ]; then | ||
source $ASIC_CONF | ||
fi | ||
|
||
|
||
if [[ ($NUM_ASIC -gt 1) ]]; then | ||
OPTIND=1 | ||
|
||
while getopts ":n:h:" opt; do | ||
case "${opt}" in | ||
h) help | ||
exit 0 | ||
;; | ||
n) DEV=${OPTARG} | ||
[ $DEV -lt $NUM_ASIC -a $DEV -ge 0 ] || help | ||
;; | ||
esac | ||
done | ||
shift "$((OPTIND-1))" | ||
|
||
if [ -z "${DEV}" ]; then | ||
help | ||
fi | ||
fi |
Oops, something went wrong.