Skip to content

Commit

Permalink
Merge branch 'github-master' into sag-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
superchild committed Mar 31, 2022
2 parents 53e2225 + 0f06910 commit 0e92c96
Show file tree
Hide file tree
Showing 125 changed files with 7,845 additions and 3,192 deletions.
20 changes: 20 additions & 0 deletions .azure-pipelines/build-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ jobs:
path: '$(Build.SourcesDirectory)/${{ parameters.sairedis_artifact_name }}'
displayName: "Download sonic sairedis deb packages"
- task: DownloadPipelineArtifact@2
${{ if eq(parameters.buildimage_pipeline, 141) }}:
continueOnError: True
inputs:
source: specific
project: build
Expand All @@ -105,6 +107,24 @@ jobs:
runBranch: 'refs/heads/master'
path: '$(Build.SourcesDirectory)/${{ parameters.buildimage_artifact_name }}'
displayName: "Download sonic buildimage deb packages"
- script: |
buildimage_artifact_downloaded=n
[ -d "$(Build.SourcesDirectory)/${{ parameters.buildimage_artifact_name }}/target" ] && buildimage_artifact_downloaded=y
echo "buildimage_artifact_downloaded=$buildimage_artifact_downloaded"
echo "##vso[task.setvariable variable=buildimage_artifact_downloaded]$buildimage_artifact_downloaded"
condition: eq(${{ parameters.buildimage_pipeline }}, 141)
displayName: "Check if sonic buildimage deb packages downloaded"
- task: DownloadPipelineArtifact@2
condition: and(eq(variables.buildimage_artifact_downloaded, 'n'), eq(${{ parameters.buildimage_pipeline }}, 141))
inputs:
source: specific
project: build
pipeline: ${{ parameters.buildimage_pipeline }}
artifact: 'sonic-buildimage.marvell-armhf1'
runVersion: specific
runId: 80637
path: '$(Build.SourcesDirectory)/${{ parameters.buildimage_artifact_name }}'
displayName: "Download sonic buildimage deb packages from 80637"
- script: |
cd $(Build.SourcesDirectory)/${{ parameters.buildimage_artifact_name }}
sudo dpkg -i target/debs/buster/libnl-3-200_*.deb
Expand Down
13 changes: 13 additions & 0 deletions .azure-pipelines/gcov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,23 @@ jobs:
${{ if eq(parameters.pool, 'default') }}:
vmImage: 'ubuntu-20.04'

variables:
DIFF_COVER_CHECK_THRESHOLD: 80
DIFF_COVER_ENABLE: 'true'

container:
image: sonicdev-microsoft.azurecr.io:443/${{ parameters.sonic_slave }}:latest


steps:
- script: |
set -ex
# Install .NET CORE
curl -sSL https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
sudo apt-add-repository https://packages.microsoft.com/debian/10/prod
sudo apt-get update
sudo apt-get install -y dotnet-sdk-5.0
displayName: "Install .NET CORE"
- script: |
sudo apt-get install -y lcov
displayName: "Install dependencies"
Expand Down Expand Up @@ -93,6 +105,7 @@ jobs:
sudo ./gcov_support.sh generate
sudo ./gcov_support.sh merge_container_info $(Build.ArtifactStagingDirectory)
sudo cp -rf gcov_output $(Build.ArtifactStagingDirectory)
sudo cp -rf $(Build.ArtifactStagingDirectory)/gcov_output/AllMergeReport/coverage.xml $(System.DefaultWorkingDirectory)/
ls -lh $(Build.ArtifactStagingDirectory)
popd
workingDirectory: $(Pipeline.Workspace)
Expand Down
9 changes: 6 additions & 3 deletions .azure-pipelines/test-docker-sonic-vs-template.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
parameters:
- name: timeout
type: number
default: 240
default: 480

- name: log_artifact_name
type: string
Expand All @@ -21,10 +21,13 @@ jobs:
displayName: vstest
timeoutInMinutes: ${{ parameters.timeout }}

pool:
vmImage: 'ubuntu-20.04'
pool: sonic-common

