Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
songqh2022 authored Jul 21, 2023
2 parents af1144a + ce8f642 commit bae7a6e
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 14 deletions.
8 changes: 5 additions & 3 deletions .azure-pipelines/test-docker-sonic-vs-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,11 @@ jobs:
condition: always()

- script: |
cp -r sonic-swss/tests/log $(Build.ArtifactStagingDirectory)/
if [ '${{ parameters.asan }}' == True ]; then
cp -vr sonic-swss/tests/log/*/log/asan $(Build.ArtifactStagingDirectory)/
if [ -d sonic-swss/tests/log ]; then
cp -r sonic-swss/tests/log $(Build.ArtifactStagingDirectory)/
if [ '${{ parameters.asan }}' == True ]; then
cp -vr sonic-swss/tests/log/*/log/asan $(Build.ArtifactStagingDirectory)/
fi
fi
displayName: "Collect logs"
condition: always()
Expand Down
22 changes: 14 additions & 8 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
config-file: ./.github/codeql/codeql-config.yml
languages: ${{ matrix.language }}

- name: prepare
- name: Install prerequisites
run: |
sudo apt-get update
sudo apt-get install -y libxml-simple-perl \
Expand Down Expand Up @@ -72,24 +72,30 @@ jobs:
python
- if: matrix.language == 'cpp'
name: build-swss-common
name: Build sonic-swss-common
run: |
cd ..
git clone https://github.com/sonic-net/sonic-swss-common
pushd sonic-swss-common
./autogen.sh
fakeroot dpkg-buildpackage -us -uc -b
dpkg-buildpackage -rfakeroot -us -uc -b -j$(nproc)
popd
dpkg-deb -x libswsscommon_1.0.0_amd64.deb $(dirname $GITHUB_WORKSPACE)
dpkg-deb -x libswsscommon-dev_1.0.0_amd64.deb $(dirname $GITHUB_WORKSPACE)
dpkg-deb -x libswsscommon_${SWSSCOMMON_VER}_amd64.deb $(dirname $GITHUB_WORKSPACE)
dpkg-deb -x libswsscommon-dev_${SWSSCOMMON_VER}_amd64.deb $(dirname $GITHUB_WORKSPACE)
env:
SWSSCOMMON_VER: "1.0.0"

- if: matrix.language == 'cpp'
name: build
name: Build repository
run: |
./autogen.sh
DEB_BUILD_OPTIONS=nocheck SWSS_COMMON_INC="$(dirname $GITHUB_WORKSPACE)/usr/include" SWSS_COMMON_LIB="$(dirname $GITHUB_WORKSPACE)/usr/lib/x86_64-linux-gnu" fakeroot debian/rules CFLAGS="-Wno-error" CXXFLAGS="-Wno-error" binary-syncd-vs
DEB_BUILD_OPTIONS=nocheck \
SWSS_COMMON_INC="$(dirname $GITHUB_WORKSPACE)/usr/include" \
SWSS_COMMON_LIB="$(dirname $GITHUB_WORKSPACE)/usr/lib/x86_64-linux-gnu" \
DEB_CFLAGS_SET="-Wno-error" DEB_CXXFLAGS_SET="-Wno-error" \
dpkg-buildpackage -us -uc -b -Psyncd,vs,nopython2 -j$(nproc)
- name: Perform CodeQL Analysis
- name: Perform CodeQL analysis
uses: github/codeql-action/[email protected]
with:
category: "/language:${{matrix.language}}"
1 change: 1 addition & 0 deletions tests/aspell.en.pws
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ CreateObject
DEI
Decrement
Destructor
DPU
EAPOL
ECN
EIO
Expand Down
23 changes: 20 additions & 3 deletions vslib/SwitchConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

#include "swss/logger.h"

#include <boost/algorithm/string/join.hpp>

#include <cstring>

using namespace saivs;
Expand Down Expand Up @@ -79,14 +81,29 @@ bool SwitchConfig::parseSwitchType(
{
switchType = SAI_VS_SWITCH_TYPE_NVDA_MBF2H536C;
}
else if (st == SAI_VALUE_VS_SWITCH_TYPE_DPU_SIMU_2P)
{
/*
* TODO: Temporarily set switchType to SAI_VS_SWITCH_TYPE_NVDA_MBF2H536C
* for 2-port DPU. This will need to be revisited when there are other
* DPU types.
*/
switchType = SAI_VS_SWITCH_TYPE_NVDA_MBF2H536C;
}
else
{
SWSS_LOG_ERROR("unknown switch type: '%s', expected (%s|%s|%s|%s)",
switchTypeStr,
std::vector<std::string> vals {
SAI_VALUE_VS_SWITCH_TYPE_BCM81724,
SAI_VALUE_VS_SWITCH_TYPE_BCM56850,
SAI_VALUE_VS_SWITCH_TYPE_BCM56971B0,
SAI_VALUE_VS_SWITCH_TYPE_MLNX2700);
SAI_VALUE_VS_SWITCH_TYPE_MLNX2700,
SAI_VALUE_VS_SWITCH_TYPE_NVDA_MBF2H536C,
SAI_VALUE_VS_SWITCH_TYPE_DPU_SIMU_2P
};

SWSS_LOG_ERROR("unknown switch type: '%s', expected (%s)",
switchTypeStr,
boost::algorithm::join(vals, "|").c_str());

return false;
}
Expand Down
1 change: 1 addition & 0 deletions vslib/saivs.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ extern "C" {
#define SAI_VALUE_VS_SWITCH_TYPE_BCM81724 "SAI_VS_SWITCH_TYPE_BCM81724"
#define SAI_VALUE_VS_SWITCH_TYPE_MLNX2700 "SAI_VS_SWITCH_TYPE_MLNX2700"
#define SAI_VALUE_VS_SWITCH_TYPE_NVDA_MBF2H536C "SAI_VS_SWITCH_TYPE_NVDA_MBF2H536C"
#define SAI_VALUE_VS_SWITCH_TYPE_DPU_SIMU_2P "SAI_VS_SWITCH_TYPE_DPU_SIMU_2P"

/*
* Values for SAI_KEY_BOOT_TYPE (defined in saiswitch.h)
Expand Down

0 comments on commit bae7a6e

Please sign in to comment.