Skip to content

Merge vector packet processing (vpp) from sonic-platform-vpp with virtual switch #1473

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

Merged
merged 34 commits into from
Apr 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
ea90c34
Make vpp as SwitchVpp class
kcudnik Nov 28, 2024
705a0ae
Update VPP_LIBS variable
kcudnik Dec 16, 2024
771d305
Update configure.ac
kcudnik Dec 17, 2024
34895e5
Move unchecked vpp code to vpp directory
kcudnik Dec 17, 2024
a9767a4
Fix makefile
kcudnik Dec 17, 2024
fdaa992
Fix swss enter
kcudnik Dec 17, 2024
aa04ead
remove unnecessary paths
kcudnik Dec 17, 2024
14fc320
Update Makefile to skip vpp if not available
kcudnik Dec 17, 2024
97d3477
Merge branch 'master' into vppint
kcudnik Feb 6, 2025
d8a7858
add more excluded warnings to compile vpp
kcudnik Feb 7, 2025
6cd1142
Fix warn messages
kcudnik Feb 7, 2025
c60c941
Add vpp in swss docker
kcudnik Feb 7, 2025
d4fea11
install libnl first in swss docker
kcudnik Feb 8, 2025
fa0084d
try without libteam swss
kcudnik Feb 8, 2025
a968337
add libnl-cli to swss docker
kcudnik Feb 12, 2025
8cd688d
try pririlaged
kcudnik Feb 12, 2025
2af4459
build docker swss with vpp
kcudnik Feb 20, 2025
a6e24d0
install vpp deb explicitly
kcudnik Feb 24, 2025
1a3e757
update libc6
kcudnik Feb 24, 2025
583e3db
update libc6
kcudnik Feb 24, 2025
e1e7619
Merge branch 'master' into vppint
kcudnik Mar 3, 2025
3c35cf6
Add functions from SwitchBCM
kcudnik Mar 5, 2025
89b21cb
Fix a typo in README.md
yue-fred-gao Mar 18, 2025
04a4e2c
Sync to latest vpp code
yue-fred-gao Mar 21, 2025
fd0fd39
Address issues found in swsslogentercheck.sh and checkwhitespace.sh
yue-fred-gao Mar 25, 2025
a2be27c
Fix compilation issue
yue-fred-gao Mar 25, 2025
b4b71a9
Fix compilation warnings and return proper hash and ecmp attributes
yue-fred-gao Apr 1, 2025
383048e
Install vpp inside build docker
kcudnik Apr 9, 2025
e5817d0
Force all purge in docker
kcudnik Apr 9, 2025
e2bd2c2
fix broken instal
kcudnik Apr 9, 2025
830316c
Force fix
kcudnik Apr 10, 2025
02101dd
add dbg mesage
kcudnik Apr 10, 2025
2ff71db
replace sysctl
kcudnik Apr 10, 2025
e080083
remove privilaged docker
kcudnik Apr 11, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .azure-pipelines/build-docker-sonic-vs-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,18 @@ jobs:
patterns: |
libdashapi*.deb
displayName: "Download dash api"
- task: DownloadPipelineArtifact@2
inputs:
source: specific
project: build
pipeline: sonic-net.sonic-platform-vpp
artifact: vpp
runVersion: 'latestFromBranch'
runBranch: 'refs/heads/main'
allowPartiallySucceededBuilds: true
path: $(Build.ArtifactStagingDirectory)/download
displayName: "Download sonic platform-vpp deb packages"
condition: eq('${{ parameters.arch }}', 'amd64')
- script: |
set -ex
echo $(Build.DefinitionName).$(Build.BuildNumber)
Expand Down
76 changes: 55 additions & 21 deletions .azure-pipelines/build-swss-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,32 @@ jobs:
git submodule update
git status
displayName: Set up sonic-swss branch
- task: DownloadPipelineArtifact@2
inputs:
source: specific
project: build
pipeline: Azure.sonic-buildimage.common_libs
runVersion: 'latestFromBranch'
runBranch: 'refs/heads/$(BUILD_BRANCH)'
path: $(Build.ArtifactStagingDirectory)/download
artifact: common-lib
patterns: |
target/debs/${{ parameters.debian_version }}/libnl-cli*.deb
target/debs/${{ parameters.debian_version }}/libnl-3*.deb
target/debs/${{ parameters.debian_version }}/libnl-genl*.deb
target/debs/${{ parameters.debian_version }}/libnl-route*.deb
target/debs/${{ parameters.debian_version }}/libnl-nf*.deb
target/debs/${{ parameters.debian_version }}/libyang_*.deb
target/debs/${{ parameters.debian_version }}/libprotobuf*.deb
target/debs/${{ parameters.debian_version }}/libprotoc*.deb
target/debs/${{ parameters.debian_version }}/protobuf-compiler*.deb
displayName: "Download libnl libs"
- script: |
set -ex
sudo dpkg -i $(find ./download -name libnl-*_${{ parameters.arch }}.deb)
condition: eq('${{ parameters.arch }}', 'amd64')
workingDirectory: $(Build.ArtifactStagingDirectory)
displayName: "Install sonic libnl"
- script: |
set -ex
sudo apt-get update
Expand Down Expand Up @@ -104,25 +130,6 @@ jobs:
libsaimetadata-dev_*.deb
syncd-vs_*.deb
displayName: "Download pre-stage built ${{ parameters.sairedis_artifact_name }}"
- task: DownloadPipelineArtifact@2
inputs:
source: specific
project: build
pipeline: Azure.sonic-buildimage.common_libs
runVersion: 'latestFromBranch'
runBranch: 'refs/heads/$(BUILD_BRANCH)'
path: $(Build.ArtifactStagingDirectory)/download
artifact: common-lib
patterns: |
target/debs/${{ parameters.debian_version }}/libnl-3*.deb
target/debs/${{ parameters.debian_version }}/libnl-genl*.deb
target/debs/${{ parameters.debian_version }}/libnl-route*.deb
target/debs/${{ parameters.debian_version }}/libnl-nf*.deb
target/debs/${{ parameters.debian_version }}/libyang_*.deb
target/debs/${{ parameters.debian_version }}/libprotobuf*.deb
target/debs/${{ parameters.debian_version }}/libprotoc*.deb
target/debs/${{ parameters.debian_version }}/protobuf-compiler*.deb
displayName: "Download common libs"
- task: DownloadPipelineArtifact@2
inputs:
source: specific
Expand All @@ -138,11 +145,38 @@ jobs:
patterns: |
libdashapi*.deb
displayName: "Download dash api test"
- task: DownloadPipelineArtifact@2
inputs:
source: specific
project: build
pipeline: sonic-net.sonic-platform-vpp
artifact: vpp
runVersion: 'latestFromBranch'
runBranch: 'refs/heads/main'
allowPartiallySucceededBuilds: true
path: $(Build.ArtifactStagingDirectory)/download
displayName: "Download sonic platform-vpp deb packages"
condition: eq('${{ parameters.arch }}', 'amd64')
- script: |
set -ex
sudo env VPP_INSTALL_SKIP_SYSCTL=1 dpkg -i download/libvppinfra-dev_*_${{ parameters.arch }}.deb
sudo env VPP_INSTALL_SKIP_SYSCTL=1 dpkg -i download/libvppinfra_*_${{ parameters.arch }}.deb
sudo env VPP_INSTALL_SKIP_SYSCTL=1 dpkg -i download/vpp_*_${{ parameters.arch }}.deb
sudo env VPP_INSTALL_SKIP_SYSCTL=1 dpkg -i download/vpp-crypto-engines_*_${{ parameters.arch }}.deb
sudo env VPP_INSTALL_SKIP_SYSCTL=1 dpkg -i download/vpp-dbg_*_${{ parameters.arch }}.deb
sudo env VPP_INSTALL_SKIP_SYSCTL=1 dpkg -i download/vpp-dev_*_${{ parameters.arch }}.deb
sudo env VPP_INSTALL_SKIP_SYSCTL=1 dpkg -i download/vpp-plugin-core_*_${{ parameters.arch }}.deb
sudo env VPP_INSTALL_SKIP_SYSCTL=1 dpkg -i download/vpp-plugin-devtools_*_${{ parameters.arch }}.deb
sudo env VPP_INSTALL_SKIP_SYSCTL=1 dpkg -i download/vpp-plugin-dpdk_*_${{ parameters.arch }}.deb
sudo env VPP_INSTALL_SKIP_SYSCTL=1 dpkg -i download/python3-vpp-api_*_${{ parameters.arch }}.deb
workingDirectory: $(Build.ArtifactStagingDirectory)
displayName: "Install sonic platform-vpp packages"
condition: eq('${{ parameters.arch }}', 'amd64')
- script: |
set -ex
# install libyang before install libswsscommon
sudo dpkg -i $(find ./download -name libyang_*.deb)
sudo dpkg -i $(find ./download -name *.deb)
sudo env VPP_INSTALL_SKIP_SYSCTL=1 dpkg -i $(find ./download -name libyang_*.deb)
sudo env VPP_INSTALL_SKIP_SYSCTL=1 dpkg -i $(find ./download -name *.deb)
rm -rf download || true
cat /etc/apt/sources.list
dpkg --list |grep libnl
Expand Down
28 changes: 26 additions & 2 deletions .azure-pipelines/docker-sonic-vs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,37 @@ ARG need_dbg