steps:
- script: |
ls -A1 | xargs -I{} sudo rm -rf {}
displayName: "Clean workspace"
- checkout: self
- task: DownloadPipelineArtifact@2
inputs:
artifact: docker-sonic-vs
Expand Down
33 changes: 30 additions & 3 deletions cfgmgr/buffermgrdyn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
* In internal maps: table name removed from the index
* 2. Maintain maps for pools, profiles and PGs in CONFIG_DB and APPL_DB
* 3. Keys of maps in this file don't contain the TABLE_NAME
* 3.
*/
using namespace std;
using namespace swss;
Expand All @@ -37,6 +36,7 @@ BufferMgrDynamic::BufferMgrDynamic(DBConnector *cfgDb, DBConnector *stateDb, DBC
m_zeroProfilesLoaded(false),
m_supportRemoving(true),
m_cfgDefaultLosslessBufferParam(cfgDb, CFG_DEFAULT_LOSSLESS_BUFFER_PARAMETER),
m_cfgDeviceMetaDataTable(cfgDb, CFG_DEVICE_METADATA_TABLE_NAME),
m_applBufferPoolTable(applDb, APP_BUFFER_POOL_TABLE_NAME),
m_applBufferProfileTable(applDb, APP_BUFFER_PROFILE_TABLE_NAME),
m_applBufferObjectTables({ProducerStateTable(applDb, APP_BUFFER_PG_TABLE_NAME), ProducerStateTable(applDb, APP_BUFFER_QUEUE_TABLE_NAME)}),
Expand Down Expand Up @@ -73,6 +73,30 @@ BufferMgrDynamic::BufferMgrDynamic(DBConnector *cfgDb, DBConnector *stateDb, DBC
string checkHeadroomPluginName = "buffer_check_headroom_" + platform + ".lua";

m_platform = platform;
m_specific_platform = platform; // default for non-Mellanox
m_model_number = 0;

// Retrieve the type of mellanox platform
if (m_platform == "mellanox")
{
m_cfgDeviceMetaDataTable.hget("localhost", "platform", m_specific_platform);
if (!m_specific_platform.empty())
{
// Mellanox model number follows "sn" in the platform name and is 4 digits long
std::size_t sn_pos = m_specific_platform.find("sn");
if (sn_pos != std::string::npos)
{
std::string model_number = m_specific_platform.substr (sn_pos + 2, 4);
if (!model_number.empty())
{
m_model_number = atoi(model_number.c_str());
}
}
}
if (!m_model_number) {
SWSS_LOG_ERROR("Failed to retrieve Mellanox model number");
}
}

try
{
Expand Down Expand Up @@ -471,7 +495,9 @@ string BufferMgrDynamic::getDynamicProfileName(const string &speed, const string

if (m_platform == "mellanox")
{
if ((speed != "400000") && (lane_count == 8))
if ((lane_count == 8) &&
(((m_model_number / 1000 == 4) && (speed != "400000")) ||
((m_model_number / 1000 == 5) && (speed != "800000"))))
{
// On Mellanox platform, ports with 8 lanes have different(double) xon value then other ports
// For ports at speed other than 400G can have
Expand All @@ -482,7 +508,8 @@ string BufferMgrDynamic::getDynamicProfileName(const string &speed, const string
// Eg.
// - A 100G port with 8 lanes will use buffer profile "pg_profile_100000_5m_8lane_profile"
// - A 100G port with 4 lanes will use buffer profile "pg_profile_100000_5m_profile"
// Currently, 400G ports can only have 8 lanes. So we don't add this to the profile
// Currently, for 4xxx models, 400G ports can only have 8 lanes,
// and for 5xxx models, 800G ports can only have 8 lanes. So we don't add this to the profile.
buffer_profile_key = buffer_profile_key + "_8lane";
}
}
Expand Down
7 changes: 5 additions & 2 deletions cfgmgr/buffermgrdyn.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,10 @@ class BufferMgrDynamic : public Orch
using Orch::doTask;

private:
std::string m_platform;
std::string m_platform; // vendor, e.g. "mellanox"
std::string m_specific_platform; // name of platform, e.g. "x86_64-mlnx_msn3420-r0"
unsigned int m_model_number; // model number extracted from specific platform, e.g. 3420

std::vector<buffer_direction_t> m_bufferDirections;
const std::string m_bufferObjectNames[BUFFER_DIR_MAX];
const std::string m_bufferDirectionNames[BUFFER_DIR_MAX];
Expand Down Expand Up @@ -234,7 +237,7 @@ class BufferMgrDynamic : public Orch

// Other tables
Table m_cfgDefaultLosslessBufferParam;

Table m_cfgDeviceMetaDataTable;
Table m_stateBufferMaximumTable;

Table m_applPortTable;
Expand Down
Loading

0 comments on commit 0e92c96

Please sign in to comment.