-
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.
[vs]: BMv2-based DPU KVM image (#18762)
Why I did it Provide POC for development and cooperation. Test for CI (Azp) Microsoft ADO (number only): 27515178 How I did it HLD: sonic-net/SONiC#1634 How to verify it Merge PR: sonic-net/sonic-sairedis#1377 Download the vsdpu image from Azp check the syncd links to the correct DASH SAI admin@vlab-01:~$ docker exec -ti syncd bash root@vlab-01:/# dpkg -l | grep sai ii libsai 1.0.0 amd64 This package contains DASH libsai root@vlab-01:/# dpkg -L libsai /. /etc /etc/dash /etc/dash/dash_pipeline.json /etc/dash/dash_pipeline_ir.json /etc/dash/dash_pipeline_p4rt.json /etc/dash/dash_pipeline_p4rt.txt /usr /usr/lib /usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/libsai.so root@vlab-01:/# which syncd_dash /usr/bin/syncd_dash root@vlab-01:/# ldd /usr/bin/syncd_dash | grep sai libsaimetadata.so.0 => /usr/lib/x86_64-linux-gnu/libsaimetadata.so.0 (0x00007f949e99b000) libsaimeta.so.0 => /usr/lib/x86_64-linux-gnu/libsaimeta.so.0 (0x00007f949e8ca000) libsai.so => /usr/lib/x86_64-linux-gnu/libsai.so (0x00007f949e417000) root@vlab-01:/# md5sum /usr/lib/x86_64-linux-gnu/libsai.so 9e86fa2f49a824837064d1b8f95b7e48 /usr/lib/x86_64-linux-gnu/libsai.so root@vlab-01:/# ls /etc/dash dash_pipeline.json dash_pipeline_ir.json dash_pipeline_p4rt.json dash_pipeline_p4rt.txt Check the dash engine logs(BMv2) likes following admin@vlab-01:~$ docker logs dash_engine Calling target program-options parser Adding interface eth1 as port 0 [11:20:12.458] [bmv2] [D] [thread 7] Adding interface eth1 as port 0 [11:20:12.500] [bmv2] [E] [thread 7] Add port operation failed Adding interface eth2 as port 1 [11:20:12.500] [bmv2] [D] [thread 7] Adding interface eth2 as port 1 [11:20:12.556] [bmv2] [E] [thread 7] Add port operation failed Server listening on 0.0.0.0:9559 [11:22:09.706] [bmv2] [D] [thread 23] Set default default entry for table 'tbl_dash_pipeline241': dash_pipeline241 - [11:22:09.706] [bmv2] [D] [thread 23] Set default default entry for table 'dash_ingress.vip': dash_ingress.deny - [11:22:09.706] [bmv2] [D] [thread 23] Set default default entry for table 'tbl_dash_pipeline247': dash_pipeline247 - [11:22:09.706] [bmv2] [D] [thread 23] Set default default entry for table 'dash_ingress.direction_lookup_stage.direction_lookup': dash_ingress.direction_lookup_stage.set_inbound_direction - [11:22:09.706] [bmv2] [D] [thread 23] Set default default entry for table 'dash_ingress.appliance': NoAction - [11:22:09.706] [bmv2] [D] [thread 23] Set default default entry for table 'tbl_eni_lookup33': eni_lookup33 - [11:22:09.706] [bmv2] [D] [thread 23] Set default default entry for table 'tbl_eni_lookup33_0': eni_lookup33_0 - [11:22:09.706] [bmv2] [D] [thread 23] Set default default entry for table 'tbl_eni_lookup33_1': eni_lookup33_1 - [11:22:09.706] [bmv2] [D] [thread 23] Set default default entry for table ... [11:23:32.035] [bmv2] [D] [thread 23] Set default default entry for table 'tbl_metering_update92': metering_update92 - [11:23:32.035] [bmv2] [D] [thread 23] Set default default entry for table 'tbl_metering_update94': metering_update94 - [11:23:32.035] [bmv2] [D] [thread 23] Set default default entry for table 'tbl_metering_update97': metering_update97 - [11:23:32.035] [bmv2] [D] [thread 23] Set default default entry for table 'dash_ingress.metering_update_stage.meter_bucket': NoAction - [11:23:32.035] [bmv2] [D] [thread 23] Set default default entry for table 'tbl_metering_update103': metering_update103 - [11:23:32.035] [bmv2] [D] [thread 23] Set default default entry for table 'tbl_metering_update105': metering_update105 - [11:23:32.035] [bmv2] [D] [thread 23] Set default default entry for table 'dash_ingress.metering_update_stage.eni_meter': NoAction - [11:23:32.035] [bmv2] [D] [thread 23] Set default default entry for table 'tbl_drop_action': dash_ingress.drop_action - [11:23:32.049] [bmv2] [D] [thread 23] simple_switch target has been notified of a config swap Signed-off-by: Ze Gan <ganze718@gmail.com>
- Loading branch information
Showing
27 changed files
with
470 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[Unit] | ||
Description=Dash engine service | ||
Before=syncd.service | ||
StartLimitIntervalSec=1200 | ||
StartLimitBurst=3 | ||
|
||
[Service] | ||
User=root | ||
ExecStartPre=/usr/bin/dash_engine.sh start | ||
ExecStart=/usr/bin/dash_engine.sh wait | ||
ExecStop=/usr/bin/dash_engine.sh stop | ||
Restart=always | ||
RestartSec=30 | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
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,8 @@ | ||
DPATH := $($(DOCKER_DASH_ENGINE)_PATH) | ||
DEP_FILES := $(SONIC_COMMON_FILES_LIST) platform/vs/docker-dash-engine.mk platform/vs/docker-dash-engine.dep | ||
DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) | ||
DEP_FILES += $(shell git ls-files $(DPATH)) | ||
|
||
$(DOCKER_DASH_ENGINE)_CACHE_MODE := GIT_CONTENT_SHA | ||
$(DOCKER_DASH_ENGINE)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) | ||
$(DOCKER_DASH_ENGINE)_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,14 @@ | ||
# docker image for vs gbsyncd | ||
|
||
DOCKER_DASH_ENGINE = docker-dash-engine.gz | ||
$(DOCKER_DASH_ENGINE)_VERSION = 1.0.0 | ||
$(DOCKER_DASH_ENGINE)_PACKAGE_NAME = dash-engine | ||
$(DOCKER_DASH_ENGINE)_PATH = $(PLATFORM_PATH)/docker-dash-engine | ||
|
||
SONIC_DOCKER_IMAGES += $(DOCKER_DASH_ENGINE) | ||
SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_DASH_ENGINE) | ||
|
||
$(DOCKER_DASH_ENGINE)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_BOOKWORM) | ||
|
||
$(DOCKER_DASH_ENGINE)_CONTAINER_NAME = dash_engine | ||
$(DOCKER_DASH_ENGINE)_CONTAINER_PRIVILEGED = true |
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,11 @@ | ||
# Base docker build | ||
FROM docker-dash-engine-sonic:latest | ||
|
||
# Copy the cache data to host | ||
From scratch as output | ||
COPY --from=docker-dash-engine-sonic:latest /cache.tgz cache.tgz | ||
|
||
# Clean up the cache data | ||
FROM docker-dash-engine-sonic:latest as final | ||
RUN rm /cache.tgz | ||
|
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,23 @@ | ||
FROM p4lang/behavioral-model@sha256:ce45720e28a96a50f275c1b511cd84c2558b62f2cf7a7e506765183bc3fb2e32 | ||
## FROM docker-config-engine-bookworm-{{DOCKER_USERNAME}}:{{DOCKER_USERTAG}} | ||
|
||
## Make apt-get non-interactive | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
RUN apt-get update | ||
|
||
RUN apt-get install -f -y supervisor rsyslog python3-pip | ||
RUN pip3 install supervisord-dependent-startup | ||
|
||
COPY ["start.sh", "/usr/bin/"] | ||
|
||
## 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/bin/supervisord"] | ||
ENTRYPOINT ["/usr/bin/start.sh"] |
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 @@ | ||
program:simple_switch_grpc |
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 @@ | ||
#!/usr/bin/env bash | ||
|
||
simple_switch_grpc --interface 0@eth1 --interface 1@eth2 --log-console --no-p4 |
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,33 @@ | ||
[supervisord] | ||
logfile_maxbytes=1MB | ||
logfile_backups=2 | ||
nodaemon=true | ||
|
||
[eventlistener:dependent-startup] | ||
command=python3 -m supervisord_dependent_startup | ||
autostart=true | ||
autorestart=unexpected | ||
startretries=0 | ||
exitcodes=0,3 | ||
events=PROCESS_STATE | ||
buffer_size=1024 | ||
|
||
[program:rsyslogd] | ||
command=/usr/sbin/rsyslogd -n -iNONE | ||
priority=1 | ||
autostart=true | ||
autorestart=unexpected | ||
stdout_logfile=syslog | ||
stderr_logfile=syslog | ||
dependent_startup=true | ||
|
||
[program:start] | ||
command=/usr/bin/start.sh | ||
priority=2 | ||
autostart=false | ||
autorestart=false | ||
startsecs=0 | ||
stdout_logfile=syslog | ||
stderr_logfile=syslog | ||
dependent_startup=true | ||
dependent_startup_wait_for=rsyslogd:running |
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,8 @@ | ||
SPATH := $($(DASH_SAI)_SRC_PATH) | ||
DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/dash-sai.mk rules/dash-sai.dep | ||
DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) | ||
DEP_FILES += $(shell git ls-files $(SPATH)) | ||
|
||
$(DASH_SAI)_CACHE_MODE := GIT_CONTENT_SHA | ||
$(DASH_SAI)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) | ||
$(DASH_SAI)_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,17 @@ | ||
# DASH SAI repo: https://github.com/sonic-net/DASH | ||
|
||
DASH_SAI_VERSION = 1.0.0 | ||
DASH_SAI_COMMIT = cc281333e24ade258773ea843f669251a44d7c9a | ||
|
||
export DASH_SAI_VERSION | ||
export DASH_SAI_COMMIT | ||
|
||
DASH_SAI = libsai_$(DASH_SAI_VERSION)_$(CONFIGURED_ARCH).deb | ||
$(DASH_SAI)_SRC_PATH = $(SRC_PATH)/dash-sai | ||
$(DASH_SAI)_DEPENDS = $(P4LANG_PI) $(P4LANG_BMV2) $(P4LANG_P4C) | ||
$(DASH_SAI)_RDEPENDS = $(P4LANG_PI) $(P4LANG_BMV2) $(P4LANG_P4C) | ||
SONIC_MAKE_DEBS += $(DASH_SAI) | ||
|
||
DASH_SAI_DEV = libsai-dev_$(DASH_SAI_VERSION)_$(CONFIGURED_ARCH).deb | ||
$(DASH_SAI_DEV)_DEPENDS = $(DASH_SAI) | ||
$(eval $(call add_derived_package,$(DASH_SAI),$(DASH_SAI_DEV))) |
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 @@ | ||
# grpc package | ||
# A newer GRPC has been released in bookworm, So we only need to build it | ||
# in the bullseye environment. | ||
ifeq ($(BLDENV),bullseye) | ||
|
||
GRPC_VERSION = 1.30.2 | ||
GRPC_VERSION_FULL = $(GRPC_VERSION)-3 | ||
|
||
export GRPC_VERSION | ||
export GRPC_VERSION_FULL | ||
|
||
GRPC = libgrpc10_$(GRPC_VERSION_FULL)_$(CONFIGURED_ARCH).deb | ||
$(GRPC)_DEPENDS = $(PROTOBUF) $(PROTOC32) $(PROTOBUF_COMPILER) $(PROTOBUF_DEV) $(PROTOC_DEV) $(RUBY_PROTOBUF) | ||
$(GRPC)_SRC_PATH = $(SRC_PATH)/grpc | ||
SONIC_MAKE_DEBS += $(GRPC) | ||
|
||
GRPC_DEV = libgrpc-dev_$(GRPC_VERSION_FULL)_$(CONFIGURED_ARCH).deb | ||
$(GRPC_DEV)_DEPENDS = $(GRPC) | ||
$(eval $(call add_derived_package,$(GRPC),$(GRPC_DEV))) | ||
|
||
GRPC_CPP = libgrpc++1_$(GRPC_VERSION_FULL)_$(CONFIGURED_ARCH).deb | ||
$(GRPC_CPP)_DEPENDS = $(GRPC) $(PROTOC32) | ||
$(eval $(call add_derived_package,$(GRPC),$(GRPC_CPP))) | ||
|
||
GRPC_CPP_DEV = libgrpc++-dev_$(GRPC_VERSION_FULL)_$(CONFIGURED_ARCH).deb | ||
$(GRPC_CPP_DEV)_DEPENDS = $(GRPC_CPP) $(GRPC_DEV) | ||
$(eval $(call add_derived_package,$(GRPC),$(GRPC_CPP_DEV))) | ||
|
||
PYTHON3_GRPC = python3-grpcio_$(GRPC_VERSION_FULL)_$(CONFIGURED_ARCH).deb | ||
$(PYTHON3_GRPC)_DEPENDS = $(GRPC_DEV) $(GRPC) $(GRPC_DEV) $(GRPC_CPP) $(GRPC_CPP_DEV) $(PYTHON3_PROTOBUF) | ||
$(PYTHON3_GRPC)_RDEPENDS = $(GRPC) $(GRPC_CPP) $(PYTHON3_PROTOBUF) | ||
$(eval $(call add_derived_package,$(GRPC),$(PYTHON3_GRPC))) | ||
|
||
GRPC_COMPILER = protobuf-compiler-grpc_$(GRPC_VERSION_FULL)_$(CONFIGURED_ARCH).deb | ||
$(GRPC_COMPILER)_DEPENDS = $(PROTOBUF) $(PROTOC32) $(PROTOBUF_COMPILER) | ||
$(GRPC_COMPILER)_RDEPENDS = $(PROTOBUF) $(PROTOC32) $(PROTOBUF_COMPILER) | ||
$(eval $(call add_derived_package,$(GRPC),$(GRPC_COMPILER))) | ||
|
||
endif |
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,9 @@ | ||
|
||
SPATH := $($(P4LANG_PI)_SRC_PATH) | ||
DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/p4lang.mk rules/p4lang.dep | ||
DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) | ||
DEP_FILES += $(shell git ls-files $(SPATH)) | ||
|
||
$(P4LANG_PI)_CACHE_MODE := GIT_CONTENT_SHA | ||
$(P4LANG_PI)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) | ||
$(P4LANG_PI)_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,45 @@ | ||
# p4lang package | ||
|
||
# Main target: p4lang-pi | ||
P4LANG_PI_VERSION = 0.1.0 | ||
P4LANG_PI_VERSION_FULL = $(P4LANG_PI_VERSION)-15 | ||
|
||
export P4LANG_PI_VERSION | ||
export P4LANG_PI_VERSION_FULL | ||
|
||
P4LANG_PI = p4lang-pi_$(P4LANG_PI_VERSION_FULL)_$(CONFIGURED_ARCH).deb | ||
$(P4LANG_PI)_DEPENDS = $(PROTOBUF) $(PROTOBUF_LITE) $(PROTOC32) $(PYTHON3_PROTOBUF) $(GRPC) $(GRPC_CPP) $(PYTHON3_GRPC) $(PROTOBUF_DEV) $(PROTOC_DEV) $(PROTOBUF_COMPILER) $(GRPC_DEV) $(GRPC_CPP_DEV) $(GRPC_COMPILER) | ||
$(P4LANG_PI)_RDEPENDS = $(PROTOBUF) $(PROTOBUF_LITE) $(PROTOC32) $(PYTHON3_PROTOBUF) $(GRPC) $(GRPC_CPP) $(PYTHON3_GRPC) $(PROTOBUF_DEV) $(PROTOC_DEV) $(PROTOBUF_COMPILER) $(GRPC_DEV) $(GRPC_CPP_DEV) $(GRPC_COMPILER) | ||
|
||
|
||
P4LANG = $(P4LANG_PI) | ||
$(P4LANG)_SRC_PATH = $(SRC_PATH)/p4lang | ||
SONIC_MAKE_DEBS += $(P4LANG) | ||
|
||
# p4lang-bmv2 | ||
|
||
P4LANG_BMV2_VERSION = 1.15.0 | ||
P4LANG_BMV2_VERSION_FULL = $(P4LANG_BMV2_VERSION)-7 | ||
|
||
export P4LANG_BMV2_VERSION | ||
export P4LANG_BMV2_VERSION_FULL | ||
|
||
P4LANG_BMV2 = p4lang-bmv2_$(P4LANG_BMV2_VERSION_FULL)_$(CONFIGURED_ARCH).deb | ||
$(P4LANG_BMV2)_SRC_PATH = $(SRC_PATH)/p4lang | ||
$(P4LANG_BMV2)_DEPENDS = $(P4LANG_PI) | ||
$(P4LANG_BMV2)_RDEPENDS = $(P4LANG_PI) | ||
SONIC_MAKE_DEBS += $(P4LANG_BMV2) | ||
|
||
# p4lang-p4c | ||
|
||
P4LANG_P4C_VERSION = 1.2.4.2 | ||
P4LANG_P4C_VERSION_FULL = $(P4LANG_P4C_VERSION)-2 | ||
|
||
export P4LANG_P4C_VERSION | ||
export P4LANG_P4C_VERSION_FULL | ||
|
||
P4LANG_P4C = p4lang-p4c_$(P4LANG_P4C_VERSION_FULL)_$(CONFIGURED_ARCH).deb | ||
$(P4LANG_P4C)_SRC_PATH = $(SRC_PATH)/p4lang | ||
$(P4LANG_P4C)_DEPENDS = $(P4LANG_BMV2) | ||
$(P4LANG_P4C)_RDEPENDS = $(P4LANG_BMV2) | ||
SONIC_MAKE_DEBS += $(P4LANG_P4C) |
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
Oops, something went wrong.