COPY ["debs", "/debs"]

# Remove existing packages first before installing the new/current packages. This is to overcome limitations with
# Remove the libswsscommon package first with force all option.
# Remove the other existing packages before installing the new/current packages. This is to overcome limitations with
# Docker's diff detection mechanism, where only the file size and the modification timestamp (which will remain the
# same, even though contents have changed) are checked between the previous and current layer.
RUN dpkg --purge libswsscommon python3-swsscommon sonic-db-cli libsaimetadata libsairedis libsaivs syncd-vs swss sonic-eventd libdashapi
RUN dpkg --remove --force-all libswsscommon
RUN apt --fix-broken install -y
RUN dpkg --purge python3-swsscommon sonic-db-cli libsaimetadata libsairedis libsaivs syncd-vs swss sonic-eventd libdashapi

RUN apt-get update

RUN cat /etc/apt/sources.list.d/debian.sources || true
RUN cat /etc/apt/sources.list || true

# vpp package configure requires to set:
# permission denied on key "vm.nr_hugepages"
# permission denied on key "vm.hugetlb_shm_group"
# permission denied on key "fs.protected_fifos"
# permission denied on key "fs.protected_hardlinks"
# permission denied on key "fs.protected_regular"
# permission denied on key "fs.protected_symlinks"

