Skip to content

Commit

Permalink
Adding vpp platform (#1424)
Browse files Browse the repository at this point in the history
VPP is a new platform of SONiC. Here is the HLD: https://github.com/sonic-net/sonic-platform-vpp/blob/main/docs/HLD/SONICVPP-HLD.md. Currently, VPP is built by patching itself on top of VS platform, which requires it carrying a lot of diffs. It is very difficult to upgrade SONiC because patch may have a lot of conflicts. We will make VPP a platform as any other platforms to avoid patching.

What this change is doing
VPP SAI layer is built on top of vslib. It uses some classes from sonic-sairedis/meta so we need to export the header files from libsaimetata-dev.
This PR also adds some vpp specific logic to syncd_init_common.sh before starting syncd.
  • Loading branch information
yue-fred-gao authored Nov 7, 2024
1 parent 0317b16 commit 3428ffd
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
7 changes: 7 additions & 0 deletions debian/libsaimetadata-dev.install
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
meta/sai*.h usr/include/sai
meta/Sai*.h usr/include/sai
meta/Meta.h usr/include/sai
meta/AttrKeyMap.h usr/include/sai
meta/MetaKeyHasher.h usr/include/sai
meta/OidRefCounter.h usr/include/sai
meta/PortRelatedSet.h usr/include/sai
meta/Notification*.h usr/include/sai
meta/Globals.h usr/include/sai
SAI/meta/sai*.h usr/include/sai
usr/lib/*/libsaimetadata.so
usr/lib/*/libsaimeta.so
20 changes: 20 additions & 0 deletions syncd/scripts/syncd_init_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,24 @@ config_syncd_vs()
CMD_ARGS+=" -l -p $HWSKU_DIR/sai.profile"
}

vpp_api_check()
{
VPP_API_SOCK=$1
while true
do
[ -S "$VPP_API_SOCK" ] && vpp_api_test socket-name $VPP_API_SOCK <<< "show_version" 2>/dev/null | grep "version:" && break
sleep 1
done
}

config_syncd_vpp()
{
CMD_ARGS+=" -p $HWSKU_DIR/sai.profile"
vpp_api_check "/run/vpp/api.sock"
source /etc/sonic/vpp/syncd_vpp_env
export NO_LINUX_NL
}

config_syncd_soda()
{
# Add support for SAI bulk operations
Expand Down Expand Up @@ -471,6 +489,8 @@ config_syncd()
config_syncd_nephos
elif [ "$SONIC_ASIC_TYPE" == "vs" ]; then
config_syncd_vs
elif [ "$SONIC_ASIC_TYPE" == "vpp" ]; then
config_syncd_vpp
elif [ "$SONIC_ASIC_TYPE" == "innovium" ]; then
config_syncd_innovium
elif [ "$SONIC_ASIC_TYPE" == "soda" ]; then
Expand Down

0 comments on commit 3428ffd

Please sign in to comment.