# which can't be done during "docker build" command
# so let's put "true" command as sysctl, and after install let's bring it back

RUN cp /usr/sbin/sysctl /usr/sbin/sysctl.org
RUN cp /usr/bin/true /usr/sbin/sysctl

RUN apt install -y $(ls /debs/*.deb | grep vpp)

RUN mv /usr/sbin/sysctl.org /usr/sbin/sysctl

RUN apt install -y /debs/libdashapi_1.0.0_amd64.deb \
/debs/libswsscommon_1.0.0_amd64.deb \
/debs/python3-swsscommon_1.0.0_amd64.deb \
Expand Down
5 changes: 5 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,11 @@ CXXFLAGS="$SAVED_FLAGS"

AC_SUBST(CXXFLAGS_COMMON)

# -lvlibapi -lvapiclient -lvppapiclient -lvlibmemoryclient -lsvm -lvppinfra -lvlib -lvatplugin
# -lvapiclient -lsvm -lvatplugin
AC_CHECK_LIB([vlib], [main], [AC_SUBST(VPP_LIBS, "-lvlib -lvlibapi -lvppapiclient -lvlibmemoryclient -lvppinfra")])
AM_CONDITIONAL([USE_VPP], [test "x$VPP_LIBS" != "x"])

AC_ARG_WITH(extra-libsai-ldflags,
[ --with-extra-libsai-ldflags=FLAGS
extra libsai.so flags for vendor library],
Expand Down
2 changes: 1 addition & 1 deletion saidiscovery/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ AM_CXXFLAGS = $(SAIINC) -I$(top_srcdir)/meta -I$(top_srcdir)/lib
bin_PROGRAMS = saidiscovery

if SAIVS
SAILIB=-L$(top_srcdir)/vslib/.libs -lsaivs
SAILIB=-L$(top_srcdir)/vslib/.libs -lsaivs $(VPP_LIBS)
else
SAILIB=-lsai
endif
Expand Down
2 changes: 1 addition & 1 deletion saisdkdump/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ AM_CXXFLAGS = $(SAIINC)
bin_PROGRAMS = saisdkdump

if SAIVS
SAILIB=-L$(top_srcdir)/vslib/.libs -lsaivs
SAILIB=-L$(top_srcdir)/vslib/.libs -lsaivs $(VPP_LIBS)
else
SAILIB=-lsai
endif
Expand Down
6 changes: 3 additions & 3 deletions syncd/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ SUBDIRS = . tests
AM_CXXFLAGS = $(SAIINC) -I$(top_srcdir)/lib -I$(top_srcdir)/vslib

if SAIVS
SAILIB=-L$(top_srcdir)/vslib/.libs -lsaivs
SAILIB=-L$(top_srcdir)/vslib/.libs -lsaivs $(VPP_LIBS)
else
SAILIB=-lsai
endif
Expand Down Expand Up @@ -98,7 +98,7 @@ libSyncdRequestShutdown_a_CXXFLAGS = $(DBGFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS_COMMO
syncd_request_shutdown_SOURCES = syncd_request_shutdown.cpp
syncd_request_shutdown_CPPFLAGS = $(CODE_COVERAGE_CPPFLAGS)
syncd_request_shutdown_CXXFLAGS = $(DBGFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS_COMMON) $(CODE_COVERAGE_CXXFLAGS)
syncd_request_shutdown_LDADD = libSyncdRequestShutdown.a $(top_srcdir)/lib/libSaiRedis.a -lhiredis -lswsscommon -lpthread $(CODE_COVERAGE_LIBS)
syncd_request_shutdown_LDADD = libSyncdRequestShutdown.a $(top_srcdir)/lib/libSaiRedis.a -lhiredis -lswsscommon -lpthread $(CODE_COVERAGE_LIBS) $(VPP_LIBS)

libMdioIpcClient_a_SOURCES = MdioIpcClient.cpp

Expand All @@ -115,7 +115,7 @@ syncd_tests_SOURCES = tests.cpp
syncd_tests_CXXFLAGS = $(DBGFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS_COMMON)
syncd_tests_LDFLAGS = -Wl,-rpath,$(top_srcdir)/lib/.libs -Wl,-rpath,$(top_srcdir)/meta/.libs
syncd_tests_LDADD = libSyncd.a -lhiredis -lswsscommon -lpthread -L$(top_srcdir)/lib/.libs -lsairedis \
-L$(top_srcdir)/meta/.libs -lsaimetadata -lsaimeta -lzmq $(CODE_COVERAGE_LIBS)
-L$(top_srcdir)/meta/.libs -lsaimetadata -lsaimeta -lzmq $(CODE_COVERAGE_LIBS) $(VPP_LIBS)

TESTS = syncd_tests

Expand Down
2 changes: 1 addition & 1 deletion syncd/tests/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ tests_CXXFLAGS = \
tests_LDADD = \
$(top_srcdir)/syncd/libSyncd.a $(top_srcdir)/lib/libSaiRedis.a $(top_srcdir)/syncd/libSyncdRequestShutdown.a \
-L$(top_srcdir)/meta/.libs -lsaimetadata -lsaimeta -L$(top_srcdir)/vslib/.libs -lsaivs \
-lhiredis -lswsscommon -lpthread -lzmq $(LDADD_GTEST) $(CODE_COVERAGE_LIBS)
-lhiredis -lswsscommon -lpthread -lzmq $(LDADD_GTEST) $(CODE_COVERAGE_LIBS) $(VPP_LIBS)

TESTS = tests
2 changes: 1 addition & 1 deletion tests/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ AM_CXXFLAGS = $(SAIINC) -I$(top_srcdir)/lib -I$(top_srcdir)/vslib

bin_PROGRAMS = vssyncd tests testclient testdash_gtest

SAILIB=-L$(top_srcdir)/vslib/.libs -lsaivs
SAILIB=-L$(top_srcdir)/vslib/.libs -lsaivs $(VPP_LIBS)

vssyncd_SOURCES = main.cpp
vssyncd_CPPFLAGS = $(CODE_COVERAGE_CPPFLAGS)
Expand Down
1 change: 1 addition & 0 deletions tests/aspellcheck.pl
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ sub RunAspell
next if $file =~ m!/python/.+wrap.cpp!;
next if $file =~ m!/pyext/.+wrap.cpp!;
next if $file =~ m!sai_(redis|proxy|vs|stub).cpp!;
next if $file =~ m!vslib/vpp/!;

my $data = ReadFile $file;

Expand Down
2 changes: 1 addition & 1 deletion unittest/syncd/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ tests_SOURCES = main.cpp \
tests_CXXFLAGS = $(DBGFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS_COMMON)
tests_LDFLAGS = -Wl,-rpath,$(top_srcdir)/lib/.libs -Wl,-rpath,$(top_srcdir)/meta/.libs
tests_LDADD = $(LDADD_GTEST) $(top_srcdir)/syncd/libSyncdRequestShutdown.a $(top_srcdir)/syncd/libSyncd.a $(top_srcdir)/vslib/libSaiVS.a $(top_srcdir)/syncd/libMdioIpcClient.a \
-lhiredis -lswsscommon -lnl-genl-3 -lnl-nf-3 -lnl-route-3 -lnl-3 -lpthread -L$(top_srcdir)/lib/.libs -lsairedis -L$(top_srcdir)/meta/.libs -lsaimetadata -lsaimeta -lzmq $(CODE_COVERAGE_LIBS)
-lhiredis -lswsscommon -lnl-genl-3 -lnl-nf-3 -lnl-route-3 -lnl-3 -lpthread -L$(top_srcdir)/lib/.libs -lsairedis -L$(top_srcdir)/meta/.libs -lsaimetadata -lsaimeta -lzmq $(CODE_COVERAGE_LIBS) $(VPP_LIBS)

TESTS = tests
2 changes: 1 addition & 1 deletion unittest/vslib/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@ tests_SOURCES = main.cpp \

tests_CXXFLAGS = $(DBGFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS_COMMON) -fno-access-control
tests_LDADD = $(LDADD_GTEST) $(top_srcdir)/vslib/libSaiVS.a -lhiredis -lswsscommon -lnl-genl-3 -lnl-nf-3 -lnl-route-3 -lnl-3 \
-lpthread -L$(top_srcdir)/meta/.libs -lsaimetadata -lsaimeta -lzmq $(CODE_COVERAGE_LIBS)
-lpthread -L$(top_srcdir)/meta/.libs -lsaimetadata -lsaimeta -lzmq $(CODE_COVERAGE_LIBS) $(VPP_LIBS)

TESTS = tests
20 changes: 16 additions & 4 deletions vslib/HostInterfaceInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,7 @@ HostInterfaceInfo::HostInterfaceInfo(
{
SWSS_LOG_ENTER();

m_run_thread = true;

m_e2t = std::make_shared<std::thread>(&HostInterfaceInfo::veth2tap_fun, this);
m_t2e = std::make_shared<std::thread>(&HostInterfaceInfo::tap2veth_fun, this);
m_run_thread = false;
}

HostInterfaceInfo::~HostInterfaceInfo()
Expand Down Expand Up @@ -77,6 +74,21 @@ HostInterfaceInfo::~HostInterfaceInfo()
SWSS_LOG_NOTICE("joined threads for hostif: %s", m_name.c_str());
}

void HostInterfaceInfo::runThreads()
{
SWSS_LOG_ENTER();

if (m_run_thread)
{
return;
}

m_run_thread = true;

m_e2t = std::make_shared<std::thread>(&HostInterfaceInfo::veth2tap_fun, this);
m_t2e = std::make_shared<std::thread>(&HostInterfaceInfo::tap2veth_fun, this);
}

void HostInterfaceInfo::async_process_packet_for_fdb_event(
_In_ const uint8_t *data,
_In_ size_t size) const
Expand Down
2 changes: 2 additions & 0 deletions vslib/HostInterfaceInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ namespace saivs
bool uninstallTap2EthFilter(
_In_ std::shared_ptr<TrafficFilter> filter);

void runThreads();

private:

void veth2tap_fun();
Expand Down
36 changes: 34 additions & 2 deletions vslib/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
AM_CXXFLAGS = $(SAIINC) -I$(top_srcdir)/lib -I/usr/include/libnl3

if USE_VPP
AM_CXXFLAGS += -Ivpp -DUSE_VPP
endif

CFLAGS_COMMON= -fPIC -pipe -Wall -Wcast-align -Wcast-qual -Wconversion -Wdisabled-optimization -Werror -Wextra -Wfloat-equal -Wformat=2 -Wformat-nonliteral -Wformat-security -Wformat-y2k -Wimport -Winit-self -Wno-inline -Winvalid-pch -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-include-dirs -Wmissing-noreturn -Wno-aggregate-return -Wno-padded -Wno-switch-enum -Wno-unused-parameter -Wpacked -Wpointer-arith -Wredundant-decls -Wshadow -Wstack-protector -Wstrict-aliasing=3 -Wswitch -Wswitch-default -Wunreachable-code -Wunused -Wvariadic-macros -Wwrite-strings -Wno-switch-default -Wconversion -Wno-psabi -Wcast-align=strict

# TODO fix multiple paths
AM_CFLAGS = -I/usr/include/vpp_plugins $(SAIINC) -fPIC $(CFLAGS_COMMON) -I.

lib_LTLIBRARIES = libsaivs.la

noinst_LIBRARIES = libSaiVS.a

# TODO: move vppxlate to proper lib and namespaces

libSaiVS_a_SOURCES = \
Buffer.cpp \
ContextConfigContainer.cpp \
Expand Down Expand Up @@ -61,6 +72,27 @@ libSaiVS_a_SOURCES = \
VirtualSwitchSaiInterfaceFdb.cpp \
VirtualSwitchSaiInterfacePort.cpp

if USE_VPP
libSaiVS_a_SOURCES +=\
vpp/SaiObjectDB.cpp \
vpp/SwitchVpp.cpp \
vpp/SwitchVppAcl.cpp \
vpp/SwitchVppNexthop.cpp \
vpp/SwitchVppUtils.cpp \
vpp/SwitchVppFdb.cpp \
vpp/SwitchVppRif.cpp \
vpp/SwitchVppBfd.cpp \
vpp/SwitchVppHostif.cpp \
vpp/SwitchVppRoute.cpp \
vpp/SwitchVppNbr.cpp \
vpp/SwitchVppSRv6.cpp \
vpp/TunnelManager.cpp \
vpp/vppxlate/SaiVppXlate.c \
vpp/vppxlate/SaiVppStats.c \
vpp/vppxlate/SaiAclStats.c \
vpp/vppxlate/SaiIntfStats.c
endif

BUILT_SOURCES = sai_vs.cpp

sai_vs.cpp: ../stub.pl $(top_srcdir)/SAI/meta/saimetadata.c
Expand All @@ -76,12 +108,12 @@ libSaiVS_a_CXXFLAGS = $(DBGFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS_COMMON) $(CODE_COVER

libsaivs_la_CPPFLAGS = $(CODE_COVERAGE_CPPFLAGS)
libsaivs_la_CXXFLAGS = $(DBGFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS_COMMON) $(CODE_COVERAGE_CXXFLAGS)
libsaivs_la_LIBADD = -lhiredis -lswsscommon libSaiVS.a $(CODE_COVERAGE_LIBS)
libsaivs_la_LIBADD = -lhiredis -lswsscommon libSaiVS.a $(CODE_COVERAGE_LIBS) $(VPP_LIBS)

bin_PROGRAMS = tests

tests_SOURCES = tests.cpp
tests_CXXFLAGS = $(DBGFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS_COMMON)
tests_LDADD = -lhiredis -lswsscommon -lpthread libsaivs.la -L$(top_srcdir)/meta/.libs -lsaimetadata -lsaimeta -lzmq
tests_LDADD = -lhiredis -lswsscommon -lpthread libsaivs.la -L$(top_srcdir)/meta/.libs -lsaimetadata -lsaimeta -lzmq $(VPP_LIBS)

TESTS = tests
5 changes: 5 additions & 0 deletions vslib/SwitchConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ bool SwitchConfig::parseSwitchType(
*/
switchType = SAI_VS_SWITCH_TYPE_NVDA_MBF2H536C;
}
else if (st == SAI_VALUE_VS_SWITCH_TYPE_VPP)
{
switchType = SAI_VS_SWITCH_TYPE_VPP;
}
else
{
std::vector<std::string> vals {
Expand All @@ -100,6 +104,7 @@ bool SwitchConfig::parseSwitchType(
SAI_VALUE_VS_SWITCH_TYPE_MLNX2700,
SAI_VALUE_VS_SWITCH_TYPE_NVDA_MBF2H536C,
SAI_VALUE_VS_SWITCH_TYPE_DPU_SIMU_2P
SAI_VALUE_VS_SWITCH_TYPE_VPP,
};

SWSS_LOG_ERROR("unknown switch type: '%s', expected (%s)",
Expand Down
2 changes: 2 additions & 0 deletions vslib/SwitchConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ namespace saivs

SAI_VS_SWITCH_TYPE_NVDA_MBF2H536C,

SAI_VS_SWITCH_TYPE_VPP,

} sai_vs_switch_type_t;

typedef enum _sai_vs_boot_type_t
Expand Down
Loading